Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/ethernet.h
Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Lines | |||||
#include <sys/_eventhandler.h> | #include <sys/_eventhandler.h> | ||||
struct ifnet; | struct ifnet; | ||||
struct mbuf; | struct mbuf; | ||||
struct route; | struct route; | ||||
struct sockaddr; | struct sockaddr; | ||||
struct bpf_if; | struct bpf_if; | ||||
struct ether_8021q_tag; | |||||
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_proto(struct mbuf *, uint16_t, uint16_t); | ||||
bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, | bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, | ||||
uint16_t vid, uint8_t pcp); | struct ifnet *p, struct ether_8021q_tag *); | ||||
void ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr); | void ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr); | ||||
static __inline struct mbuf *ether_vlanencap(struct mbuf *m, uint16_t tag) | |||||
{ | |||||
return ether_vlanencap_proto(m, tag, ETHERTYPE_VLAN); | |||||
} | |||||
/* 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); | ||||
#else /* _KERNEL */ | #else /* _KERNEL */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
Show All 17 Lines |