-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello Anshul and list, That is really interesting matter. I am also awaiting someone who knows how the hex mask is calculated and applied to reply to this post. I am sure it was discussed on the list before, but anyways I might have missed that part. Cheers, - -Nikolay anshul makkar wrote: > Hi, > > I need to support port ranges in tc filter rules. > > I know how to formulate the rule but , I am not able to understand how > to calculate the mask value for a perticular range so as to segregate > the port values that lie within this range . > > I got the following sample > > "tc filter add dev eth1 parent 1:1 protocol ip prio 10 u32 match ip > sport 0x1ae0 0x1ff0 flowid 1:10 This rule will match all ports from > 6880 to 6895. " > > This rule correctly matches port range from 6880 to 6895. But I am > unable to figure out , how the mask value has been calculated. > > I am picking up port ranges from GUI. So the range can be any and I > need to calculte mask value so as to find out which ports lie within > the entered range. > > Please if you have any link, clue or reference material , do share it. > > Thanking You > Anshul Makkar > _______________________________________________ > LARTC mailing list > LARTC@xxxxxxxxxxxxxxx > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEUAwUBRx3ouTFLYVOGGjgXAQK6EAf4sTwWDdKvvzvNbee8PGKEeKcpt+n0sc0M Nn1PvOKEbT8qBiUXozHVz9pQ51qXpiggjOXv78OzRJRu+q8fyq9ZlA3XS+1CiRAR KMjoUy4Rlfm0lQVqrPmQrBVX07md/OWmLGBDy4hZUrNPi82G3w7gtm39N7fSqbaE O38uaX3nFF76tu+gb6XRb9vnJVuDWi0w5Tyd4L7dp1qZIot9Vi6QpEJa02r/osvs yuP8odoxY2N4BSdcJftlU8nyD5DKuzFd6VB9yZk1EC7gNNsv7GUT/jyABFRbOuJK E5d3wugPfoeREEJ8+gzztRwoedfOkMMcJfaxRb8AcSCHFHAsOenh =7RGv -----END PGP SIGNATURE----- _______________________________________________ LARTC mailing list LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc