2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-02 23:35:27 +00:00

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.
This commit is contained in:
Ben Pfaff
2011-08-08 14:46:38 -07:00
parent be86ea7aa9
commit a9a2da3894
7 changed files with 27 additions and 26 deletions

View File

@@ -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 * constant for 'command'. To parse syntax for an OFPST_FLOW or
* OFPST_AGGREGATE (or NXST_FLOW or NXST_AGGREGATE), use -1 for 'command'. */ * OFPST_AGGREGATE (or NXST_FLOW or NXST_AGGREGATE), use -1 for 'command'. */
void 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 { enum {
F_OUT_PORT = 1 << 0, 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 cls_rule rule_copy;
struct ofpbuf actions; struct ofpbuf actions;
struct ofpbuf *ofm; struct ofpbuf *ofm;
struct flow_mod fm; struct ofputil_flow_mod fm;
ofpbuf_init(&actions, 64); ofpbuf_init(&actions, 64);
parse_ofp_str(&fm, command, string, verbose); parse_ofp_str(&fm, command, string, verbose);
@@ -1064,7 +1065,7 @@ void
parse_ofp_flow_stats_request_str(struct flow_stats_request *fsr, parse_ofp_flow_stats_request_str(struct flow_stats_request *fsr,
bool aggregate, char *string) bool aggregate, char *string)
{ {
struct flow_mod fm; struct ofputil_flow_mod fm;
parse_ofp_str(&fm, -1, string, false); parse_ofp_str(&fm, -1, string, false);
fsr->aggregate = aggregate; fsr->aggregate = aggregate;

View File

@@ -24,12 +24,12 @@
#include <stdio.h> #include <stdio.h>
#include "openflow/nicira-ext.h" #include "openflow/nicira-ext.h"
struct flow_mod;
struct flow_stats_request; struct flow_stats_request;
struct list; struct list;
struct ofpbuf; 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); bool verbose);
void parse_ofp_flow_mod_str(struct list *packets, void parse_ofp_flow_mod_str(struct list *packets,

View File

@@ -781,7 +781,7 @@ static void
ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh,
enum ofputil_msg_code code, int verbosity) enum ofputil_msg_code code, int verbosity)
{ {
struct flow_mod fm; struct ofputil_flow_mod fm;
bool need_priority; bool need_priority;
int error; int error;

View File

@@ -866,8 +866,8 @@ ofputil_make_flow_mod_table_id(bool flow_mod_table_id)
* *
* Does not validate the flow_mod actions. */ * Does not validate the flow_mod actions. */
int int
ofputil_decode_flow_mod(struct flow_mod *fm, const struct ofp_header *oh, ofputil_decode_flow_mod(struct ofputil_flow_mod *fm,
bool flow_mod_table_id) const struct ofp_header *oh, bool flow_mod_table_id)
{ {
const struct ofputil_msg_type *type; const struct ofputil_msg_type *type;
uint16_t command; 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 * 'flow_mod_table_id' should be true if the NXT_FLOW_MOD_TABLE_ID extension is
* enabled, false otherwise. */ * enabled, false otherwise. */
struct ofpbuf * 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, enum nx_flow_format flow_format,
bool flow_mod_table_id) bool flow_mod_table_id)
{ {

View File

@@ -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); struct ofpbuf *ofputil_make_flow_mod_table_id(bool flow_mod_table_id);
/* Flow format independent flow_mod. */ /* Flow format independent flow_mod. */
struct flow_mod { struct ofputil_flow_mod {
struct cls_rule cr; struct cls_rule cr;
ovs_be64 cookie; ovs_be64 cookie;
uint8_t table_id; uint8_t table_id;
@@ -136,9 +136,9 @@ struct flow_mod {
size_t n_actions; size_t n_actions;
}; };
int ofputil_decode_flow_mod(struct flow_mod *, const struct ofp_header *, int ofputil_decode_flow_mod(struct ofputil_flow_mod *,
bool flow_mod_table_id); const struct ofp_header *, bool flow_mod_table_id);
struct ofpbuf *ofputil_encode_flow_mod(const struct flow_mod *, struct ofpbuf *ofputil_encode_flow_mod(const struct ofputil_flow_mod *,
enum nx_flow_format, enum nx_flow_format,
bool flow_mod_table_id); bool flow_mod_table_id);

View File

@@ -135,8 +135,8 @@ static void ofproto_rule_send_removed(struct rule *, uint8_t reason);
static void ofopgroup_destroy(struct ofopgroup *); static void ofopgroup_destroy(struct ofopgroup *);
static int add_flow(struct ofproto *, struct ofconn *, struct flow_mod *, static int add_flow(struct ofproto *, struct ofconn *,
const struct ofp_header *); struct ofputil_flow_mod *, const struct ofp_header *);
/* This return value tells handle_openflow() that processing of the current /* This return value tells handle_openflow() that processing of the current
* OpenFlow message must be postponed until some ongoing operations have * 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)); &ofproto->tables[0], cls_rule));
if (!rule || !ofputil_actions_equal(rule->actions, rule->n_actions, if (!rule || !ofputil_actions_equal(rule->actions, rule->n_actions,
actions, n_actions)) { actions, n_actions)) {
struct flow_mod fm; struct ofputil_flow_mod fm;
memset(&fm, 0, sizeof fm); memset(&fm, 0, sizeof fm);
fm.cr = *cls_rule; 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, * 'ofconn' is used to retrieve the packet buffer specified in ofm->buffer_id,
* if any. */ * if any. */
static int static int
add_flow(struct ofproto *ofproto, struct ofconn *ofconn, struct flow_mod *fm, add_flow(struct ofproto *ofproto, struct ofconn *ofconn,
const struct ofp_header *request) struct ofputil_flow_mod *fm, const struct ofp_header *request)
{ {
struct classifier *table; struct classifier *table;
struct ofopgroup *group; 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. */ * Returns 0 on success, otherwise an OpenFlow error code. */
static int 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) const struct ofp_header *request, struct list *rules)
{ {
struct ofopgroup *group; 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, * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id,
* if any. */ * if any. */
static int 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) const struct ofp_header *request)
{ {
struct ofproto *p = ofconn_get_ofproto(ofconn); 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, * 'ofconn' is used to retrieve the packet buffer specified in fm->buffer_id,
* if any. */ * if any. */
static int 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) const struct ofp_header *request)
{ {
struct ofproto *p = ofconn_get_ofproto(ofconn); struct ofproto *p = ofconn_get_ofproto(ofconn);
@@ -2370,7 +2370,7 @@ delete_flows__(struct ofconn *ofconn, const struct ofp_header *request,
/* Implements OFPFC_DELETE. */ /* Implements OFPFC_DELETE. */
static int 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) const struct ofp_header *request)
{ {
struct ofproto *p = ofconn_get_ofproto(ofconn); 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. */ /* Implements OFPFC_DELETE_STRICT. */
static int 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) const struct ofp_header *request)
{ {
struct ofproto *p = ofconn_get_ofproto(ofconn); struct ofproto *p = ofconn_get_ofproto(ofconn);
@@ -2448,7 +2448,7 @@ static int
handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh) handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh)
{ {
struct ofproto *ofproto = ofconn_get_ofproto(ofconn); struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
struct flow_mod fm; struct ofputil_flow_mod fm;
int error; int error;
error = reject_slave_controller(ofconn, "flow_mod"); error = reject_slave_controller(ofconn, "flow_mod");

View File

@@ -1041,8 +1041,8 @@ read_flows_from_file(const char *filename, struct classifier *cls, int index)
min_flow_format = NXFF_OPENFLOW10; min_flow_format = NXFF_OPENFLOW10;
while (!ds_get_preprocessed_line(&s, file)) { while (!ds_get_preprocessed_line(&s, file)) {
struct fte_version *version; struct fte_version *version;
struct ofputil_flow_mod fm;
enum nx_flow_format min_ff; enum nx_flow_format min_ff;
struct flow_mod fm;
parse_ofp_str(&fm, OFPFC_ADD, ds_cstr(&s), true); 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) enum nx_flow_format flow_format, struct list *packets)
{ {
const struct fte_version *version = fte->versions[index]; const struct fte_version *version = fte->versions[index];
struct flow_mod fm; struct ofputil_flow_mod fm;
struct ofpbuf *ofm; struct ofpbuf *ofm;
fm.cr = fte->rule; fm.cr = fte->rule;