* 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. */
| 456 | * tuntap_drivers. Must be called with correct vnet context. |
| 457 | */ |
| 458 | static struct tuntap_driver * |
| 459 | tuntap_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 | |
| 477 | static int |
| 478 | tun_clone_match(struct if_clone *ifc, const char *name) |
no outgoing calls
no test coverage detected