From: Ben Pfaff Date: Mon, 8 Aug 2011 21:46:38 +0000 (-0700) Subject: ofp-util: Rename struct flow_mod to struct ofputil_flow_mod. X-Git-Tag: v1.3.0~461 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=a9a2da38941ea4d312559543a3fb813d8fe7fd4e ofp-util: Rename struct flow_mod to struct ofputil_flow_mod. Most of the structs in ofp-util.h have the ofputil_ prefix. Rename this one for consistency. --- diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index c171293c7..f0e715501 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -836,7 +836,8 @@ parse_reg_value(struct cls_rule *rule, int reg_idx, const char *value) * constant for 'command'. To parse syntax for an OFPST_FLOW or * OFPST_AGGREGATE (or NXST_FLOW or NXST_AGGREGATE), use -1 for 'command'. */ void -parse_ofp_str(struct flow_mod *fm, int command, const char *str_, bool verbose) +parse_ofp_str(struct ofputil_flow_mod *fm, int command, const char *str_, + bool verbose) { enum { F_OUT_PORT = 1 << 0, @@ -1007,7 +1008,7 @@ parse_ofp_flow_mod_str(struct list *packets, enum nx_flow_format *cur_format, struct cls_rule rule_copy; struct ofpbuf actions; struct ofpbuf *ofm; - struct flow_mod fm; + struct ofputil_flow_mod fm; ofpbuf_init(&actions, 64); parse_ofp_str(&fm, command, string, verbose); @@ -1064,7 +1065,7 @@ void parse_ofp_flow_stats_request_str(struct flow_stats_request *fsr, bool aggregate, char *string) { - struct flow_mod fm; + struct ofputil_flow_mod fm; parse_ofp_str(&fm, -1, string, false); fsr->aggregate = aggregate; diff --git a/lib/ofp-parse.h b/lib/ofp-parse.h index 8ad3c59df..5d928b5e4 100644 --- a/lib/ofp-parse.h +++ b/lib/ofp-parse.h @@ -24,12 +24,12 @@ #include #include "openflow/nicira-ext.h" -struct flow_mod; struct flow_stats_request; struct list; struct ofpbuf; +struct ofputil_flow_mod; -void parse_ofp_str(struct flow_mod *, int command, const char *str_, +void parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_, bool verbose); void parse_ofp_flow_mod_str(struct list *packets, diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 9311c14f4..349735a5e 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -781,7 +781,7 @@ static void ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, enum ofputil_msg_code code, int verbosity) { - struct flow_mod fm; + struct ofputil_flow_mod fm; bool need_priority; int error; diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 579be73f1..f87862f21 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -866,8 +866,8 @@ ofputil_make_flow_mod_table_id(bool flow_mod_table_id) * * Does not validate the flow_mod actions. */ int -ofputil_decode_flow_mod(struct flow_mod *fm, const struct ofp_header *oh, - bool flow_mod_table_id) +ofputil_decode_flow_mod(struct ofputil_flow_mod *fm, + const struct ofp_header *oh, bool flow_mod_table_id) { const struct ofputil_msg_type *type; uint16_t command; @@ -956,7 +956,7 @@ ofputil_decode_flow_mod(struct flow_mod *fm, const struct ofp_header *oh, * 'flow_mod_table_id' should be true if the NXT_FLOW_MOD_TABLE_ID extension is * enabled, false otherwise. */ struct ofpbuf * -ofputil_encode_flow_mod(const struct flow_mod *fm, +ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm, enum nx_flow_format flow_format, bool flow_mod_table_id) { diff --git a/lib/ofp-util.h b/lib/ofp-util.h index a9601aa14..b48dd0372 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -122,7 +122,7 @@ struct ofpbuf *ofputil_make_set_flow_format(enum nx_flow_format); struct ofpbuf *ofputil_make_flow_mod_table_id(bool flow_mod_table_id); /* Flow format independent flow_mod. */ -struct flow_mod { +struct ofputil_flow_mod { struct cls_rule cr; ovs_be64 cookie; uint8_t table_id; @@ -136,9 +136,9 @@ struct flow_mod { size_t n_actions; }; -int ofputil_decode_flow_mod(struct flow_mod *, const struct ofp_header *, - bool flow_mod_table_id); -struct ofpbuf *ofputil_encode_flow_mod(const struct flow_mod *, +int ofputil_decode_flow_mod(struct ofputil_flow_mod *, + const struct ofp_header *, bool flow_mod_table_id); +struct ofpbuf *ofputil_encode_flow_mod(const struct ofputil_flow_mod *, enum nx_flow_format, bool flow_mod_table_id); diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index c94549faf..cb349aed9 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -135,8 +135,8 @@ static void ofproto_rule_send_removed(struct rule *, uint8_t reason); static void ofopgroup_destroy(struct ofopgroup *); -static int add_flow(struct ofproto *, struct ofconn *, struct flow_mod *, - const struct ofp_header *); +static int add_flow(struct ofproto *, struct ofconn *, + struct ofputil_flow_mod *, const struct ofp_header *); /* This return value tells handle_openflow() that processing of the current * OpenFlow message must be postponed until some ongoing operations have @@ -1048,7 +1048,7 @@ ofproto_add_flow(struct ofproto *ofproto, const struct cls_rule *cls_rule, &ofproto->tables[0], cls_rule)); if (!rule || !ofputil_actions_equal(rule->actions, rule->n_actions, actions, n_actions)) { - struct flow_mod fm; + struct ofputil_flow_mod fm; memset(&fm, 0, sizeof fm); fm.cr = *cls_rule; @@ -2174,8 +2174,8 @@ is_flow_deletion_pending(const struct ofproto *ofproto, * 'ofconn' is used to retrieve the packet buffer specified in ofm->buffer_id, * if any. */ static int -add_flow(struct ofproto *ofproto, struct ofconn *ofconn, struct flow_mod *fm, - const struct ofp_header *request) +add_flow(struct ofproto *ofproto, struct ofconn *ofconn, + struct ofputil_flow_mod *fm, const struct ofp_header *request) { struct classifier *table; struct ofopgroup *group; @@ -2278,7 +2278,7 @@ add_flow(struct ofproto *ofproto, struct ofconn *ofconn, struct flow_mod *fm, * * Returns 0 on success, otherwise an OpenFlow error code. */ static int -modify_flows__(struct ofconn *ofconn, const struct flow_mod *fm, +modify_flows__(struct ofconn *ofconn, const struct ofputil_flow_mod *fm, const struct ofp_header *request, struct list *rules) { struct ofopgroup *group; @@ -2308,7 +2308,7 @@ modify_flows__(struct ofconn *ofconn, const struct flow_mod *fm, * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id, * if any. */ static int -modify_flows_loose(struct ofconn *ofconn, struct flow_mod *fm, +modify_flows_loose(struct ofconn *ofconn, struct ofputil_flow_mod *fm, const struct ofp_header *request) { struct ofproto *p = ofconn_get_ofproto(ofconn); @@ -2327,7 +2327,7 @@ modify_flows_loose(struct ofconn *ofconn, struct flow_mod *fm, * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id, * if any. */ static int -modify_flow_strict(struct ofconn *ofconn, struct flow_mod *fm, +modify_flow_strict(struct ofconn *ofconn, struct ofputil_flow_mod *fm, const struct ofp_header *request) { struct ofproto *p = ofconn_get_ofproto(ofconn); @@ -2370,7 +2370,7 @@ delete_flows__(struct ofconn *ofconn, const struct ofp_header *request, /* Implements OFPFC_DELETE. */ static int -delete_flows_loose(struct ofconn *ofconn, const struct flow_mod *fm, +delete_flows_loose(struct ofconn *ofconn, const struct ofputil_flow_mod *fm, const struct ofp_header *request) { struct ofproto *p = ofconn_get_ofproto(ofconn); @@ -2386,7 +2386,7 @@ delete_flows_loose(struct ofconn *ofconn, const struct flow_mod *fm, /* Implements OFPFC_DELETE_STRICT. */ static int -delete_flow_strict(struct ofconn *ofconn, struct flow_mod *fm, +delete_flow_strict(struct ofconn *ofconn, struct ofputil_flow_mod *fm, const struct ofp_header *request) { struct ofproto *p = ofconn_get_ofproto(ofconn); @@ -2448,7 +2448,7 @@ static int handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh) { struct ofproto *ofproto = ofconn_get_ofproto(ofconn); - struct flow_mod fm; + struct ofputil_flow_mod fm; int error; error = reject_slave_controller(ofconn, "flow_mod"); diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index d7c88b682..fded6df5f 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1041,8 +1041,8 @@ read_flows_from_file(const char *filename, struct classifier *cls, int index) min_flow_format = NXFF_OPENFLOW10; while (!ds_get_preprocessed_line(&s, file)) { struct fte_version *version; + struct ofputil_flow_mod fm; enum nx_flow_format min_ff; - struct flow_mod fm; parse_ofp_str(&fm, OFPFC_ADD, ds_cstr(&s), true); @@ -1152,7 +1152,7 @@ fte_make_flow_mod(const struct fte *fte, int index, uint16_t command, enum nx_flow_format flow_format, struct list *packets) { const struct fte_version *version = fte->versions[index]; - struct flow_mod fm; + struct ofputil_flow_mod fm; struct ofpbuf *ofm; fm.cr = fte->rule;