Hi nitass,
I think i know what happen now...i didn't parse value to the response package....
i'm testing below irule now....
rule diameter_prod1_save_conections_irule {
timing on
when CLIENT_ACCEPTED {
log local0. "[TCP::remote_port]-[TCP::local_port]"
persistent timeout
set timeout 60
Device Watchdog (in hex)
set DWA_head 010000400000011800000000
origin host: BIG-IP 4249472d4950
origin realm: test.com 746573742e636f6d
set DWA_avp 0000010c4000000c000007d1000001084000000e4249472d495000000000012840000010746573742e636f6d
TCP::collect
}
when CLIENT_DATA {
while { [TCP::payload length] > 20 } {
binary scan [TCP::payload] IIIII a b c d e
set comcode [ expr $b & 0xffffff ]
set rflag [expr ($b >> 31)&1 ]
set mlen [ expr $a & 0xffffff ]
if { [TCP::payload length] < $mlen }{
TCP::collect
return
}
switch $comcode {
280 {
if { $rflag } {
log local0. "reply to watchdog from [IP::remote_addr]"
binary scan [TCP::payload] x8IH8H8 a h e
log local0. "end-to-end ID = $e"
TCP::payload replace 0 $mlen ""
TCP::respond [binary format H* ${DWA_head}$h$e${DWA_avp} ]
continue
}
}
default {
set index 20
set avp_of_interest 1
while { $index < $mlen } {
binary scan [TCP::payload] @${index}III avp_code avp_len vendor_id
set avp_flag_v [ expr ($avp_len >> 31)&1 ]
set avp_len [ expr $avp_len & 0xffffff ]
if { $avp_flag_v == 0 } {
incr index 8
set avp_dlen [ expr $avp_len - 8 ]
} else {
incr index 12
set avp_dlen [ expr $avp_len - 12 ]
}
switch $avp_code {
263 {
binary scan [TCP::payload] @${index}a${avp_dlen} sid
persist uie $sid $timeout
set s [session lookup uie $sid]
if { $s ne "" } {
pool [LB::server pool] member [lindex $s 0] [lindex $s 1]
} else {
set l [LB::select]
session add uie $sid "[lindex $l 3] [lindex $l 4]" $timeout
pool [LB::server pool] member [lindex $l 3] [lindex $l 4]
}
if { $avp_of_interest <= 1 } {
set index $mlen
break
} else {
incr avp_of_interest -1
}
}
default {
}
}
set avp_ilen [expr ($avp_dlen / 4) * 4]
if { $avp_ilen < $avp_dlen } {
incr avp_ilen 4
}
incr index $avp_ilen
}
}
}
log local0. "Sending CEA to [IP::remote_addr]"
TCP::release $mlen
TCP::notify request
}
TCP::collect
}
when SERVER_CONNECTED {
log local0. "[TCP::local_port]-[TCP::remote_port]"
TCP::collect
}
when LB_FAILED {
LB::reselect
}
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 { [TCP::payload length] < $mlen } {
TCP::collect
return
}
set check_avp 0
switch $comcode {
280 {
if { $rflag } {
log local0. "reply to watchdog from [IP::remote_addr]"
binary scan [TCP::payload] x8IH8H8 a h e
log local0. "end-to-end ID = $e"
TCP::payload replace 0 $mlen ""
TCP::respond [binary format H* ${DWA_head}$h$e${DWA_avp} ]
set mlen 0
continue
}
}
default {
set check_avp 1
}
}
TCP::collect
}
}