Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_vlan_var.h
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct ether_8021q_tag { | struct ether_8021q_tag { | ||||
uint16_t proto; | uint16_t proto; | ||||
uint16_t vid; | uint16_t vid; | ||||
uint8_t pcp; | uint8_t pcp; | ||||
}; | }; | ||||
#define VLAN_CAPABILITIES(_ifp) do { \ | #define VLAN_CAPABILITIES(_ifp) do { \ | ||||
if ((_ifp)->if_vlantrunk != NULL) \ | if (if_getvlantrunk(_ifp) != NULL) \ | ||||
(*vlan_trunk_cap_p)(_ifp); \ | (*vlan_trunk_cap_p)(_ifp); \ | ||||
} while (0) | } while (0) | ||||
#define VLAN_TRUNKDEV(_ifp) \ | #define VLAN_TRUNKDEV(_ifp) \ | ||||
(if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL) | (if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL) | ||||
#define VLAN_TAG(_ifp, _vid) \ | #define VLAN_TAG(_ifp, _vid) \ | ||||
(if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_vid)) : EINVAL) | (if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_vid)) : EINVAL) | ||||
#define VLAN_PCP(_ifp, _pcp) \ | #define VLAN_PCP(_ifp, _pcp) \ | ||||
(if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_pcp_p)((_ifp), (_pcp)) : EINVAL) | (if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_pcp_p)((_ifp), (_pcp)) : EINVAL) | ||||
#define VLAN_COOKIE(_ifp) \ | #define VLAN_COOKIE(_ifp) \ | ||||
(if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_cookie_p)((_ifp)) : NULL) | (if_gettype(_ifp) == IFT_L2VLAN ? (*vlan_cookie_p)((_ifp)) : NULL) | ||||
#define VLAN_SETCOOKIE(_ifp, _cookie) \ | #define VLAN_SETCOOKIE(_ifp, _cookie) \ | ||||
(if_gettype(_ifp) == IFT_L2VLAN ? \ | (if_gettype(_ifp) == IFT_L2VLAN ? \ | ||||
(*vlan_setcookie_p)((_ifp), (_cookie)) : EINVAL) | (*vlan_setcookie_p)((_ifp), (_cookie)) : EINVAL) | ||||
#define VLAN_DEVAT(_ifp, _vid) \ | #define VLAN_DEVAT(_ifp, _vid) \ | ||||
((_ifp)->if_vlantrunk != NULL ? (*vlan_devat_p)((_ifp), (_vid)) : NULL) | (if_getvlantrunk(_ifp) != NULL ? (*vlan_devat_p)((_ifp), (_vid)) : NULL) | ||||
extern void (*vlan_trunk_cap_p)(struct ifnet *); | extern void (*vlan_trunk_cap_p)(struct ifnet *); | ||||
extern struct ifnet *(*vlan_trunkdev_p)(struct ifnet *); | extern struct ifnet *(*vlan_trunkdev_p)(struct ifnet *); | ||||
extern struct ifnet *(*vlan_devat_p)(struct ifnet *, uint16_t); | extern struct ifnet *(*vlan_devat_p)(struct ifnet *, uint16_t); | ||||
extern int (*vlan_tag_p)(struct ifnet *, uint16_t *); | extern int (*vlan_tag_p)(struct ifnet *, uint16_t *); | ||||
extern int (*vlan_pcp_p)(struct ifnet *, uint16_t *); | extern int (*vlan_pcp_p)(struct ifnet *, uint16_t *); | ||||
extern int (*vlan_setcookie_p)(struct ifnet *, void *); | extern int (*vlan_setcookie_p)(struct ifnet *, void *); | ||||
extern void *(*vlan_cookie_p)(struct ifnet *); | extern void *(*vlan_cookie_p)(struct ifnet *); | ||||
Show All 34 Lines |