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

Function tuntap_driver_from_ifnet

freebsd/net/if_tuntap.c:729–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727SYSUNINIT(tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, tun_uninit, NULL);
728
729static struct tuntap_driver *
730tuntap_driver_from_ifnet(const struct ifnet *ifp)
731{
732 struct tuntap_driver *drv;
733 int i;
734
735 if (ifp == NULL)
736 return (NULL);
737
738 for (i = 0; i < nitems(tuntap_drivers); ++i) {
739 drv = &tuntap_drivers[i];
740 if (strcmp(ifp->if_dname, drv->cdevsw.d_name) == 0)
741 return (drv);
742 }
743
744 return (NULL);
745}
746
747static int
748tuntapmodevent(module_t mod, int type, void *data)

Callers 1

tunrenameFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected