lkml.org 
[lkml]   [2010]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch v2.6 4/4] libxt_ipvs: user-space lib for netfilter matcher xt_ipvs

    On Wednesday 2010-07-21 15:21, Simon Horman wrote:
    >> On Wednesday 2010-07-21 03:21, Simon Horman wrote:
    >> >> +
    >> >> +#define XT_IPVS_IPVS_PROPERTY (1 << 0) /* all other options imply this one */
    >> >> +#define XT_IPVS_PROTO (1 << 1)
    >> >> +#define XT_IPVS_VADDR (1 << 2)
    >> >> +#define XT_IPVS_VPORT (1 << 3)
    >> >> +#define XT_IPVS_DIR (1 << 4)
    >> >> +#define XT_IPVS_METHOD (1 << 5)
    >> >> +#define XT_IPVS_VPORTCTL (1 << 6)
    >> >> +#define XT_IPVS_MASK ((1 << 7) - 1)
    >> >> +#define XT_IPVS_ONCE_MASK (XT_IPVS_MASK & ~XT_IPVS_IPVS_PROPERTY)
    >>
    >> Can't these just be an enum?
    >
    >More than one option can be used at once - they form a mini bitmap -
    >so no, I don't think we can use an enum.

    An enum does not dictate that you cannot combine values of it with itself.

    enum { A = 1 << 0, B = 1 << 0, };
    unsigned int flags = A | B;

    is perfectly fine, which is what other modules do.


    \
     
     \ /
      Last update: 2010-07-21 15:31    [W:0.028 / U:0.616 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site