Forum Discussion

hooleylist's avatar
hooleylist
Icon for Cirrostratus rankCirrostratus
Oct 07, 2009

matchclass versus class in v10 for address comparisons?

Is there any advantage to using class match versus matchclass to evaluate an IP address against an address type datagroup?

Here is a simple iRule I used to test class/matchclass for an IP against the AOL datagroup. Both commands seem to return expected results (with matchclass returning the record number of the matched result).

 
 when RULE_INIT { 
    log local0. "\[class match 205.188.112.0 equals aol\]: [class match 205.188.112.0 equals aol]" 
    log local0. "\[class match 1.1.1.1 equals aol\]: [class match 1.1.1.1 equals aol]" 
    log local0. "\[matchclass 205.188.112.0 equals aol\]: [matchclass 205.188.112.0 equals aol]" 
    log local0. "\[matchclass 1.1.1.1 equals aol\]: [matchclass 1.1.1.1 equals aol]" 
 } 
 

And the log output from one TMM:

[class match 205.188.112.0 equals aol]: 1

[class match 1.1.1.1 equals aol]: 0

[matchclass 205.188.112.0 equals aol]: 7

[matchclass 1.1.1.1 equals aol]: 0

Thanks,

Aaron

16 Replies