]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - include/linux/netfilter_bridge/ebt_802_3.h
Merge tag 'for-linus-3.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-zesty-kernel.git] / include / linux / netfilter_bridge / ebt_802_3.h
CommitLineData
1da177e4
LT
1#ifndef __LINUX_BRIDGE_EBT_802_3_H
2#define __LINUX_BRIDGE_EBT_802_3_H
3
06988b06
JE
4#include <linux/types.h>
5
1da177e4
LT
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 */
28struct hdr_ui {
0260c1dc
JE
29 __u8 dsap;
30 __u8 ssap;
31 __u8 ctrl;
32 __u8 orig[3];
47c183fa 33 __be16 type;
1da177e4
LT
34};
35
36struct hdr_ni {
0260c1dc
JE
37 __u8 dsap;
38 __u8 ssap;
47c183fa 39 __be16 ctrl;
0260c1dc 40 __u8 orig[3];
47c183fa 41 __be16 type;
1da177e4
LT
42};
43
44struct ebt_802_3_hdr {
0260c1dc
JE
45 __u8 daddr[6];
46 __u8 saddr[6];
47c183fa 47 __be16 len;
1da177e4
LT
48 union {
49 struct hdr_ui ui;
50 struct hdr_ni ni;
51 } llc;
52};
53
54#ifdef __KERNEL__
55#include <linux/skbuff.h>
56
57static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
58{
98e399f8 59 return (struct ebt_802_3_hdr *)skb_mac_header(skb);
1da177e4
LT
60}
61#endif
62
d94d9fee 63struct ebt_802_3_info {
0260c1dc 64 __u8 sap;
47c183fa 65 __be16 type;
0260c1dc
JE
66 __u8 bitmask;
67 __u8 invflags;
1da177e4
LT
68};
69
70#endif