From: Ethan Jackson Date: Thu, 14 Jul 2011 21:23:02 +0000 (-0700) Subject: ofputil: Export ofputil_check_output_port(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=774101397b17d90988046fc568d3f5f5520fbd67;p=openvswitch ofputil: Export ofputil_check_output_port(). Future patches will use this function outside of the ofputil module. --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 00f9ce8b..39bd0d1b 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 48b0a4cf..adad087d 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. */