aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-12-18 01:38:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:58:58 -0500
commitf01ffbd6e7d001ccf9168b33507958a51ce0ffcf (patch)
treea5e6fae2808f371642566f3d5e75227e94b2d863 /include
parentcc01dcbd26865addfe9eb5431f1f9dbc511515ba (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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter.h55
-rw-r--r--include/net/netfilter/nf_log.h59
2 files changed, 59 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
125extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 125extern 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
139struct 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
154typedef 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
162struct nf_logger {
163 struct module *me;
164 nf_logfn *logfn;
165 char *name;
166};
167
168/* Function to register/unregister log function. */
169int nf_log_register(int pf, struct nf_logger *logger);
170void nf_log_unregister(struct nf_logger *logger);
171void nf_log_unregister_pf(int pf);
172
173/* Calls the registered backend logging function */
174void 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
182int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, 127int 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
16struct 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
31typedef 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
39struct nf_logger {
40 struct module *me;
41 nf_logfn *logfn;
42 char *name;
43};
44
45/* Function to register/unregister log function. */
46int nf_log_register(int pf, struct nf_logger *logger);
47void nf_log_unregister(struct nf_logger *logger);
48void nf_log_unregister_pf(int pf);
49
50/* Calls the registered backend logging function */
51void 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 */