FreeBSD/sys/net/if_vlan.c
/*
 * Return the vlan device present at the specific VID.
 */
Return the vlan device present at the specific VID.
Return the vlan device present at the specific VID .
static struct ifnet *
vlan_devat(struct ifnet *ifp, uint16_t vid)
{
	struct ifvlantrunk *trunk;
	struct ifvlan *ifv;
	TRUNK_LOCK_READER;
	trunk = ifp->if_vlantrunk;
	if (trunk == NULL)
		return (NULL);
	ifp = NULL;
	TRUNK_RLOCK(trunk);
	ifv = vlan_gethash(trunk, vid);
	if (ifv)
		ifp = ifv->ifv_ifp;
	TRUNK_RUNLOCK(trunk);
	return (ifp);
}
static struct ifnet * vlan_devat ( struct ifnet * ifp , uint16_t vid ) { struct ifvlantrunk * trunk ; struct ifvlan * ifv ; TRUNK_LOCK_READER ; trunk = ifp -> if_vlantrunk ; if ( trunk == NULL ) return ( NULL ) ; ifp = NULL ; TRUNK_RLOCK ( trunk ) ; ifv = vlan_gethash ( trunk , vid ) ; if ( ifv ) ifp = ifv -> ifv_ifp ; TRUNK_RUNLOCK ( trunk ) ; return ( ifp ) ; }
Return the vlan device present at the specific VID.
Return the vlan device present at the specific VID .