basic iRule syntax

I have the following iRule. I want to also check for “[UDP::local_port] == 80”. I would rather not nest my if statements. How can I evaluate clianet_addr and local_port in the same expression?

i.e. if { [class match [IP::client_addr] equals proxy_free] && [[UDP::local_port] == 80] }

when CLIENT_ACCEPTED {

if { [class match [IP::client_addr] equals proxy_free] } {

snat automap

} else {

snat none

}

}

Hi Russell,

You can try this:

when CLIENT_ACCEPTED {   
    if { [class match [IP::client_addr] equals proxy_free] and [UDP::local_port] == 80} {
        snat automap
    } else {
        snat none
    }
}

Aaron