[ovs-dev] [PATCH v2 35/47] ofp-msg: Support encoding of ONF extensions for OF1.3
Simon Horman
horms at verge.net.au
Tue Jun 10 10:27:39 UTC 2014
This is in preparation for supporting EXT-187: flow entry notification
extension (ONF flow monitor).
Signed-off-by: Simon Horman <horms at verge.net.au>
---
v2
* First post
---
lib/ofp-msgs.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
index 99c7e01..27ac1b2 100644
--- a/lib/ofp-msgs.c
+++ b/lib/ofp-msgs.c
@@ -677,11 +677,19 @@ ofpraw_put__(enum ofpraw raw, uint8_t version, ovs_be32 xid,
oh->xid = xid;
if (hdrs->type == OFPT_VENDOR) {
- struct nicira_header *nh = buf->frame;
+ if (version >= OFP13_VERSION && hdrs->vendor == ONF_VENDOR_ID) {
+ struct onf13_experimenter_header *onfeh = buf->frame;
- ovs_assert(hdrs->vendor == NX_VENDOR_ID);
- nh->vendor = htonl(hdrs->vendor);
- nh->subtype = htonl(hdrs->subtype);
+ onfeh->vendor = htonl(hdrs->vendor);
+ onfeh->subtype = htonl(hdrs->subtype);
+ } else if (hdrs->vendor == NX_VENDOR_ID) {
+ struct nicira_header *nh = buf->frame;
+
+ nh->vendor = htonl(hdrs->vendor);
+ nh->subtype = htonl(hdrs->subtype);
+ } else {
+ OVS_NOT_REACHED();
+ }
} else if (version == OFP10_VERSION
&& (hdrs->type == OFPT10_STATS_REQUEST ||
hdrs->type == OFPT10_STATS_REPLY)) {
@@ -716,7 +724,11 @@ ofpraw_put__(enum ofpraw raw, uint8_t version, ovs_be32 xid,
struct ofp11_vendor_stats_msg *ovsm = buf->frame;
ovsm->vendor = htonl(hdrs->vendor);
- if (hdrs->vendor == NX_VENDOR_ID) {
+ if (version >= OFP13_VERSION && hdrs->vendor == ONF_VENDOR_ID) {
+ struct onf13_experimenter_multipart_msg *onfemm = buf->frame;
+
+ onfemm->mp_type = htonl(hdrs->subtype);
+ } else if (hdrs->vendor == NX_VENDOR_ID) {
struct nicira11_stats_msg *nsm = buf->frame;
nsm->subtype = htonl(hdrs->subtype);
--
2.0.0.rc2
More information about the dev
mailing list