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

Function if_clone_simple

freebsd/net/if_clone.c:408–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408struct if_clone *
409if_clone_simple(const char *name, ifcs_create_t create, ifcs_destroy_t destroy,
410 u_int minifs)
411{
412 struct if_clone *ifc;
413 u_int unit;
414
415 ifc = if_clone_alloc(name, 0);
416 ifc->ifc_type = SIMPLE;
417 ifc->ifcs_create = create;
418 ifc->ifcs_destroy = destroy;
419 ifc->ifcs_minifs = minifs;
420
421 if (if_clone_attach(ifc) != 0)
422 return (NULL);
423
424 for (unit = 0; unit < minifs; unit++) {
425 char name[IFNAMSIZ];
426 int error __unused;
427
428 snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, unit);
429 error = if_clone_createif(ifc, name, IFNAMSIZ, NULL);
430 KASSERT(error == 0,
431 ("%s: failed to create required interface %s",
432 __func__, name));
433 }
434
435 EVENTHANDLER_INVOKE(if_clone_event, ifc);
436
437 return (ifc);
438}
439
440/*
441 * Unregister a network interface cloner.

Callers 15

pflogattachFunction · 0.85
vnet_pfsync_initFunction · 0.85
ipfw_bpf_initFunction · 0.85
wlan_modeventFunction · 0.85
iflib_clone_registerFunction · 0.85
vxlan_loadFunction · 0.85
vnet_gre_initFunction · 0.85
vnet_lagg_initFunction · 0.85
vnet_enc_initFunction · 0.85
vnet_me_initFunction · 0.85
vnet_edsc_initFunction · 0.85
vnet_gif_initFunction · 0.85

Calls 4

if_clone_allocFunction · 0.85
if_clone_attachFunction · 0.85
snprintfFunction · 0.85
if_clone_createifFunction · 0.85

Tested by

no test coverage detected