Hello,
I would like to make a patch to a program that sets up environment variables
based on the connecting host's remote ip and the local ip. The local ip
gives me the IP address of the realserver. Is it possible to find out what
the VIP the remote host is really connecting to?
For example I have a remote host (1.2.3.4) which connects to a VIP (4.3.2.1)
on the director and gets NATed to my program listening on (10.1.1.1) on the
realserver.
The program current will set:
TCPREMOTEIP to 1.2.3.4
TCPLOCALIP to 10.1.1.1
I would like to set
TCPVIRTUALIP to 4.3.2.1
Some code snipets from the program:
socket_local4(t,localip,&localport);
socket_accept4(s,remoteip,&remoteport);
localipstr[ip4_fmt(localipstr,localip)] = 0;
remoteipstr[ip4_fmt(remoteipstr,remoteip)] = 0;
env("TCPLOCALIP",localipstr);
env("TCPREMOTEIP",remoteipstr);
Any tips and pointers would be of great use!
|