summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2015-12-22 12:39:55 -0800
committerBen Pfaff <blp@ovn.org>2016-01-04 16:08:10 -0800
commit34abaa3deaa430ca0b50453865d2e042a5132165 (patch)
tree037588fc35aa61108273bea44a0d82487224bd09 /lib
parent2bd318dec2428ae6c0febbf79453982676ccb672 (diff)
downloadopenvswitch-34abaa3deaa430ca0b50453865d2e042a5132165.tar.gz
ofp-actions: Rename ofpact_update_len() to ofpact_finish().
It does more than just update the length now, so this is a more accurate name. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bundle.c2
-rw-r--r--lib/learn.c2
-rw-r--r--lib/ofp-actions.c22
-rw-r--r--lib/ofp-actions.h9
4 files changed, 17 insertions, 18 deletions
diff --git a/lib/bundle.c b/lib/bundle.c
index baf6bbf97..871a724e8 100644
--- a/lib/bundle.c
+++ b/lib/bundle.c
@@ -178,7 +178,7 @@ bundle_parse__(const char *s, char **save_ptr,
bundle = ofpacts->header;
bundle->n_slaves++;
}
- ofpact_update_len(ofpacts, &bundle->ofpact);
+ ofpact_finish(ofpacts, &bundle->ofpact);
bundle->basis = atoi(basis);
diff --git a/lib/learn.c b/lib/learn.c
index 50627cae9..66201d501 100644
--- a/lib/learn.c
+++ b/lib/learn.c
@@ -379,7 +379,7 @@ learn_parse__(char *orig, char *arg, struct ofpbuf *ofpacts)
}
}
}
- ofpact_update_len(ofpacts, &learn->ofpact);
+ ofpact_finish(ofpacts, &learn->ofpact);
return NULL;
}
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 921295adb..becf02d62 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -1093,7 +1093,7 @@ decode_bundle(bool load, const struct nx_action_bundle *nab,
}
bundle = ofpacts->header;
- ofpact_update_len(ofpacts, &bundle->ofpact);
+ ofpact_finish(ofpacts, &bundle->ofpact);
if (!error) {
error = bundle_check(bundle, OFPP_MAX, NULL);
@@ -2933,7 +2933,7 @@ decode_OFPAT_RAW_DEC_NW_TTL(struct ofpbuf *out)
ids->n_controllers = 1;
ofpbuf_put(out, &id, sizeof id);
ids = out->header;
- ofpact_update_len(out, &ids->ofpact);
+ ofpact_finish(out, &ids->ofpact);
return error;
}
@@ -2970,7 +2970,7 @@ decode_NXAST_RAW_DEC_TTL_CNT_IDS(const struct nx_action_cnt_ids *nac_ids,
ids = out->header;
}
- ofpact_update_len(out, &ids->ofpact);
+ ofpact_finish(out, &ids->ofpact);
return 0;
}
@@ -3009,7 +3009,7 @@ parse_noargs_dec_ttl(struct ofpbuf *ofpacts)
ofpbuf_put(ofpacts, &id, sizeof id);
ids = ofpacts->header;
ids->n_controllers++;
- ofpact_update_len(ofpacts, &ids->ofpact);
+ ofpact_finish(ofpacts, &ids->ofpact);
}
static char * OVS_WARN_UNUSED_RESULT
@@ -3036,7 +3036,7 @@ parse_DEC_TTL(char *arg, struct ofpbuf *ofpacts,
return xstrdup("dec_ttl_cnt_ids: expected at least one controller "
"id.");
}
- ofpact_update_len(ofpacts, &ids->ofpact);
+ ofpact_finish(ofpacts, &ids->ofpact);
}
return NULL;
}
@@ -4054,7 +4054,7 @@ decode_NXAST_RAW_LEARN(const struct nx_action_learn *nal,
get_subfield(spec->n_bits, &p, &spec->dst);
}
}
- ofpact_update_len(ofpacts, &learn->ofpact);
+ ofpact_finish(ofpacts, &learn->ofpact);
if (!is_all_zeros(p, (char *) end - (char *) p)) {
return OFPERR_OFPBAC_BAD_ARGUMENT;
@@ -4378,7 +4378,7 @@ decode_NXAST_RAW_NOTE(const struct nx_action_note *nan,
note = ofpact_put_NOTE(out);
note->length = length;
ofpbuf_put(out, nan->note, length);
- ofpact_update_len(out, out->header);
+ ofpact_finish(out, out->header);
return 0;
}
@@ -4426,7 +4426,7 @@ parse_NOTE(const char *arg, struct ofpbuf *ofpacts,
arg += 2;
}
- ofpact_update_len(ofpacts, &note->ofpact);
+ ofpact_finish(ofpacts, &note->ofpact);
return NULL;
}
@@ -4833,7 +4833,7 @@ decode_NXAST_RAW_CT(const struct nx_action_conntrack *nac,
conntrack = ofpbuf_push_uninit(out, sizeof(*conntrack));
out->header = &conntrack->ofpact;
- ofpact_update_len(out, &conntrack->ofpact);
+ ofpact_finish(out, &conntrack->ofpact);
if (conntrack->ofpact.len > sizeof(*conntrack)
&& !(conntrack->flags & NX_CT_F_COMMIT)) {
@@ -4954,7 +4954,7 @@ parse_CT(char *arg, struct ofpbuf *ofpacts,
}
}
- ofpact_update_len(ofpacts, &oc->ofpact);
+ ofpact_finish(ofpacts, &oc->ofpact);
ofpbuf_push_uninit(ofpacts, ct_offset);
return error;
}
@@ -7282,7 +7282,7 @@ ofpact_init(struct ofpact *ofpact, enum ofpact_type type, size_t len)
* bytes and updating its embedded length field. See the large comment near
* the end of ofp-actions.h for more information. */
void
-ofpact_update_len(struct ofpbuf *ofpacts, struct ofpact *ofpact)
+ofpact_finish(struct ofpbuf *ofpacts, struct ofpact *ofpact)
{
ovs_assert(ofpact == ofpacts->header);
ofpact->len = (char *) ofpbuf_tail(ofpacts) - (char *) ofpact;
diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h
index 0bd33e379..5dec177fb 100644
--- a/lib/ofp-actions.h
+++ b/lib/ofp-actions.h
@@ -902,10 +902,9 @@ void *ofpact_put(struct ofpbuf *, enum ofpact_type, size_t len);
*
* After using this function to add a variable-length action, add the
* elements of the flexible array (e.g. with ofpbuf_put()), then use
- * ofpact_update_len() to pad the action to a multiple of OFPACT_ALIGNTO
- * bytes and update its embedded length field. (Keep in mind the need to
- * refresh the structure from 'ofpacts->header' after adding data to
- * 'ofpacts'.)
+ * ofpact_finish() to pad the action to a multiple of OFPACT_ALIGNTO bytes
+ * and update its embedded length field. (Keep in mind the need to refresh
+ * the structure from 'ofpacts->header' after adding data to 'ofpacts'.)
*
* struct <STRUCT> *ofpact_get_<ENUM>(const struct ofpact *ofpact);
*
@@ -958,7 +957,7 @@ OFPACTS
#undef OFPACT
/* Call after adding the variable-length part to a variable-length action. */
-void ofpact_update_len(struct ofpbuf *, struct ofpact *);
+void ofpact_finish(struct ofpbuf *, struct ofpact *);
/* Additional functions for composing ofpacts. */
struct ofpact_set_field *ofpact_put_reg_load(struct ofpbuf *ofpacts);