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

Function add_interface

dpdk/app/dumpcap/main.c:211–229  ·  view source on GitHub ↗

Add interface to list of interfaces to capture */

Source from the content-addressed store, hash-verified

209
210/* Add interface to list of interfaces to capture */
211static struct interface *add_interface(const char *name)
212{
213 struct interface *intf;
214
215 if (strlen(name) >= RTE_ETH_NAME_MAX_LEN)
216 rte_exit(EXIT_FAILURE, "invalid name for interface: '%s'\n", name);
217
218 intf = malloc(sizeof(*intf));
219 if (!intf)
220 rte_exit(EXIT_FAILURE, "no memory for interface\n");
221
222 memset(intf, 0, sizeof(*intf));
223 rte_strscpy(intf->name, name, sizeof(intf->name));
224 intf->opts = capture;
225 intf->port = -1; /* port set later after EAL init */
226
227 TAILQ_INSERT_TAIL(&interfaces, intf, next);
228 return intf;
229}
230
231/* Name has been set but need to lookup port after eal_init */
232static void find_interfaces(void)

Callers 2

set_default_interfaceFunction · 0.85
parse_optsFunction · 0.85

Calls 4

rte_exitFunction · 0.85
mallocFunction · 0.85
memsetFunction · 0.85
rte_strscpyFunction · 0.85

Tested by

no test coverage detected