[ovs-dev] [PATCH 18/25] ofp-util: Allow decoding of Open Flow 1.2 Features Reply Messages

Simon Horman horms at verge.net.au
Thu Jun 14 10:43:30 UTC 2012


Open Flow 1.2, like Open Flow 1.1, has OFPC11_GROUP_STATS.

All other Open Flow 1.2 capabilities are handled by
ofputil_capabilities_mask() which is used by both
ofputil_decode_switch_features() and ofputil_encode_switch_features().

No update to ofputil_encode_switch_features() is required
to support Open Flow 1.2 due to its protocol version logic
which is looser than that of ofputil_decode_switch_features().

Signed-off-by: Simon Horman <horms at verge.net.au>

---

v2
* No change
---
 lib/ofp-util.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 03816d7..0d9c18c 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -818,6 +818,8 @@ static const struct ofputil_msg_type ofputil_msg_types[] = {
         MIN_SIZE,                               \
         EXTRA_MULTIPLE                          \
     }
+    OFPT12(OFPT_FEATURES_REPLY, OFPT_FEATURES_REPLY,
+           sizeof(struct ofp_switch_features), sizeof(struct ofp11_port)),
     OFPT12(OFPT11_FLOW_MOD,     OFPT11_FLOW_MOD,
            sizeof(struct ofp11_flow_mod), 1),
     OFPT12(OFPT_PORT_MOD,       OFPT11_PORT_MOD,
@@ -2955,7 +2957,8 @@ ofputil_decode_switch_features(const struct ofp_switch_features *osf,
             features->capabilities |= OFPUTIL_C_STP;
         }
         features->actions = decode_action_bits(osf->actions, of10_action_bits);
-    } else if (osf->header.version == OFP11_VERSION) {
+    } else if (osf->header.version == OFP11_VERSION ||
+               osf->header.version == OFP12_VERSION) {
         if (osf->capabilities & htonl(OFPC11_GROUP_STATS)) {
             features->capabilities |= OFPUTIL_C_GROUP_STATS;
         }
-- 
1.7.10.2.484.gcd07cc5




More information about the dev mailing list