Forum Discussion

smp_86112's avatar
smp_86112
Icon for Cirrostratus rankCirrostratus
Apr 28, 2010

v9 matchclass and v10 class match iRule commands

I've got a v9 irule that takes action based on whether or not the client IP address is in a data class. The v9 iRule looks like this:

 

 

if { [matchclass [IP::remote_addr] equals $::allowed_clients] } {

 

 

if I read the v10 doc:

 

For v10 users: Classes (data groups) used to be accessible as a global TCL list. Starting in v10, accessing a data group as a global variable ($::class_name) simply returns the name of the data group and is no longer a TCL list. You must now use the "class" command for all data group access.

 

 

, my interpretation is that this match class statement should be replaced with "class match", like this:

 

 

if { [class match [IP::remote_addr] equals $::allowed_clients] } {

 

 

However both statements return the same value which I've validated by logging it - they both return the index number of the class which holds the matching record. Based on the doc I expected the "$::allowed_clients" statement to return the name of the class "allowed_clients", which [IP::remote_addr] obviously will never match. However the matchclass statement seems to be working the same way in v10 as it did in v9. Am I just not understanding the doc properly?

 

11 Replies