MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ethdev_portid_by_ip6

Function ethdev_portid_by_ip6

dpdk/app/graph/ethdev.c:110–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110int16_t
111ethdev_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, &eth_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
137void
138ethdev_list_clean(void)

Callers 2

ip6_rewrite_node_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected