diff options
Diffstat (limited to 'sys/net/ethernet.h')
-rw-r--r-- | sys/net/ethernet.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index 15cab6c..b5a0fae 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -99,6 +99,41 @@ extern int (*ng_ether_output_p)(struct ifnet *ifp, struct mbuf **mp); extern void (*ng_ether_attach_p)(struct ifnet *ifp); extern void (*ng_ether_detach_p)(struct ifnet *ifp); +extern int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m); +extern int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m, + u_int16_t t); +#define _VLAN_INPUT(ifp, eh, m) do { \ + if (vlan_input_p != NULL) { \ + if ((*vlan_input_p)(eh, m) == -1) \ + (ifp)->if_noproto++; \ + } else { \ + m_free(m); \ + (ifp)->if_noproto++; \ + } \ +} while (0) + +#define VLAN_INPUT(ifp, eh, m) do { \ + /* XXX: lock */ \ + _VLAN_INPUT(ifp, eh, m); \ + /* XXX: unlock */ \ +} while (0) + +#define _VLAN_INPUT_TAG(ifp, eh, m, t) do { \ + if (vlan_input_tag_p != NULL) { \ + if ((*vlan_input_tag_p)(eh, m, t) == -1) \ + (ifp)->if_noproto++; \ + } else { \ + m_free(m); \ + (ifp)->if_noproto++; \ + } \ +} while (0) + +#define VLAN_INPUT_TAG(ifp, eh, m, t) do { \ + /* XXX: lock */ \ + _VLAN_INPUT_TAG(ifp, eh, m, t); \ + /* XXX: unlock */ \ +} while (0) + #else /* _KERNEL */ #include <sys/cdefs.h> |