Thanks Murphy.

That was extremely helpful.

Theo
On 01/09/2012 04:09 PM, Murphy McCauley wrote:
I am assuming that by 10.10.23.40/2, you don't intend the CIDR meaning, and in 
fact mean that you want two bits to be wildcarded.

Try this:
wildcard = (wildcard&  ~OFPFW_NW_DST_MASK) | (wild_bits<<  OFPFW_NW_DST_SHIFT);

.. where wild_bits is between 0 and 32 inclusive (in your case, it should be 2).

Hope that helps.

-- Murphy

On Jan 9, 2012, at 10:24 AM, Theophlius Benson wrote:

Good Morning,

I am trying to install rules into switches to match ip prefixes. For example 
10.10.23.40/2.  However, the rules i install endup looking like this: 
0.0.0.0/2.  I'm sure that I'm installing these rules incorrectly.  Here is a 
fragment of the code that sets the matching criteria.

         wildcard = (~OFPFW_NW_DST_ALL&  (OFPFW_NW_DST_MASK<<  dstmask)) | 
wildcard;
        ofm->match.wildcards = htonl(wildcard);
        ofm->match.nw_dst=htonl(dstip);

I Can include more fragments of the code if you will find it helpful.
Theo
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to