| 89 | } |
| 90 | |
| 91 | int16_t |
| 92 | ethdev_portid_by_ip4(uint32_t ip, uint32_t mask) |
| 93 | { |
| 94 | int portid = -EINVAL; |
| 95 | struct ethdev *port; |
| 96 | |
| 97 | TAILQ_FOREACH(port, ð_node, next) { |
| 98 | if (mask == 0) { |
| 99 | if ((port->ip4_addr.ip & port->ip4_addr.mask) == (ip & port->ip4_addr.mask)) |
| 100 | return port->config.port_id; |
| 101 | } else { |
| 102 | if ((port->ip4_addr.ip & port->ip4_addr.mask) == (ip & mask)) |
| 103 | return port->config.port_id; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return portid; |
| 108 | } |
| 109 | |
| 110 | int16_t |
| 111 | ethdev_portid_by_ip6(uint8_t *ip, uint8_t *mask) |
no outgoing calls
no test coverage detected