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

Function tuntap_driver_from_flags

freebsd/net/if_tuntap.c:458–475  ·  view source on GitHub ↗

* Get driver information from a set of flags specified. Masks the identifying * part of the flags and compares it against all of the available * tuntap_drivers. Must be called with correct vnet context. */

Source from the content-addressed store, hash-verified

456 * tuntap_drivers. Must be called with correct vnet context.
457 */
458static struct tuntap_driver *
459tuntap_driver_from_flags(int tun_flags)
460{
461 struct tuntap_driver *drv;
462 struct tuntap_driver_cloner *drvc;
463
464 KASSERT(!SLIST_EMPTY(&V_tuntap_driver_cloners),
465 ("tuntap_driver_cloners failed to initialize"));
466 SLIST_FOREACH(drvc, &V_tuntap_driver_cloners, link) {
467 KASSERT(drvc->drv != NULL,
468 ("tuntap_driver_cloners entry not properly initialized"));
469 drv = drvc->drv;
470 if ((tun_flags & TUN_DRIVER_IDENT_MASK) == drv->ident_flags)
471 return (drv);
472 }
473
474 return (NULL);
475}
476
477static int
478tun_clone_match(struct if_clone *ifc, const char *name)

Callers 2

tun_clone_createFunction · 0.85
tuncloneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected