@@ -31,8 +31,8 @@ bool ofputil_decode_hello(const struct ofp_header *,
uint32_t *allowed_versions);
struct ofpbuf *ofputil_encode_hello(uint32_t version_bitmap);
-struct ofpbuf *make_echo_request(enum ofp_version);
-struct ofpbuf *make_echo_reply(const struct ofp_header *);
+struct ofpbuf *ofputil_encode_echo_request(enum ofp_version);
+struct ofpbuf *ofputil_encode_echo_reply(const struct ofp_header *);
struct ofpbuf *ofputil_encode_barrier_request(enum ofp_version);
@@ -618,7 +618,7 @@ process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
static void
process_echo_request(struct lswitch *sw, const struct ofp_header *rq)
{
- queue_tx(sw, make_echo_reply(rq));
+ queue_tx(sw, ofputil_encode_echo_reply(rq));
}
static ofp_port_t
@@ -176,7 +176,7 @@ ofputil_encode_hello(uint32_t allowed_versions)
/* Creates and returns an OFPT_ECHO_REQUEST message with an empty payload. */
struct ofpbuf *
-make_echo_request(enum ofp_version ofp_version)
+ofputil_encode_echo_request(enum ofp_version ofp_version)
{
return ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, ofp_version,
htonl(0), 0);
@@ -185,7 +185,7 @@ make_echo_request(enum ofp_version ofp_version)
/* Creates and returns an OFPT_ECHO_REPLY message matching the
* OFPT_ECHO_REQUEST message in 'rq'. */
struct ofpbuf *
-make_echo_reply(const struct ofp_header *rq)
+ofputil_encode_echo_reply(const struct ofp_header *rq)
{
struct ofpbuf rq_buf = ofpbuf_const_initializer(rq, ntohs(rq->length));
ofpraw_pull_assert(&rq_buf);
@@ -581,7 +581,7 @@ run_ACTIVE(struct rconn *rc)
* anything.) */
int version = rconn_get_version__(rc);
if (version >= 0 && version <= 0xff) {
- rconn_send__(rc, make_echo_request(version), NULL);
+ rconn_send__(rc, ofputil_encode_echo_request(version), NULL);
}
return;
@@ -3203,7 +3203,7 @@ learned_cookies_flush(struct ofproto *ofproto, struct ovs_list *dead_cookies)
static enum ofperr
handle_echo_request(struct ofconn *ofconn, const struct ofp_header *oh)
{
- ofconn_send_reply(ofconn, make_echo_reply(oh));
+ ofconn_send_reply(ofconn, ofputil_encode_echo_reply(oh));
return 0;
}
@@ -607,7 +607,7 @@ static void
ofctrl_recv(const struct ofp_header *oh, enum ofptype type)
{
if (type == OFPTYPE_ECHO_REQUEST) {
- queue_msg(make_echo_reply(oh));
+ queue_msg(ofputil_encode_echo_reply(oh));
} else if (type == OFPTYPE_ERROR) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
log_openflow_rl(&rl, VLL_INFO, oh, "OpenFlow error");
@@ -1034,7 +1034,7 @@ pinctrl_recv(const struct ofp_header *oh, enum ofptype type,
struct controller_ctx *ctx)
{
if (type == OFPTYPE_ECHO_REQUEST) {
- queue_msg(make_echo_reply(oh));
+ queue_msg(ofputil_encode_echo_reply(oh));
} else if (type == OFPTYPE_GET_CONFIG_REPLY) {
/* Enable asynchronous messages */
struct ofputil_switch_config config;
@@ -2161,7 +2161,7 @@ monitor_vconn(struct vconn *vconn, bool reply_to_echo_requests,
if (reply_to_echo_requests) {
struct ofpbuf *reply;
- reply = make_echo_reply(b->data);
+ reply = ofputil_encode_echo_reply(b->data);
retval = vconn_send_block(vconn, reply);
if (retval) {
ovs_fatal(retval, "failed to send echo reply");
@@ -2359,7 +2359,7 @@ ofctl_probe(struct ovs_cmdl_context *ctx)
struct ofpbuf *reply;
open_vconn(ctx->argv[1], &vconn);
- request = make_echo_request(vconn_get_version(vconn));
+ request = ofputil_encode_echo_request(vconn_get_version(vconn));
run(vconn_transact(vconn, request, &reply), "talking to %s", ctx->argv[1]);
if (reply->size != sizeof(struct ofp_header)) {
ovs_fatal(0, "reply does not match request");
Most of the tree now uses "encode" as the verb for making an OpenFlow message, so adopt it here in this very old code as well. Signed-off-by: Ben Pfaff <blp@ovn.org> --- include/openvswitch/ofp-util.h | 4 ++-- lib/learning-switch.c | 2 +- lib/ofp-util.c | 4 ++-- lib/rconn.c | 2 +- ofproto/ofproto.c | 2 +- ovn/controller/ofctrl.c | 2 +- ovn/controller/pinctrl.c | 2 +- utilities/ovs-ofctl.c | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-)