From: "anshul makkar" Date: Fri, 19 Oct 2007 12:26:17 +0000 Subject: [LARTC] Tc Filter - Port Ranges Calculate Mask Value Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org 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@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc