[ovs-dev] [PATCH 32/63] ofp-util: Allow decoding of Open Flow 1.2 Features Reply Messages
Simon Horman
horms at verge.net.au
Wed Jun 27 08:20:08 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>
---
v5
* No change
v4
* No change
v3
* Manual rebase
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 fc74ee2..7516196 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -832,6 +832,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(OFPT_FLOW_REMOVED, OFPT_FLOW_REMOVED,
sizeof(struct ofp12_flow_removed), 0),
OFPT12(OFPT11_FLOW_MOD, OFPT11_FLOW_MOD,
@@ -3007,7 +3009,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