[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[altq 545] Re: The flowinfo mask defined in altq_var.h
Hao Zhang wrote:
> I found there are some flowinfo mask bits in altq_var.h, such as
>
> #define FIMB4_PROTO 0x0001
> #define FIMB4_TOS 0x0002
> #define FIMB4_DADDR 0x0004
> #define FIMB4_SADDR 0x0008
> #define FIMB4_DPORT 0x0010
> #define FIMB4_SPORT 0x0020
> #define FIMB4_GPI 0x0040
> #define FIMB4_ALL 0x007f
>
> They are used in functions of filt2fibmask(), apply_filter4(). Can you give
> some details how these mask bits are defined. Are they related to the IP
> header sturcture? Thanks in advance
The mask bits tell what fields are used by a filter.
The classifier maintains "logical OR" of the mask bits of all the
filters, and uses this info to optimize classification.
For example, if DPORT and SPORT bits are zero, the classifier knows it
doesn't need to look into the TCP or UDP header.
-Kenjiro