Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_ethersubr.c
Show First 20 Lines • Show All 1,331 Lines • ▼ Show 20 Lines | ether_vlanencap_proto(struct mbuf *m, uint16_t tag, uint16_t proto) | ||||
evl = mtod(m, struct ether_vlan_header *); | evl = mtod(m, struct ether_vlan_header *); | ||||
bcopy((char *)evl + ETHER_VLAN_ENCAP_LEN, | bcopy((char *)evl + ETHER_VLAN_ENCAP_LEN, | ||||
(char *)evl, ETHER_HDR_LEN - ETHER_TYPE_LEN); | (char *)evl, ETHER_HDR_LEN - ETHER_TYPE_LEN); | ||||
evl->evl_encap_proto = htons(proto); | evl->evl_encap_proto = htons(proto); | ||||
evl->evl_tag = htons(tag); | evl->evl_tag = htons(tag); | ||||
return (m); | return (m); | ||||
} | } | ||||
void | |||||
ether_bpf_mtap_if(struct ifnet *ifp, struct mbuf *m) | |||||
{ | |||||
if (bpf_peers_present(ifp->if_bpf)) { | |||||
M_ASSERTVALID(m); | |||||
if ((m->m_flags & M_VLANTAG) != 0) | |||||
ether_vlan_mtap(ifp->if_bpf, m, NULL, 0); | |||||
else | |||||
bpf_mtap(ifp->if_bpf, m); | |||||
} | |||||
} | |||||
static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | ||||
"IEEE 802.1Q VLAN"); | "IEEE 802.1Q VLAN"); | ||||
static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, | static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, | ||||
CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | ||||
"for consistency"); | "for consistency"); | ||||
VNET_DEFINE_STATIC(int, soft_pad); | VNET_DEFINE_STATIC(int, soft_pad); | ||||
#define V_soft_pad VNET(soft_pad) | #define V_soft_pad VNET(soft_pad) | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |