netdev: do not allow devices to be opened with conflicting types
[cascardo/ovs.git] / lib / ofp-msgs.c
index 0cfea4f..f9660fc 100644 (file)
  */
 
 #include <config.h>
-#include "ofp-msgs.h"
 #include "byte-order.h"
-#include "openvswitch/dynamic-string.h"
 #include "hash.h"
-#include "hmap.h"
-#include "openvswitch/ofpbuf.h"
+#include "openvswitch/hmap.h"
 #include "openflow/nicira-ext.h"
 #include "openflow/openflow.h"
-#include "ovs-thread.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
+#include "ovs-thread.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(ofp_msgs);
 
@@ -327,6 +328,7 @@ ofp_is_stat_request(enum ofp_version version, uint8_t type)
     case OFP13_VERSION:
     case OFP14_VERSION:
     case OFP15_VERSION:
+    case OFP16_VERSION:
         return type == OFPT11_STATS_REQUEST;
     }
 
@@ -344,6 +346,7 @@ ofp_is_stat_reply(enum ofp_version version, uint8_t type)
     case OFP13_VERSION:
     case OFP14_VERSION:
     case OFP15_VERSION:
+    case OFP16_VERSION:
         return type == OFPT11_STATS_REPLY;
     }
 
@@ -385,6 +388,7 @@ ofphdrs_len(const struct ofphdrs *hdrs)
     case OFP13_VERSION:
     case OFP14_VERSION:
     case OFP15_VERSION:
+    case OFP16_VERSION:
         if (hdrs->type == OFPT11_STATS_REQUEST ||
             hdrs->type == OFPT11_STATS_REPLY) {
             return (hdrs->stat == OFPST_VENDOR
@@ -810,6 +814,7 @@ ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version)
     case OFP13_VERSION:
     case OFP14_VERSION:
     case OFP15_VERSION:
+    case OFP16_VERSION:
         ovs_assert(hdrs.type == OFPT11_STATS_REQUEST);
         hdrs.type = OFPT11_STATS_REPLY;
         break;
@@ -1030,6 +1035,7 @@ ofpmp_flags__(const struct ofp_header *oh)
     case OFP13_VERSION:
     case OFP14_VERSION:
     case OFP15_VERSION:
+    case OFP16_VERSION:
         return &((struct ofp11_stats_msg *) oh)->flags;
     default:
         OVS_NOT_REACHED();