openflow: Rename OFP_VLAN_NONE as OFP10_VLAN_NONE
authorSimon Horman <horms@verge.net.au>
Thu, 5 Jul 2012 08:41:10 +0000 (17:41 +0900)
committerBen Pfaff <blp@nicira.com>
Thu, 5 Jul 2012 17:12:38 +0000 (10:12 -0700)
* 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 <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
include/openflow/openflow-1.0.h
lib/classifier.c
lib/flow.c
lib/ofp-util.c

index 039eb6b..d71b007 100644 (file)
@@ -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 {
index 0541b5c..6e8f4d2 100644 (file)
@@ -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);
index d90a738..9ad1898 100644 (file)
@@ -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);
index 834bb62..d9a77f1 100644 (file)
@@ -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;