]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/linux-26-headers/include/linux/netfilter_bridge/ebt_802_3.h
update
[l4.git] / l4 / pkg / linux-26-headers / include / linux / netfilter_bridge / ebt_802_3.h
1 #ifndef __LINUX_BRIDGE_EBT_802_3_H
2 #define __LINUX_BRIDGE_EBT_802_3_H
3
4 #include <linux/types.h>
5
6 #define EBT_802_3_SAP 0x01
7 #define EBT_802_3_TYPE 0x02
8
9 #define EBT_802_3_MATCH "802_3"
10
11 /*
12  * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
13  * to discover what kind of packet we're carrying. 
14  */
15 #define CHECK_TYPE 0xaa
16
17 /*
18  * Control field may be one or two bytes.  If the first byte has
19  * the value 0x03 then the entire length is one byte, otherwise it is two.
20  * One byte controls are used in Unnumbered Information frames.
21  * Two byte controls are used in Numbered Information frames.
22  */
23 #define IS_UI 0x03
24
25 #define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
26
27 /* ui has one byte ctrl, ni has two */
28 struct hdr_ui {
29         __u8 dsap;
30         __u8 ssap;
31         __u8 ctrl;
32         __u8 orig[3];
33         __be16 type;
34 };
35
36 struct hdr_ni {
37         __u8 dsap;
38         __u8 ssap;
39         __be16 ctrl;
40         __u8  orig[3];
41         __be16 type;
42 };
43
44 struct ebt_802_3_hdr {
45         __u8  daddr[6];
46         __u8  saddr[6];
47         __be16 len;
48         union {
49                 struct hdr_ui ui;
50                 struct hdr_ni ni;
51         } llc;
52 };
53
54
55 struct ebt_802_3_info {
56         __u8  sap;
57         __be16 type;
58         __u8  bitmask;
59         __u8  invflags;
60 };
61
62 #endif /* __LINUX_BRIDGE_EBT_802_3_H */