[Click] IPFilter: need to classify packets according to value of certain bits of a field

Momina Khan momina.azam at gmail.com
Mon Jul 22 07:41:17 EDT 2013


Hi all i have been going through the IPFilter code for some time now ... i
have to filter packets based on the value of the 6 high end unused bits of
the TOS field in the IP header.

have set _mask.u to 252 ... as per my understanding the value of the field
to be checked is applied this mask before value checking
The problem is that  the config parameter to be compared with _u.u leaves a
gap between the greater than and less ( >110 and < 110) than value provided
after the bit shift and in this gap of values the router neither labels
packets as greater than nor less than. referring to the set_mask() routine.
What routine actually does the comparison and filtering? is there detailed
documentation of IPFilter code?

from .click file
ip_classifier :: IPClassifier(tcp and ip tos > 110,tcp and ip tos <
110/*protocol == tcp and TOS < 110*/,- /*everything else */ );

regards
momina


More information about the click mailing list