D. J. Bernstein
TCP/IP
ucspi-tcp

TCP environment variables

$PROTO is the string TCP.

$TCPLOCALIP is the IP address of the local host, in dotted-decimal form.

$TCPLOCALPORT is the local TCP port number, in decimal.

$TCPLOCALHOST is the name listed in DNS for the local host. If no name is available, $TCPLOCALHOST is not set. Beware that $TCPLOCALHOST can contain arbitrary characters.

$TCPREMOTEIP is the IP address of the remote host, in dotted-decimal form.

$TCPREMOTEPORT is the remote TCP port number, in decimal.

$TCPREMOTEHOST is the name listed in DNS for the remote host. If no name is available, $TCPREMOTEHOST is not set. Beware that $TCPREMOTEHOST can contain arbitrary characters.

$TCPREMOTEINFO is a connection-specific string supplied by the remote host via the 931/1413/IDENT/TAP protocol. If no information is available, $TCPREMOTEINFO is not set. Beware that $TCPREMOTEINFO can contain arbitrary characters.