TCP::unused_port

Description

Returns an unused TCP port for the specified IP tuple, using the value of <hint_port> as a starting point if it is supplied. If no appropriate unused local port could be found, 0 is returned.

Syntax

TCP::unused_port <remote_addr> <remote_port> <local_addr> [<hint_port>]

TCP::unused_port

Returns an unused TCP port for the specified IP tuple, using the value of <hint_port> as a starting point if it is supplied. If no appropriate unused local port could be found, 0 is returned.

Examples

rule rule_unused_port1 {
   when HTTP_REQUEST {
log local0. [TCP::unused_port 192.168.1.124 80 192.168.1.146]
}
}

# 192.168.1.124:80 is a pool member
# 192.168.1.146 is a self ip
# The result on /var/log/ltm is like this
# Aug 22 09:47:44 local/tmm info tmm[27004]: Rule rule_unused_port1 <HTTP_REQUEST>: 26479