[ovs-dev] [ovs-discuss] [ACLv2 16/19] flow: Add flow_equal_wildcarded function.
Jesse Gross
jesse at nicira.com
Fri Sep 4 23:57:40 UTC 2009
Ben Pfaff wrote:
> Jesse Gross <jesse at nicira.com> writes:
>
>
>> +bool
>> +flow_equal_wildcarded(flow_t *a, flow_t *b, uint32_t wildcards)
>> +{
>> + uint32_t srcip_mask;
>> + uint32_t dstip_mask;
>> +
>> + srcip_mask = flow_nw_bits_to_mask(wildcards, OFPFW_NW_SRC_SHIFT);
>> + dstip_mask = flow_nw_bits_to_mask(wildcards, OFPFW_NW_DST_SHIFT);
>> +
>> + if (a->in_port != b->in_port && !(wildcards & OFPFW_IN_PORT)) {
>> + return false;
>> + } else if (a->dl_vlan != b->dl_vlan && !(wildcards & OFPFW_DL_VLAN)) {
>> + return false;
>> + } else if (memcmp(a->dl_src, b->dl_src, ETH_ADDR_LEN) != 0 &&
>> + !(wildcards & OFPFW_DL_SRC)) {
>>
>
> eth_addr_equals() from packets.h would shorten this test and the
> next one.
>
>
Thanks, I didn't notice that function before.
More information about the dev
mailing list