Try out rules for tcpserver
tcprulescheck rules.cdb tcpremoteip [ tcpremoteinfo ]
tcprulescheck says what tcpserver will do with a connection from IP address tcpremoteip, following the rules compiled into rules.cdb by tcprules.
tcprules(1), tcpserver(1), tcp-environ(5)