From ba0bc9b06fb33b8c7b3d40efdde239020691cb98 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 27 Jun 2013 11:04:50 -0700 Subject: [PATCH] ofp-actions: Give ovs_instruction funcs names that start with that prefix. This seems slightly clearer, because ofpact_instruction_* makes me look for a type named ofpact_instruction. Signed-off-by: Ben Pfaff --- lib/ofp-actions.c | 16 ++++++++-------- lib/ofp-actions.h | 4 ++-- lib/ofp-parse.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 34a700b88..b934be1c1 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -914,13 +914,13 @@ OVS_INSTRUCTIONS }; const char * -ofpact_instruction_name_from_type(enum ovs_instruction_type type) +ovs_instruction_name_from_type(enum ovs_instruction_type type) { return inst_info[type].name; } int -ofpact_instruction_type_from_name(const char *name) +ovs_instruction_type_from_name(const char *name) { const struct instruction_type_info *p; for (p = inst_info; p < &inst_info[ARRAY_SIZE(inst_info)]; p++) { @@ -1294,8 +1294,8 @@ ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len) } if (inst != OVSINST_OFPIT11_APPLY_ACTIONS && next <= inst) { - const char *name = ofpact_instruction_name_from_type(inst); - const char *next_name = ofpact_instruction_name_from_type(next); + const char *name = ovs_instruction_name_from_type(inst); + const char *next_name = ovs_instruction_name_from_type(next); if (next == inst) { VLOG_WARN("duplicate %s instruction not allowed, for OpenFlow " @@ -2292,14 +2292,14 @@ ofpact_format(const struct ofpact *a, struct ds *s) case OFPACT_CLEAR_ACTIONS: ds_put_format(s, "%s", - ofpact_instruction_name_from_type( + ovs_instruction_name_from_type( OVSINST_OFPIT11_CLEAR_ACTIONS)); break; case OFPACT_WRITE_METADATA: metadata = ofpact_get_WRITE_METADATA(a); ds_put_format(s, "%s:%#"PRIx64, - ofpact_instruction_name_from_type( + ovs_instruction_name_from_type( OVSINST_OFPIT11_WRITE_METADATA), ntohll(metadata->metadata)); if (metadata->mask != htonll(UINT64_MAX)) { @@ -2309,14 +2309,14 @@ ofpact_format(const struct ofpact *a, struct ds *s) case OFPACT_GOTO_TABLE: ds_put_format(s, "%s:%"PRIu8, - ofpact_instruction_name_from_type( + ovs_instruction_name_from_type( OVSINST_OFPIT11_GOTO_TABLE), ofpact_get_GOTO_TABLE(a)->table_id); break; case OFPACT_METER: ds_put_format(s, "%s:%"PRIu32, - ofpact_instruction_name_from_type(OVSINST_OFPIT13_METER), + ovs_instruction_name_from_type(OVSINST_OFPIT13_METER), ofpact_get_METER(a)->meter_id); break; } diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 799f64c8d..8dd2a218f 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -657,8 +657,8 @@ ofpact_is_instruction(const struct ofpact *a) || a->type == OFPACT_GOTO_TABLE; } -const char *ofpact_instruction_name_from_type(enum ovs_instruction_type type); -int ofpact_instruction_type_from_name(const char *name); +const char *ovs_instruction_name_from_type(enum ovs_instruction_type type); +int ovs_instruction_type_from_name(const char *name); void ofpact_set_field_init(struct ofpact_reg_load *load, const struct mf_field *mf, const void *src); diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index da36f8859..2c1fb5d68 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -743,7 +743,7 @@ str_to_inst_ofpacts(char *str, struct ofpbuf *ofpacts) pos = str; while (ofputil_parse_key_value(&pos, &inst, &arg)) { - type = ofpact_instruction_type_from_name(inst); + type = ovs_instruction_type_from_name(inst); if (type < 0) { if (!str_to_ofpact__(pos, inst, arg, ofpacts, n_actions)) { break; -- 2.43.0