prohibits connections from IP address 18.23.0.32.
tcprules reads rules from its standard input and writes them into cdb in a binary format suited for quick access by tcpserver(1).
tcprules can be used while tcpserver(1) is running. It ensures that cdb is updated atomically. It does this by first writing the rules to tmp and then moving tmp on top of cdb. If tmp already exists, it is destroyed. The directories containing cdb and tmp must be writable to tcprules; they must also be on the same filesystem.
If there is a problem with the input or with tmp, tcprules complains and leaves cdb alone.
The binary cdb format is portable across machines.
Each rule contains an address, a colon, and a list of instructions, with no extra spaces. When tcpserver(1) receives a connection from that address, it follows the instructions.
tcpserver(1) uses the first rule it finds. You should use the -p option to tcpserver(1) if you rely on $TCPREMOTEHOST here.
For example, here are some rules:
joe@127.0.0.1:first
18.23.0.32:second
:third
127.:fourth
If $TCPREMOTEIP is 10.119.75.38, tcpserver(1) will follow the third instructions.
If $TCPREMOTEIP is 18.23.0.32, tcpserver(1) will follow the second instructions.
If $TCPREMOTEIP is 127.0.0.1 and $TCPREMOTEINFO is bill, tcpserver(1) will follow the fourth instructions.
If $TCPREMOTEIP is 127.0.0.1 and $TCPREMOTEINFO is joe, tcpserver(1) will follow the first instructions.
You can use tcprulescheck(1) to see how tcpserver will interpret rules in cdb.
tells tcpserver(1) to drop all connections that aren't handled by more specific rules.
The instructions may continue with some environment variables, in the form var="x". tcpserver(1) adds an environment variable $var with value x. For example,
adds an environment variable $RELAYCLIENT with value @fix.me. The quotes may be replaced by any repeated character:
Any number of variables may be listed:
http://cr.yp.to/ucspi-tcp.html