1 #ifndef __LINUX_BRIDGE_NETFILTER_H
2 #define __LINUX_BRIDGE_NETFILTER_H
4 /* bridge-specific defines for netfilter.
7 #include <linux/config.h>
8 #include <linux/netfilter.h>
9 #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
10 #include <asm/atomic.h>
11 #include <linux/if_ether.h>
15 /* After promisc drops, checksum checks. */
16 #define NF_BR_PRE_ROUTING 0
17 /* If the packet is destined for this box. */
18 #define NF_BR_LOCAL_IN 1
19 /* If the packet is destined for another interface. */
20 #define NF_BR_FORWARD 2
21 /* Packets coming from a local process. */
22 #define NF_BR_LOCAL_OUT 3
23 /* Packets about to hit the wire. */
24 #define NF_BR_POST_ROUTING 4
25 /* Not really a hook, but used for the ebtables broute table */
26 #define NF_BR_BROUTING 5
27 #define NF_BR_NUMHOOKS 6
31 enum nf_br_hook_priorities
{
32 NF_BR_PRI_FIRST
= INT_MIN
,
33 NF_BR_PRI_NAT_DST_BRIDGED
= -300,
34 NF_BR_PRI_FILTER_BRIDGED
= -200,
36 NF_BR_PRI_NAT_DST_OTHER
= 100,
37 NF_BR_PRI_FILTER_OTHER
= 200,
38 NF_BR_PRI_NAT_SRC
= 300,
39 NF_BR_PRI_LAST
= INT_MAX
,
42 #ifdef CONFIG_BRIDGE_NETFILTER
44 #define BRNF_PKT_TYPE 0x01
45 #define BRNF_BRIDGED_DNAT 0x02
46 #define BRNF_DONT_TAKE_PARENT 0x04
47 #define BRNF_BRIDGED 0x08
48 #define BRNF_NF_BRIDGE_PREROUTING 0x10
51 /* Only used in br_forward.c */
53 void nf_bridge_maybe_copy_header(struct sk_buff
*skb
)
56 if (skb
->protocol
== __constant_htons(ETH_P_8021Q
)) {
57 memcpy(skb
->data
- 18, skb
->nf_bridge
->data
, 18);
60 memcpy(skb
->data
- 16, skb
->nf_bridge
->data
, 16);
64 /* This is called by the IP fragmenting code and it ensures there is
65 * enough room for the encapsulating header (if there is one). */
67 int nf_bridge_pad(struct sk_buff
*skb
)
69 if (skb
->protocol
== __constant_htons(ETH_P_IP
))
72 if (skb
->protocol
== __constant_htons(ETH_P_8021Q
))
78 struct bridge_skb_cb
{
83 #endif /* CONFIG_BRIDGE_NETFILTER */
85 #endif /* __KERNEL__ */