nicira-ext: Name the enum used for flow formats, to clarify code.
authorBen Pfaff <blp@nicira.com>
Wed, 17 Nov 2010 18:06:37 +0000 (10:06 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 3 Dec 2010 18:30:11 +0000 (10:30 -0800)
include/openflow/nicira-ext.h
lib/ofp-util.c
lib/ofp-util.h
ofproto/ofproto.c

index 1a59d3b..8140edf 100644 (file)
@@ -892,7 +892,7 @@ OFP_ASSERT(sizeof(struct nx_action_note) == 16);
 /* ## Requests and replies. ## */
 /* ## --------------------- ## */
 
-enum {
+enum nx_flow_format {
     NXFF_OPENFLOW10 = 0,         /* Standard OpenFlow 1.0 compatible. */
     NXFF_TUN_ID_FROM_COOKIE = 1, /* OpenFlow 1.0, plus obtain tunnel ID from
                                   * cookie. */
index d58f7ea..99ef722 100644 (file)
@@ -103,7 +103,8 @@ enum {
  * wildcarded. */
 void
 ofputil_cls_rule_from_match(const struct ofp_match *match,
-                            unsigned int priority, int flow_format,
+                            unsigned int priority,
+                            enum nx_flow_format flow_format,
                             uint64_t cookie, struct cls_rule *rule)
 {
     struct flow_wildcards *wc = &rule->wc;
@@ -205,7 +206,8 @@ ofputil_cls_rule_from_match(const struct ofp_match *match,
  * the latter case only, 'match''s NXFW_TUN_ID bit will be filled in; otherwise
  * it is always set to 0. */
 void
-ofputil_cls_rule_to_match(const struct cls_rule *rule, int flow_format,
+ofputil_cls_rule_to_match(const struct cls_rule *rule,
+                          enum nx_flow_format flow_format,
                           struct ofp_match *match)
 {
     const struct flow_wildcards *wc = &rule->wc;
index fdca005..02096b0 100644 (file)
@@ -22,6 +22,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include "flow.h"
+#include "openflow/nicira-ext.h"
 #include "openvswitch/types.h"
 
 struct cls_rule;
@@ -38,9 +39,9 @@ int ofputil_netmask_to_wcbits(ovs_be32 netmask);
 
 /* Work with OpenFlow 1.0 ofp_match. */
 void ofputil_cls_rule_from_match(const struct ofp_match *,
-                                 unsigned int priority, int flow_format,
+                                 unsigned int priority, enum nx_flow_format,
                                  uint64_t cookie, struct cls_rule *);
-void ofputil_cls_rule_to_match(const struct cls_rule *, int flow_format,
+void ofputil_cls_rule_to_match(const struct cls_rule *, enum nx_flow_format,
                                struct ofp_match *);
 void normalize_match(struct ofp_match *);
 char *ofp_match_to_literal_string(const struct ofp_match *match);
index 2b2a306..1c27ef2 100644 (file)
@@ -255,7 +255,7 @@ struct ofconn {
     struct list node;           /* In struct ofproto's "all_conns" list. */
     struct rconn *rconn;        /* OpenFlow connection. */
     enum ofconn_type type;      /* Type. */
-    int flow_format;            /* One of NXFF_*. */
+    enum nx_flow_format flow_format; /* Currently selected flow format. */
 
     /* OFPT_PACKET_IN related data. */
     struct rconn_packet_counter *packet_in_counter; /* # queued on 'rconn'. */