/* 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:
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:
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. */