2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

packets: Adds ethernet-matching helper functions

With OpenFlow 1.1 requiring arbitrary ethernet match support, it simplifies
other code if we have some extra helper functions. This patch adds
eth_mask_is_exact(mask), eth_addr_bitand(src, mask, dst),
eth_addr_equal_except(a, b, mask) and eth_format_masked(eth, mask, output).

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Joe Stringer
2012-05-29 11:07:16 -07:00
committed by Ben Pfaff
parent 518852130b
commit 3b4d8ad307
4 changed files with 46 additions and 4 deletions

View File

@@ -2273,10 +2273,7 @@ mf_format(const struct mf_field *mf,
break;
case MFS_ETHERNET:
ds_put_format(s, ETH_ADDR_FMT, ETH_ADDR_ARGS(value->mac));
if (mask) {
ds_put_format(s, "/"ETH_ADDR_FMT, ETH_ADDR_ARGS(mask->mac));
}
eth_format_masked(value->mac, mask->mac, s);
break;
case MFS_IPV4: