From 774101397b17d90988046fc568d3f5f5520fbd67 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Thu, 14 Jul 2011 14:23:02 -0700 Subject: [PATCH] ofputil: Export ofputil_check_output_port(). Future patches will use this function outside of the ofputil module. --- lib/ofp-util.c | 7 ++++--- lib/ofp-util.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 00f9ce8bf..39bd0d1bf 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1944,8 +1944,8 @@ make_echo_reply(const struct ofp_header *rq) /* Checks that 'port' is a valid output port for the OFPAT_OUTPUT action, given * that the switch will never have more than 'max_ports' ports. Returns 0 if * 'port' is valid, otherwise an ofp_mkerr() return code. */ -static int -check_output_port(uint16_t port, int max_ports) +int +ofputil_check_output_port(uint16_t port, int max_ports) { switch (port) { case OFPP_IN_PORT: @@ -1994,7 +1994,8 @@ validate_actions(const union ofp_action *actions, size_t n_actions, error = 0; switch ((enum ofputil_action_code) code) { case OFPUTIL_OFPAT_OUTPUT: - error = check_output_port(ntohs(a->output.port), max_ports); + error = ofputil_check_output_port(ntohs(a->output.port), + max_ports); break; case OFPUTIL_OFPAT_SET_VLAN_VID: diff --git a/lib/ofp-util.h b/lib/ofp-util.h index 48b0a4cfb..adad087d8 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -92,6 +92,7 @@ int ofputil_decode_msg_type(const struct ofp_header *, const struct ofputil_msg_type **); enum ofputil_msg_code ofputil_msg_type_code(const struct ofputil_msg_type *); const char *ofputil_msg_type_name(const struct ofputil_msg_type *); +int ofputil_check_output_port(uint16_t ofp_port, int max_ports); /* Converting OFPFW_NW_SRC_MASK and OFPFW_NW_DST_MASK wildcard bit counts to * and from IP bitmasks. */ -- 2.43.0