MCPcopy Index your code
hub / github.com/F-Stack/f-stack / set_default_interface

Function set_default_interface

dpdk/app/dumpcap/main.c:253–268  ·  view source on GitHub ↗

* Choose interface to capture if no -i option given. * Select the first DPDK port, this matches what dumpcap does. */

Source from the content-addressed store, hash-verified

251 * Select the first DPDK port, this matches what dumpcap does.
252 */
253static void set_default_interface(void)
254{
255 struct interface *intf;
256 char name[RTE_ETH_NAME_MAX_LEN];
257 uint16_t p;
258
259 RTE_ETH_FOREACH_DEV(p) {
260 if (rte_eth_dev_get_name_by_port(p, name) < 0)
261 continue;
262
263 intf = add_interface(name);
264 intf->port = p;
265 return;
266 }
267 rte_exit(EXIT_FAILURE, "No usable interfaces found\n");
268}
269
270/* Display list of possible interfaces that can be used. */
271static void dump_interfaces(void)

Callers 1

mainFunction · 0.85

Calls 3

add_interfaceFunction · 0.85
rte_exitFunction · 0.85

Tested by

no test coverage detected