From 492f75720ea291dc418602aac49cf4cd5695f3ce Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 17 Nov 2010 10:06:37 -0800 Subject: [PATCH] nicira-ext: Name the enum used for flow formats, to clarify code. --- include/openflow/nicira-ext.h | 2 +- lib/ofp-util.c | 6 ++++-- lib/ofp-util.h | 5 +++-- ofproto/ofproto.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 1a59d3b03..8140edfc4 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -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. */ diff --git a/lib/ofp-util.c b/lib/ofp-util.c index d58f7ea5c..99ef72233 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -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; diff --git a/lib/ofp-util.h b/lib/ofp-util.h index fdca005fb..02096b0ba 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -22,6 +22,7 @@ #include #include #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); diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 2b2a306a0..1c27ef247 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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'. */ -- 2.43.0