diff options
author | Justin Pettit <jpettit@nicira.com> | 2010-12-07 14:02:17 -0800 |
---|---|---|
committer | Justin Pettit <jpettit@nicira.com> | 2011-02-02 12:42:40 -0800 |
commit | bad68a9965215511b305c59d7f1830344ec2241f (patch) | |
tree | 2d21fbf5a0591cfec65932177ba7d6eb3cc9f03a /lib/ofp-parse.c | |
parent | 6767a2cce9a6412b3a41a927c4d56b9f0e1ec36f (diff) |
nicira-ext: Support matching ARP source and target hardware addresses.
OpenFlow 1.0 doesn't allow matching on the ARP source and target
hardware address. This has caused us to introduce hacks such as the
Drop Spoofed ARP action. Now that we have extensible match, we can
match on more fields within ARP:
- Source Hardware Address (arp_sha)
- Target Hardware Address (arp_tha)
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ofp-parse.c')
-rw-r--r-- | lib/ofp-parse.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 65d7a654..366664e3 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -491,7 +491,9 @@ parse_protocol(const char *name, const struct protocol **p_out) FIELD(F_TP_SRC, "tp_src", FWW_TP_SRC) \ FIELD(F_TP_DST, "tp_dst", FWW_TP_DST) \ FIELD(F_ICMP_TYPE, "icmp_type", FWW_TP_SRC) \ - FIELD(F_ICMP_CODE, "icmp_code", FWW_TP_DST) + FIELD(F_ICMP_CODE, "icmp_code", FWW_TP_DST) \ + FIELD(F_ARP_SHA, "arp_sha", FWW_ARP_SHA) \ + FIELD(F_ARP_THA, "arp_tha", FWW_ARP_THA) enum field_index { #define FIELD(ENUM, NAME, WILDCARD) ENUM, @@ -607,6 +609,16 @@ parse_field_value(struct cls_rule *rule, enum field_index index, cls_rule_set_icmp_code(rule, str_to_u32(value)); break; + case F_ARP_SHA: + str_to_mac(value, mac); + cls_rule_set_arp_sha(rule, mac); + break; + + case F_ARP_THA: + str_to_mac(value, mac); + cls_rule_set_arp_tha(rule, mac); + break; + case N_FIELDS: NOT_REACHED(); } |