Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/ethernet.h
Show First 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | if (bpf_peers_present((_ifp)->if_bpf)) { \ | ||||
M_ASSERTVALID(_m); \ | M_ASSERTVALID(_m); \ | ||||
if (((_m)->m_flags & M_VLANTAG) != 0) \ | if (((_m)->m_flags & M_VLANTAG) != 0) \ | ||||
ether_vlan_mtap((_ifp)->if_bpf, (_m), NULL, 0); \ | ether_vlan_mtap((_ifp)->if_bpf, (_m), NULL, 0); \ | ||||
else \ | else \ | ||||
bpf_mtap((_ifp)->if_bpf, (_m)); \ | bpf_mtap((_ifp)->if_bpf, (_m)); \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
/* | |||||
* Names for 802.1q priorities ("802.1p"). Notice that in this scheme, | |||||
* (0 < 1), allowing default 0-tagged traffic to take priority over background | |||||
* tagged traffic. | |||||
*/ | |||||
#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ | |||||
#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ | |||||
#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ | |||||
#define IEEE8021Q_PCP_CA 3 /* Critical applications */ | |||||
#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency */ | |||||
#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ | |||||
#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ | |||||
#define IEEE8021Q_PCP_NC 7 /* Network control (highest) */ | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
struct ifnet; | struct ifnet; | ||||
struct mbuf; | struct mbuf; | ||||
struct route; | struct route; | ||||
struct sockaddr; | struct sockaddr; | ||||
struct bpf_if; | struct bpf_if; | ||||
extern uint32_t ether_crc32_le(const uint8_t *, size_t); | extern uint32_t ether_crc32_le(const uint8_t *, size_t); | ||||
extern uint32_t ether_crc32_be(const uint8_t *, size_t); | extern uint32_t ether_crc32_be(const uint8_t *, size_t); | ||||
extern void ether_demux(struct ifnet *, struct mbuf *); | extern void ether_demux(struct ifnet *, struct mbuf *); | ||||
extern void ether_ifattach(struct ifnet *, const u_int8_t *); | extern void ether_ifattach(struct ifnet *, const u_int8_t *); | ||||
extern void ether_ifdetach(struct ifnet *); | extern void ether_ifdetach(struct ifnet *); | ||||
extern int ether_ioctl(struct ifnet *, u_long, caddr_t); | extern int ether_ioctl(struct ifnet *, u_long, caddr_t); | ||||
extern int ether_output(struct ifnet *, struct mbuf *, | extern int ether_output(struct ifnet *, struct mbuf *, | ||||
const struct sockaddr *, struct route *); | const struct sockaddr *, struct route *); | ||||
extern int ether_output_frame(struct ifnet *, struct mbuf *); | extern int ether_output_frame(struct ifnet *, struct mbuf *); | ||||
extern char *ether_sprintf(const u_int8_t *); | extern char *ether_sprintf(const u_int8_t *); | ||||
void ether_vlan_mtap(struct bpf_if *, struct mbuf *, | void ether_vlan_mtap(struct bpf_if *, struct mbuf *, | ||||
void *, u_int); | void *, u_int); | ||||
struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); | struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); | ||||
bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, | |||||
uint16_t vid, uint8_t pcp); | |||||
#ifdef _SYS_EVENTHANDLER_H_ | #ifdef _SYS_EVENTHANDLER_H_ | ||||
/* new ethernet interface attached event */ | /* new ethernet interface attached event */ | ||||
typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); | typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); | ||||
EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t); | EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t); | ||||
#endif | #endif | ||||
#else /* _KERNEL */ | #else /* _KERNEL */ | ||||
Show All 19 Lines |