From: Simon Horman Date: Thu, 5 Jul 2012 08:41:10 +0000 (+0900) Subject: openflow: Rename OFP_VLAN_NONE as OFP10_VLAN_NONE X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c4365191170504d5bbdc8a3256bcee65ce1515a;p=openvswitch openflow: Rename OFP_VLAN_NONE as OFP10_VLAN_NONE * Remove duplicate definition of OFP_VLAN_NONE * Rename OFP_VLAN_NONE as OFP10_VLAN_NONE as it appears to be only used by OpenFlow 1.0. As suggested by Ben Pfaff. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h index 039eb6be..d71b007e 100644 --- a/include/openflow/openflow-1.0.h +++ b/include/openflow/openflow-1.0.h @@ -240,11 +240,6 @@ struct ofp10_action_output { }; OFP_ASSERT(sizeof(struct ofp10_action_output) == 8); -/* The VLAN id is 12 bits, so we can use the entire 16 bits to indicate - * special conditions. All ones is used to match that no VLAN id was - * set. */ -#define OFP_VLAN_NONE 0xffff - /* Action header for OFPAT10_VENDOR. The rest of the body is vendor-defined. */ struct ofp_action_vendor_header { ovs_be16 type; /* OFPAT10_VENDOR. */ @@ -369,7 +364,7 @@ enum ofp_flow_wildcards { /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate * special conditions. All ones indicates that no VLAN id was set. */ -#define OFP_VLAN_NONE 0xffff +#define OFP10_VLAN_NONE 0xffff /* Fields to match against flows */ struct ofp10_match { diff --git a/lib/classifier.c b/lib/classifier.c index 0541b5c0..6e8f4d2b 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -247,7 +247,7 @@ void cls_rule_set_dl_vlan(struct cls_rule *rule, ovs_be16 dl_vlan) { flow_set_vlan_vid(&rule->flow, dl_vlan); - if (dl_vlan == htons(OFP_VLAN_NONE)) { + if (dl_vlan == htons(OFP10_VLAN_NONE)) { rule->wc.vlan_tci_mask = htons(UINT16_MAX); } else { rule->wc.vlan_tci_mask |= htons(VLAN_VID_MASK | VLAN_CFI); diff --git a/lib/flow.c b/lib/flow.c index d90a7380..9ad1898f 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -947,7 +947,7 @@ flow_hash_fields_valid(enum nx_hash_fields fields) void flow_set_vlan_vid(struct flow *flow, ovs_be16 vid) { - if (vid == htons(OFP_VLAN_NONE)) { + if (vid == htons(OFP10_VLAN_NONE)) { flow->vlan_tci = htons(0); } else { vid &= htons(VLAN_VID_MASK); diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 834bb622..d9a77f1e 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -171,7 +171,8 @@ ofputil_cls_rule_from_ofp10_match(const struct ofp10_match *match, rule->flow.nw_proto = match->nw_proto; /* Translate VLANs. */ - if (!(ofpfw & OFPFW10_DL_VLAN) && match->dl_vlan == htons(OFP_VLAN_NONE)) { + if (!(ofpfw & OFPFW10_DL_VLAN) && + match->dl_vlan == htons(OFP10_VLAN_NONE)) { /* Match only packets without 802.1Q header. * * When OFPFW10_DL_VLAN_PCP is wildcarded, this is obviously correct. @@ -232,7 +233,7 @@ ofputil_cls_rule_to_ofp10_match(const struct cls_rule *rule, ofpfw |= OFPFW10_DL_VLAN | OFPFW10_DL_VLAN_PCP; } else if (rule->wc.vlan_tci_mask & htons(VLAN_CFI) && !(rule->flow.vlan_tci & htons(VLAN_CFI))) { - match->dl_vlan = htons(OFP_VLAN_NONE); + match->dl_vlan = htons(OFP10_VLAN_NONE); } else { if (!(rule->wc.vlan_tci_mask & htons(VLAN_VID_MASK))) { ofpfw |= OFPFW10_DL_VLAN;