pre-2.3.4..
[davej-history.git] / include / linux / firewall.h
blob1747f38116440cf8bd830052a3f5492ec614bc5e
1 #ifndef __LINUX_FIREWALL_H
2 #define __LINUX_FIREWALL_H
4 #include <linux/config.h>
6 /*
7 * Definitions for loadable firewall modules
8 */
10 #define FW_QUEUE 0
11 #define FW_BLOCK 1
12 #define FW_ACCEPT 2
13 #define FW_REJECT (-1)
14 #define FW_REDIRECT 3
15 #define FW_MASQUERADE 4
16 #define FW_SKIP 5
18 struct firewall_ops
20 struct firewall_ops *next;
21 int (*fw_forward)(struct firewall_ops *this, int pf,
22 struct device *dev, void *phdr, void *arg, struct sk_buff **pskb);
23 int (*fw_input)(struct firewall_ops *this, int pf,
24 struct device *dev, void *phdr, void *arg, struct sk_buff **pskb);
25 int (*fw_output)(struct firewall_ops *this, int pf,
26 struct device *dev, void *phdr, void *arg, struct sk_buff **pskb);
27 /* Data falling in the second 486 cache line isn't used directly
28 during a firewall call and scan, only by insert/delete and other
29 unusual cases
31 int fw_pf; /* Protocol family */
32 int fw_priority; /* Priority of chosen firewalls */
35 #ifdef __KERNEL__
36 extern int register_firewall(int pf, struct firewall_ops *fw);
37 extern int unregister_firewall(int pf, struct firewall_ops *fw);
38 extern void fwchain_init(void);
39 #ifdef CONFIG_FIREWALL
40 extern int call_fw_firewall(int pf, struct device *dev, void *phdr, void *arg, struct sk_buff **pskb);
41 extern int call_in_firewall(int pf, struct device *dev, void *phdr, void *arg, struct sk_buff **pskb);
42 extern int call_out_firewall(int pf, struct device *dev, void *phdr, void *arg, struct sk_buff **pskb);
43 #else
44 extern __inline__ int call_fw_firewall(int pf, struct device *dev, void *phdr, void *arg, struct sk_buff **skb)
46 return FW_ACCEPT;
49 extern __inline__ int call_in_firewall(int pf, struct device *dev, void *phdr, void *arg, struct sk_buff **skb)
51 return FW_ACCEPT;
54 extern __inline__ int call_out_firewall(int pf, struct device *dev, void *phdr, void *arg, struct sk_buff **skb)
56 return FW_ACCEPT;
59 #endif
60 #endif
61 #endif