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 /include/net | |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_log.h | 59 |
1 files changed, 59 insertions, 0 deletions
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 */ | ||