diff options
author | Patrick McHardy <kaber@trash.net> | 2007-12-18 01:38:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:58:58 -0500 |
commit | f01ffbd6e7d001ccf9168b33507958a51ce0ffcf (patch) | |
tree | a5e6fae2808f371642566f3d5e75227e94b2d863 | |
parent | cc01dcbd26865addfe9eb5431f1f9dbc511515ba (diff) |
[NETFILTER]: nf_log: move logging stuff to seperate header
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netfilter.h | 55 | ||||
-rw-r--r-- | include/net/netfilter/nf_log.h | 59 | ||||
-rw-r--r-- | net/bridge/netfilter/ebt_log.c | 1 | ||||
-rw-r--r-- | net/bridge/netfilter/ebt_ulog.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_LOG.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 1 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 1 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_LOG.c | 1 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 1 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_tcp.c | 1 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_udp.c | 1 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_udplite.c | 1 | ||||
-rw-r--r-- | net/netfilter/nf_log.c | 1 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 1 | ||||
-rw-r--r-- | net/netfilter/xt_NFLOG.c | 1 |
17 files changed, 74 insertions, 55 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index f25eec595807..368b7ed1f1bf 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -124,61 +124,6 @@ extern struct ctl_table nf_net_ipv4_netfilter_sysctl_path[]; | |||
124 | 124 | ||
125 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 125 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; |
126 | 126 | ||
127 | /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will | ||
128 | * disappear once iptables is replaced with pkttables. Please DO NOT use them | ||
129 | * for any new code! */ | ||
130 | #define NF_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ | ||
131 | #define NF_LOG_TCPOPT 0x02 /* Log TCP options */ | ||
132 | #define NF_LOG_IPOPT 0x04 /* Log IP options */ | ||
133 | #define NF_LOG_UID 0x08 /* Log UID owning local socket */ | ||
134 | #define NF_LOG_MASK 0x0f | ||
135 | |||
136 | #define NF_LOG_TYPE_LOG 0x01 | ||
137 | #define NF_LOG_TYPE_ULOG 0x02 | ||
138 | |||
139 | struct nf_loginfo { | ||
140 | u_int8_t type; | ||
141 | union { | ||
142 | struct { | ||
143 | u_int32_t copy_len; | ||
144 | u_int16_t group; | ||
145 | u_int16_t qthreshold; | ||
146 | } ulog; | ||
147 | struct { | ||
148 | u_int8_t level; | ||
149 | u_int8_t logflags; | ||
150 | } log; | ||
151 | } u; | ||
152 | }; | ||
153 | |||
154 | typedef void nf_logfn(unsigned int pf, | ||
155 | unsigned int hooknum, | ||
156 | const struct sk_buff *skb, | ||
157 | const struct net_device *in, | ||
158 | const struct net_device *out, | ||
159 | const struct nf_loginfo *li, | ||
160 | const char *prefix); | ||
161 | |||
162 | struct nf_logger { | ||
163 | struct module *me; | ||
164 | nf_logfn *logfn; | ||
165 | char *name; | ||
166 | }; | ||
167 | |||
168 | /* Function to register/unregister log function. */ | ||
169 | int nf_log_register(int pf, struct nf_logger *logger); | ||
170 | void nf_log_unregister(struct nf_logger *logger); | ||
171 | void nf_log_unregister_pf(int pf); | ||
172 | |||
173 | /* Calls the registered backend logging function */ | ||
174 | void nf_log_packet(int pf, | ||
175 | unsigned int hooknum, | ||
176 | const struct sk_buff *skb, | ||
177 | const struct net_device *in, | ||
178 | const struct net_device *out, | ||
179 | struct nf_loginfo *li, | ||
180 | const char *fmt, ...); | ||
181 | |||
182 | int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, | 127 | int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, |
183 | struct net_device *indev, struct net_device *outdev, | 128 | struct net_device *indev, struct net_device *outdev, |
184 | int (*okfn)(struct sk_buff *), int thresh); | 129 | int (*okfn)(struct sk_buff *), int thresh); |
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h new file mode 100644 index 000000000000..f0426e59f229 --- /dev/null +++ b/include/net/netfilter/nf_log.h | |||
@@ -0,0 +1,59 @@ | |||
1 | #ifndef _NF_LOG_H | ||
2 | #define _NF_LOG_H | ||
3 | |||
4 | /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will | ||
5 | * disappear once iptables is replaced with pkttables. Please DO NOT use them | ||
6 | * for any new code! */ | ||
7 | #define NF_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ | ||
8 | #define NF_LOG_TCPOPT 0x02 /* Log TCP options */ | ||
9 | #define NF_LOG_IPOPT 0x04 /* Log IP options */ | ||
10 | #define NF_LOG_UID 0x08 /* Log UID owning local socket */ | ||
11 | #define NF_LOG_MASK 0x0f | ||
12 | |||
13 | #define NF_LOG_TYPE_LOG 0x01 | ||
14 | #define NF_LOG_TYPE_ULOG 0x02 | ||
15 | |||
16 | struct nf_loginfo { | ||
17 | u_int8_t type; | ||
18 | union { | ||
19 | struct { | ||
20 | u_int32_t copy_len; | ||
21 | u_int16_t group; | ||
22 | u_int16_t qthreshold; | ||
23 | } ulog; | ||
24 | struct { | ||
25 | u_int8_t level; | ||
26 | u_int8_t logflags; | ||
27 | } log; | ||
28 | } u; | ||
29 | }; | ||
30 | |||
31 | typedef void nf_logfn(unsigned int pf, | ||
32 | unsigned int hooknum, | ||
33 | const struct sk_buff *skb, | ||
34 | const struct net_device *in, | ||
35 | const struct net_device *out, | ||
36 | const struct nf_loginfo *li, | ||
37 | const char *prefix); | ||
38 | |||
39 | struct nf_logger { | ||
40 | struct module *me; | ||
41 | nf_logfn *logfn; | ||
42 | char *name; | ||
43 | }; | ||
44 | |||
45 | /* Function to register/unregister log function. */ | ||
46 | int nf_log_register(int pf, struct nf_logger *logger); | ||
47 | void nf_log_unregister(struct nf_logger *logger); | ||
48 | void nf_log_unregister_pf(int pf); | ||
49 | |||
50 | /* Calls the registered backend logging function */ | ||
51 | void nf_log_packet(int pf, | ||
52 | unsigned int hooknum, | ||
53 | const struct sk_buff *skb, | ||
54 | const struct net_device *in, | ||
55 | const struct net_device *out, | ||
56 | struct nf_loginfo *li, | ||
57 | const char *fmt, ...); | ||
58 | |||
59 | #endif /* _NF_LOG_H */ | ||
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index 457815fb5584..fcb3b54dc191 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/in.h> | 17 | #include <linux/in.h> |
18 | #include <linux/if_arp.h> | 18 | #include <linux/if_arp.h> |
19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
20 | #include <net/netfilter/nf_log.h> | ||
20 | 21 | ||
21 | static DEFINE_SPINLOCK(ebt_log_lock); | 22 | static DEFINE_SPINLOCK(ebt_log_lock); |
22 | 23 | ||
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index e7cfd30bac75..1b9ca07f44ff 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
39 | #include <linux/netfilter_bridge/ebtables.h> | 39 | #include <linux/netfilter_bridge/ebtables.h> |
40 | #include <linux/netfilter_bridge/ebt_ulog.h> | 40 | #include <linux/netfilter_bridge/ebt_ulog.h> |
41 | #include <net/netfilter/nf_log.h> | ||
41 | #include <net/sock.h> | 42 | #include <net/sock.h> |
42 | #include "../br_private.h" | 43 | #include "../br_private.h" |
43 | 44 | ||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 439b2925765d..271f6a5d3d4c 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <linux/netfilter/x_tables.h> | 27 | #include <linux/netfilter/x_tables.h> |
28 | #include <linux/netfilter_ipv4/ip_tables.h> | 28 | #include <linux/netfilter_ipv4/ip_tables.h> |
29 | #include <net/netfilter/nf_log.h> | ||
29 | 30 | ||
30 | MODULE_LICENSE("GPL"); | 31 | MODULE_LICENSE("GPL"); |
31 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); | 32 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); |
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index f8c613a6eb04..4b346e59bf2d 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/netfilter.h> | 22 | #include <linux/netfilter.h> |
23 | #include <linux/netfilter/x_tables.h> | 23 | #include <linux/netfilter/x_tables.h> |
24 | #include <linux/netfilter_ipv4/ipt_LOG.h> | 24 | #include <linux/netfilter_ipv4/ipt_LOG.h> |
25 | #include <net/netfilter/nf_log.h> | ||
25 | 26 | ||
26 | MODULE_LICENSE("GPL"); | 27 | MODULE_LICENSE("GPL"); |
27 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); | 28 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 4139042a63a1..1d8e146345e4 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/netfilter.h> | 43 | #include <linux/netfilter.h> |
44 | #include <linux/netfilter/x_tables.h> | 44 | #include <linux/netfilter/x_tables.h> |
45 | #include <linux/netfilter_ipv4/ipt_ULOG.h> | 45 | #include <linux/netfilter_ipv4/ipt_ULOG.h> |
46 | #include <net/netfilter/nf_log.h> | ||
46 | #include <net/sock.h> | 47 | #include <net/sock.h> |
47 | #include <linux/bitops.h> | 48 | #include <linux/bitops.h> |
48 | #include <asm/unaligned.h> | 49 | #include <asm/unaligned.h> |
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c index 3e2e5cdda9de..cd0d6690627e 100644 --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <net/netfilter/nf_conntrack_tuple.h> | 18 | #include <net/netfilter/nf_conntrack_tuple.h> |
19 | #include <net/netfilter/nf_conntrack_l4proto.h> | 19 | #include <net/netfilter/nf_conntrack_l4proto.h> |
20 | #include <net/netfilter/nf_conntrack_core.h> | 20 | #include <net/netfilter/nf_conntrack_core.h> |
21 | #include <net/netfilter/nf_log.h> | ||
21 | 22 | ||
22 | static unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ; | 23 | static unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ; |
23 | 24 | ||
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index d910d56d22da..bb50d0e66734 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <linux/netfilter_ipv6/ip6_tables.h> | 29 | #include <linux/netfilter_ipv6/ip6_tables.h> |
30 | #include <linux/netfilter/x_tables.h> | 30 | #include <linux/netfilter/x_tables.h> |
31 | #include <net/netfilter/nf_log.h> | ||
31 | 32 | ||
32 | MODULE_LICENSE("GPL"); | 33 | MODULE_LICENSE("GPL"); |
33 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); | 34 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index 19523242991d..e6a2b1e9469c 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/netfilter.h> | 23 | #include <linux/netfilter.h> |
24 | #include <linux/netfilter/x_tables.h> | 24 | #include <linux/netfilter/x_tables.h> |
25 | #include <linux/netfilter_ipv6/ip6_tables.h> | 25 | #include <linux/netfilter_ipv6/ip6_tables.h> |
26 | #include <net/netfilter/nf_log.h> | ||
26 | 27 | ||
27 | MODULE_AUTHOR("Jan Rekorajski <baggins@pld.org.pl>"); | 28 | MODULE_AUTHOR("Jan Rekorajski <baggins@pld.org.pl>"); |
28 | MODULE_DESCRIPTION("IP6 tables LOG target module"); | 29 | MODULE_DESCRIPTION("IP6 tables LOG target module"); |
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index 44689d444410..02d60dfbab80 100644 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <net/netfilter/nf_conntrack_l4proto.h> | 24 | #include <net/netfilter/nf_conntrack_l4proto.h> |
25 | #include <net/netfilter/nf_conntrack_core.h> | 25 | #include <net/netfilter/nf_conntrack_core.h> |
26 | #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h> | 26 | #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h> |
27 | #include <net/netfilter/nf_log.h> | ||
27 | 28 | ||
28 | static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ; | 29 | static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ; |
29 | 30 | ||
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 600b476d225c..1d496b912bd0 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <net/netfilter/nf_conntrack.h> | 24 | #include <net/netfilter/nf_conntrack.h> |
25 | #include <net/netfilter/nf_conntrack_l4proto.h> | 25 | #include <net/netfilter/nf_conntrack_l4proto.h> |
26 | #include <net/netfilter/nf_conntrack_ecache.h> | 26 | #include <net/netfilter/nf_conntrack_ecache.h> |
27 | #include <net/netfilter/nf_log.h> | ||
27 | 28 | ||
28 | /* Protects conntrack->proto.tcp */ | 29 | /* Protects conntrack->proto.tcp */ |
29 | static DEFINE_RWLOCK(tcp_lock); | 30 | static DEFINE_RWLOCK(tcp_lock); |
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c index 570a2e109478..7ac607319562 100644 --- a/net/netfilter/nf_conntrack_proto_udp.c +++ b/net/netfilter/nf_conntrack_proto_udp.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/netfilter_ipv6.h> | 21 | #include <linux/netfilter_ipv6.h> |
22 | #include <net/netfilter/nf_conntrack_l4proto.h> | 22 | #include <net/netfilter/nf_conntrack_l4proto.h> |
23 | #include <net/netfilter/nf_conntrack_ecache.h> | 23 | #include <net/netfilter/nf_conntrack_ecache.h> |
24 | #include <net/netfilter/nf_log.h> | ||
24 | 25 | ||
25 | static unsigned int nf_ct_udp_timeout __read_mostly = 30*HZ; | 26 | static unsigned int nf_ct_udp_timeout __read_mostly = 30*HZ; |
26 | static unsigned int nf_ct_udp_timeout_stream __read_mostly = 180*HZ; | 27 | static unsigned int nf_ct_udp_timeout_stream __read_mostly = 180*HZ; |
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c index 7e116d5766d1..6518bcd17d65 100644 --- a/net/netfilter/nf_conntrack_proto_udplite.c +++ b/net/netfilter/nf_conntrack_proto_udplite.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/netfilter_ipv6.h> | 22 | #include <linux/netfilter_ipv6.h> |
23 | #include <net/netfilter/nf_conntrack_l4proto.h> | 23 | #include <net/netfilter/nf_conntrack_l4proto.h> |
24 | #include <net/netfilter/nf_conntrack_ecache.h> | 24 | #include <net/netfilter/nf_conntrack_ecache.h> |
25 | #include <net/netfilter/nf_log.h> | ||
25 | 26 | ||
26 | static unsigned int nf_ct_udplite_timeout __read_mostly = 30*HZ; | 27 | static unsigned int nf_ct_udplite_timeout __read_mostly = 30*HZ; |
27 | static unsigned int nf_ct_udplite_timeout_stream __read_mostly = 180*HZ; | 28 | static unsigned int nf_ct_udplite_timeout_stream __read_mostly = 180*HZ; |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index d67c4fbf6031..fad97d69481c 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/netfilter.h> | 6 | #include <linux/netfilter.h> |
7 | #include <linux/seq_file.h> | 7 | #include <linux/seq_file.h> |
8 | #include <net/protocol.h> | 8 | #include <net/protocol.h> |
9 | #include <net/netfilter/nf_log.h> | ||
9 | 10 | ||
10 | #include "nf_internals.h" | 11 | #include "nf_internals.h" |
11 | 12 | ||
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 2c7bd2eb0294..959a0cb131f1 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/jhash.h> | 29 | #include <linux/jhash.h> |
30 | #include <linux/random.h> | 30 | #include <linux/random.h> |
31 | #include <net/sock.h> | 31 | #include <net/sock.h> |
32 | #include <net/netfilter/nf_log.h> | ||
32 | 33 | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | 35 | ||
diff --git a/net/netfilter/xt_NFLOG.c b/net/netfilter/xt_NFLOG.c index 83af124e88cd..866facfa4f43 100644 --- a/net/netfilter/xt_NFLOG.c +++ b/net/netfilter/xt_NFLOG.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/netfilter/x_tables.h> | 13 | #include <linux/netfilter/x_tables.h> |
14 | #include <linux/netfilter/xt_NFLOG.h> | 14 | #include <linux/netfilter/xt_NFLOG.h> |
15 | #include <net/netfilter/nf_log.h> | ||
15 | 16 | ||
16 | MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); | 17 | MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); |
17 | MODULE_DESCRIPTION("x_tables NFLOG target"); | 18 | MODULE_DESCRIPTION("x_tables NFLOG target"); |