Deleted Added
full compact
ethernet.h (83115) ethernet.h (87276)
1/*
2 * Fundamental constants relating to ethernet.
3 *
1/*
2 * Fundamental constants relating to ethernet.
3 *
4 * $FreeBSD: head/sys/net/ethernet.h 83115 2001-09-05 21:10:28Z brooks $
4 * $FreeBSD: head/sys/net/ethernet.h 87276 2001-12-03 17:28:27Z brooks $
5 *
6 */
7
8#ifndef _NET_ETHERNET_H_
9#define _NET_ETHERNET_H_
10
11/*
12 * The number of bytes in an ethernet (MAC) address.

--- 84 unchanged lines hidden (view full) ---

97 struct mbuf *m, struct ether_header *eh);
98extern int (*ng_ether_output_p)(struct ifnet *ifp, struct mbuf **mp);
99extern void (*ng_ether_attach_p)(struct ifnet *ifp);
100extern void (*ng_ether_detach_p)(struct ifnet *ifp);
101
102extern int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m);
103extern int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m,
104 u_int16_t t);
5 *
6 */
7
8#ifndef _NET_ETHERNET_H_
9#define _NET_ETHERNET_H_
10
11/*
12 * The number of bytes in an ethernet (MAC) address.

--- 84 unchanged lines hidden (view full) ---

97 struct mbuf *m, struct ether_header *eh);
98extern int (*ng_ether_output_p)(struct ifnet *ifp, struct mbuf **mp);
99extern void (*ng_ether_attach_p)(struct ifnet *ifp);
100extern void (*ng_ether_detach_p)(struct ifnet *ifp);
101
102extern int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m);
103extern int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m,
104 u_int16_t t);
105#define _VLAN_INPUT(ifp, eh, m) do { \
105#define _VLAN_INPUT(eh, m) do { \
106 if (vlan_input_p != NULL) { \
107 if ((*vlan_input_p)(eh, m) == -1) \
106 if (vlan_input_p != NULL) { \
107 if ((*vlan_input_p)(eh, m) == -1) \
108 (ifp)->if_noproto++; \
108 (m)->m_pkthdr.rcvif->if_noproto++; \
109 } else { \
110 m_free(m); \
109 } else { \
110 m_free(m); \
111 (ifp)->if_noproto++; \
111 (m)->m_pkthdr.rcvif->if_noproto++; \
112 } \
113} while (0)
114
112 } \
113} while (0)
114
115#define VLAN_INPUT(ifp, eh, m) do { \
115#define VLAN_INPUT(eh, m) do { \
116 /* XXX: lock */ \
116 /* XXX: lock */ \
117 _VLAN_INPUT(ifp, eh, m); \
117 _VLAN_INPUT(eh, m); \
118 /* XXX: unlock */ \
119} while (0)
120
118 /* XXX: unlock */ \
119} while (0)
120
121#define _VLAN_INPUT_TAG(ifp, eh, m, t) do { \
121#define _VLAN_INPUT_TAG(eh, m, t) do { \
122 if (vlan_input_tag_p != NULL) { \
123 if ((*vlan_input_tag_p)(eh, m, t) == -1) \
122 if (vlan_input_tag_p != NULL) { \
123 if ((*vlan_input_tag_p)(eh, m, t) == -1) \
124 (ifp)->if_noproto++; \
124 (m)->m_pkthdr.rcvif->if_noproto++; \
125 } else { \
126 m_free(m); \
125 } else { \
126 m_free(m); \
127 (ifp)->if_noproto++; \
127 (m)->m_pkthdr.rcvif->if_noproto++; \
128 } \
129} while (0)
130
128 } \
129} while (0)
130
131#define VLAN_INPUT_TAG(ifp, eh, m, t) do { \
131#define VLAN_INPUT_TAG(eh, m, t) do { \
132 /* XXX: lock */ \
132 /* XXX: lock */ \
133 _VLAN_INPUT_TAG(ifp, eh, m, t); \
133 _VLAN_INPUT_TAG(eh, m, t); \
134 /* XXX: unlock */ \
135} while (0)
136
137#else /* _KERNEL */
138
139#include <sys/cdefs.h>
140
141/*

--- 13 unchanged lines hidden ---
134 /* XXX: unlock */ \
135} while (0)
136
137#else /* _KERNEL */
138
139#include <sys/cdefs.h>
140
141/*

--- 13 unchanged lines hidden ---