2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

nicira-ext: Support matching IPv6 Neighbor Discovery messages.

IPv6 uses Neighbor Discovery messages in a similar manner to how IPv4
uses ARP.  This commit adds support for matching deeper into the
payloads of Neighbor Solicitation (NS) and Neighbor Advertisement (NA)
messages.  Currently, the matching fields include:

    - NS and NA Target (nd_target)
    - NS Source Link Layer Address (nd_sll)
    - NA Target Link Layer Address (nd_tll)

When defining IPv6 Neighbor Discovery rules, the Nicira Extensible Match
(NXM) extension to OVS must be used.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Justin Pettit
2011-02-01 22:54:11 -08:00
parent d31f1109f1
commit 685a51a5b8
18 changed files with 468 additions and 33 deletions

View File

@@ -540,7 +540,10 @@ parse_protocol(const char *name, const struct protocol **p_out)
FIELD(F_ARP_SHA, "arp_sha", FWW_ARP_SHA) \
FIELD(F_ARP_THA, "arp_tha", FWW_ARP_THA) \
FIELD(F_IPV6_SRC, "ipv6_src", 0) \
FIELD(F_IPV6_DST, "ipv6_dst", 0)
FIELD(F_IPV6_DST, "ipv6_dst", 0) \
FIELD(F_ND_TARGET, "nd_target", FWW_ND_TARGET) \
FIELD(F_ND_SLL, "nd_sll", FWW_ARP_SHA) \
FIELD(F_ND_TLL, "nd_tll", FWW_ARP_THA)
enum field_index {
#define FIELD(ENUM, NAME, WILDCARD) ENUM,
@@ -677,6 +680,21 @@ parse_field_value(struct cls_rule *rule, enum field_index index,
cls_rule_set_ipv6_dst_masked(rule, &ipv6, &ipv6_mask);
break;
case F_ND_TARGET:
str_to_ipv6(value, &ipv6, NULL);
cls_rule_set_nd_target(rule, ipv6);
break;
case F_ND_SLL:
str_to_mac(value, mac);
cls_rule_set_arp_sha(rule, mac);
break;
case F_ND_TLL:
str_to_mac(value, mac);
cls_rule_set_arp_tha(rule, mac);
break;
case N_FIELDS:
NOT_REACHED();
}