| 108 | } |
| 109 | |
| 110 | int16_t |
| 111 | ethdev_portid_by_ip6(uint8_t *ip, uint8_t *mask) |
| 112 | { |
| 113 | int portid = -EINVAL; |
| 114 | struct ethdev *port; |
| 115 | int j; |
| 116 | |
| 117 | TAILQ_FOREACH(port, ð_node, next) { |
| 118 | for (j = 0; j < ETHDEV_IPV6_ADDR_LEN; j++) { |
| 119 | if (mask == NULL) { |
| 120 | if ((port->ip6_addr.ip[j] & port->ip6_addr.mask[j]) != |
| 121 | (ip[j] & port->ip6_addr.mask[j])) |
| 122 | break; |
| 123 | |
| 124 | } else { |
| 125 | if ((port->ip6_addr.ip[j] & port->ip6_addr.mask[j]) != |
| 126 | (ip[j] & mask[j])) |
| 127 | break; |
| 128 | } |
| 129 | } |
| 130 | if (j == ETHDEV_IPV6_ADDR_LEN) |
| 131 | return port->config.port_id; |
| 132 | } |
| 133 | |
| 134 | return portid; |
| 135 | } |
| 136 | |
| 137 | void |
| 138 | ethdev_list_clean(void) |
no outgoing calls
no test coverage detected