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

Function find_interfaces

dpdk/app/dumpcap/main.c:232–247  ·  view source on GitHub ↗

Name has been set but need to lookup port after eal_init */

Source from the content-addressed store, hash-verified

230
231/* Name has been set but need to lookup port after eal_init */
232static void find_interfaces(void)
233{
234 struct interface *intf;
235
236 TAILQ_FOREACH(intf, &interfaces, next) {
237 /* if name is valid then just record port */
238 if (rte_eth_dev_get_port_by_name(intf->name, &intf->port) == 0)
239 continue;
240
241 /* maybe got passed port number string as name */
242 intf->port = get_uint(intf->name, "port_number", UINT16_MAX);
243 if (rte_eth_dev_get_name_by_port(intf->port, intf->name) < 0)
244 rte_exit(EXIT_FAILURE, "Invalid port number %u\n",
245 intf->port);
246 }
247}
248
249/*
250 * Choose interface to capture if no -i option given.

Callers 1

mainFunction · 0.85

Calls 4

get_uintFunction · 0.85
rte_exitFunction · 0.85

Tested by

no test coverage detected