Jure_48098
Dec 11, 2008Nimbostratus
TNS TCP::payload replace
I'm trying to work out a solution for oracle TNS stream to replace HOST=VS-IP (virtual server IP) into HOST=PM-IP (pool member IP). The problem with TNS is, that it sends the host IP in payload as well and as we do NAT on the VS, the HOST value doesn't match.
The nodes and the VS are on the same subnet, so I need to do NAT on the VS. I'm been trying to figure out how to do a TCP::payload replace (how to get the offset for that string to replace). Can someone please help me with the replace string..
Thanks
Jure
At the moment I have:
when RULE_INIT {
set ::FIRST_PKT 1
set :RAVIP "10.10.10.10"
}
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
set oradata [TCP::payload]
set orahost [ findstr $oradata "HOST=" 5 ")" ]
log local0. "Got ORAHOST=$orahost"
if { $orahost equals $:RAVIP }{
set tcp_offset [ string first $oradata $orahost ]
test replace
Here i need to do a TCP::payload replace 0 [length] $pool::memberIP
}
release TCP data
TCP::release
}