patch-1.3.36 linux/include/linux/firewall.h

Next file: linux/include/linux/fs.h
Previous file: linux/include/linux/cyclades.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.35/linux/include/linux/firewall.h linux/include/linux/firewall.h
@@ -0,0 +1,40 @@
+#ifndef __LINUX_FIREWALL_H
+#define __LINUX_FIREWALL_H
+
+/*
+ *	Definitions for loadable firewall modules
+ */
+
+#define FW_BLOCK	0
+#define FW_ACCEPT	1
+#define FW_REJECT	(-1)
+#define FW_MASQUERADE	2
+#define FW_SKIP		3
+
+struct firewall_ops
+{
+	struct firewall_ops *next;
+	int (*fw_forward)(struct firewall_ops *this, int pf, 
+			struct sk_buff *skb, void *phdr);
+	int (*fw_input)(struct firewall_ops *this, int pf, 
+			struct sk_buff *skb, void *phdr);
+	int (*fw_output)(struct firewall_ops *this, int pf, 
+			struct sk_buff *skb, void *phdr);
+	/* Data falling in the second 486 cache line isn't used directly
+	   during a firewall call and scan, only by insert/delete and other
+	   unusual cases
+	 */
+	int fw_pf;		/* Protocol family 			*/	
+	int fw_priority;	/* Priority of chosen firewalls 	*/
+};
+
+#ifdef __KERNEL__
+extern int register_firewall(int pf, struct firewall_ops *fw);
+extern int unregister_firewall(int pf, struct firewall_ops *fw);
+extern int call_fw_firewall(int pf, struct sk_buff *skb, void *phdr);
+extern int call_in_firewall(int pf, struct sk_buff *skb, void *phdr);
+extern int call_out_firewall(int pf, struct sk_buff *skb, void *phdr);
+extern void fwchain_init(void);
+#endif
+
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this