Tc Filter - Port Ranges Calculate Mask Value
- From: anshul makkar <anshulmakkar@xxxxxxxxx>
- Date: Mon, 22 Oct 2007 12:13:00 -0000
i,
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 to segregate the port values that lie
within a perticular 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 0x1ff0 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.
Suppose user has entered the port range as 10 -20. Then what should be
the mask value corresponding to this range.
Please if you have any link, clue or reference material , do share it.
Thanking You
Anshul Makkar
.
- Follow-Ups:
- Prev by Date: Re: Do MAC addresses go to internet?
- Next by Date: Re: Client-server application under linux - desperate help
- Previous by thread: Multiple certification authorities?
- Next by thread: Re: Tc Filter - Port Ranges Calculate Mask Value
- Index(es):