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 */ 28struct hdr_ui { 29 __u8 dsap; 30 __u8 ssap; 31 __u8 ctrl; 32 __u8 orig[3]; 33 __be16 type; 34}; 35 36struct hdr_ni { 37 __u8 dsap; 38 __u8 ssap; 39 __be16 ctrl; 40 __u8 orig[3]; 41 __be16 type; 42}; 43 44struct 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#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{ 59 return (struct ebt_802_3_hdr *)skb_mac_header(skb); 60} 61#endif 62 63struct ebt_802_3_info { 64 __u8 sap; 65 __be16 type; 66 __u8 bitmask; 67 __u8 invflags; 68}; 69 70#endif 71