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

Function ethdev_portid_by_ip4

dpdk/app/graph/ethdev.c:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91int16_t
92ethdev_portid_by_ip4(uint32_t ip, uint32_t mask)
93{
94 int portid = -EINVAL;
95 struct ethdev *port;
96
97 TAILQ_FOREACH(port, &eth_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
110int16_t
111ethdev_portid_by_ip6(uint8_t *ip, uint8_t *mask)

Callers 2

ip4_rewrite_node_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected