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_NETFILTER)
10 #include <asm/atomic.h>
14 /* After promisc drops, checksum checks. */
15 #define NF_BR_PRE_ROUTING 0
16 /* If the packet is destined for this box. */
17 #define NF_BR_LOCAL_IN 1
18 /* If the packet is destined for another interface. */
19 #define NF_BR_FORWARD 2
20 /* Packets coming from a local process. */
21 #define NF_BR_LOCAL_OUT 3
22 /* Packets about to hit the wire. */
23 #define NF_BR_POST_ROUTING 4
24 /* Not really a hook, but used for the ebtables broute table */
25 #define NF_BR_BROUTING 5
26 #define NF_BR_NUMHOOKS 6
30 #define BRNF_PKT_TYPE 0x01
31 #define BRNF_BRIDGED_DNAT 0x02
32 #define BRNF_DONT_TAKE_PARENT 0x04
33 #define BRNF_BRIDGED 0x08
35 enum nf_br_hook_priorities
{
36 NF_BR_PRI_FIRST
= INT_MIN
,
37 NF_BR_PRI_NAT_DST_BRIDGED
= -300,
38 NF_BR_PRI_FILTER_BRIDGED
= -200,
40 NF_BR_PRI_NAT_DST_OTHER
= 100,
41 NF_BR_PRI_FILTER_OTHER
= 200,
42 NF_BR_PRI_NAT_SRC
= 300,
43 NF_BR_PRI_LAST
= INT_MAX
,
46 #ifdef CONFIG_NETFILTER
48 struct nf_bridge_info
*nf_bridge_alloc(struct sk_buff
*skb
)
50 struct nf_bridge_info
**nf_bridge
= &(skb
->nf_bridge
);
52 if ((*nf_bridge
= kmalloc(sizeof(**nf_bridge
), GFP_ATOMIC
)) != NULL
) {
53 atomic_set(&(*nf_bridge
)->use
, 1);
54 (*nf_bridge
)->mask
= 0;
55 (*nf_bridge
)->physindev
= (*nf_bridge
)->physoutdev
= NULL
;
61 struct bridge_skb_cb
{
66 #endif /* CONFIG_NETFILTER */
68 #endif /* __KERNEL__ */