Forum Discussion
Rise_77519
Nov 30, 2011Nimbostratus
irule with diameter result code
Hi ,
I need an irule for diameter service that is based on resuld codes in AVP 286 code.AVP 286 code also includes some result codes (exmp. 2001 DIAMEMETER_SUCCESS) . I would like to take ...
nitass
Nov 30, 2011Employee
not sure if this is helpful?
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:3868
ip protocol 6
rules myrule2
profiles {
diameter {}
mblb {}
tcp {}
}
}
[root@ve1023:Active] config b pool foo list
pool foo {
members 200.200.200.101:3868 {}
}
[root@ve1023:Active] config b rule myrule2 list
rule myrule2 {
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
while {[TCP::payload length] > 20} {
binary scan [TCP::payload] II a b
set comcode [expr {$b & 0xffffff}]
set mlen [expr {$a & 0xffffff}]
set rflag [expr {($b >> 31)&1}]
if {!($rflag)} {
switch $comcode {
280 -
282 {}
default {
set index 20
while {$index < $mlen} {
binary scan [TCP::payload $mlen] @${index}II avp_code avp_len
set avp_len [expr {$avp_len & 0xffffff}]
set avp_len_pad [expr {(($avp_len + 3)/4)*4}]
if {$avp_code == 268} {
set avp_dlen [expr {$avp_len - 8}]
binary scan [TCP::payload $mlen] @[expr {$index + 8}]I result
break
}
incr index $avp_len_pad
}
}
}
switch $result {
2001 { log local0. "2001" }
default { log local0. "others" }
}
}
TCP::release $mlen
}
TCP::collect
}
}
[root@ve1023:Active] config tail /var/log/ltm
Nov 30 10:52:27 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:27 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:28 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:29 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:30 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:31 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:32 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:33 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:34 local/tmm info tmm[23027]: Rule myrule2 : 2001
Nov 30 10:52:35 local/tmm info tmm[23027]: Rule myrule2 : 2001
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects