Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/if_vlan.c
Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | |||||
static void trunk_destroy(struct ifvlantrunk *trunk); | static void trunk_destroy(struct ifvlantrunk *trunk); | ||||
static void vlan_init(void *foo); | static void vlan_init(void *foo); | ||||
static void vlan_input(struct ifnet *ifp, struct mbuf *m); | static void vlan_input(struct ifnet *ifp, struct mbuf *m); | ||||
static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); | static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
static int vlan_snd_tag_alloc(struct ifnet *, | static int vlan_snd_tag_alloc(struct ifnet *, | ||||
union if_snd_tag_alloc_params *, struct m_snd_tag **); | union if_snd_tag_alloc_params *, struct m_snd_tag **); | ||||
static void vlan_snd_tag_free(struct m_snd_tag *); | |||||
#endif | #endif | ||||
static void vlan_qflush(struct ifnet *ifp); | static void vlan_qflush(struct ifnet *ifp); | ||||
static int vlan_setflag(struct ifnet *ifp, int flag, int status, | static int vlan_setflag(struct ifnet *ifp, int flag, int status, | ||||
int (*func)(struct ifnet *, int)); | int (*func)(struct ifnet *, int)); | ||||
static int vlan_setflags(struct ifnet *ifp, int status); | static int vlan_setflags(struct ifnet *ifp, int status); | ||||
static int vlan_setmulti(struct ifnet *ifp); | static int vlan_setmulti(struct ifnet *ifp); | ||||
static int vlan_transmit(struct ifnet *ifp, struct mbuf *m); | static int vlan_transmit(struct ifnet *ifp, struct mbuf *m); | ||||
static void vlan_unconfig(struct ifnet *ifp); | static void vlan_unconfig(struct ifnet *ifp); | ||||
▲ Show 20 Lines • Show All 764 Lines • ▼ Show 20 Lines | vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) | ||||
ifp->if_dunit = unit; | ifp->if_dunit = unit; | ||||
ifp->if_init = vlan_init; | ifp->if_init = vlan_init; | ||||
ifp->if_transmit = vlan_transmit; | ifp->if_transmit = vlan_transmit; | ||||
ifp->if_qflush = vlan_qflush; | ifp->if_qflush = vlan_qflush; | ||||
ifp->if_ioctl = vlan_ioctl; | ifp->if_ioctl = vlan_ioctl; | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
ifp->if_snd_tag_alloc = vlan_snd_tag_alloc; | ifp->if_snd_tag_alloc = vlan_snd_tag_alloc; | ||||
ifp->if_snd_tag_free = vlan_snd_tag_free; | |||||
#endif | #endif | ||||
ifp->if_flags = VLAN_IFFLAGS; | ifp->if_flags = VLAN_IFFLAGS; | ||||
ether_ifattach(ifp, eaddr); | ether_ifattach(ifp, eaddr); | ||||
/* Now undo some of the damage... */ | /* Now undo some of the damage... */ | ||||
ifp->if_baudrate = 0; | ifp->if_baudrate = 0; | ||||
ifp->if_type = IFT_L2VLAN; | ifp->if_type = IFT_L2VLAN; | ||||
ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; | ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; | ||||
ifa = ifp->if_addr; | ifa = ifp->if_addr; | ||||
▲ Show 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
/* get trunk device */ | /* get trunk device */ | ||||
ifp = vlan_trunkdev(ifp); | ifp = vlan_trunkdev(ifp); | ||||
if (ifp == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) | if (ifp == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) | ||||
return (EOPNOTSUPP); | return (EOPNOTSUPP); | ||||
/* forward allocation request */ | /* forward allocation request */ | ||||
return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); | return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); | ||||
} | |||||
static void | |||||
vlan_snd_tag_free(struct m_snd_tag *tag) | |||||
{ | |||||
tag->ifp->if_snd_tag_free(tag); | |||||
} | } | ||||
#endif | #endif |