smp_86112
Jun 23, 2010Cirrostratus
switch statement, [IP::addr], and varying subnet masks
I have an irule that uses a bunch of if statements that I'd like to consolidate into a single switch statement:
when HTTP_REQUEST {
if { [IP::addr [IP::client_addr]/26 equals xxx.xxx.xxx.xxx] or
[IP::addr [IP::client_addr]/21 equals xxx.xxx.xxx.xxx] or
[IP::addr [IP::client_addr]/24 equals xxx.xxx.xxx.xxx] or
[IP::addr [IP::client_addr]/32 equals xxx.xxx.xxx.xxx] or
[IP::addr [IP::client_addr]/32 equals xxx.xxx.xxx.xxx] } {
pool [virtual name]_no-SM
}
}
The xxx.xxx.xxx.xxx do not denote the same address/network - they are all different.
Is there any way write this switch statement, without referencing an external class, in a way that will evaluate these conditions with the variable subnet masks?