aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2005-08-09 22:58:39 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:38:12 -0400
commit0597f2680d666a3bcf101ac0c771ba7e50016bbd (patch)
treece43bf3284ce162ccb34d4ee5a9981089df5bce0 /include/linux
parent608c8e4f7b6e61cc783283e9dff8a465a5ad59bb (diff)
[NETFILTER]: Add new "nfnetlink_log" userspace packet logging facility
This is a generic (layer3 independent) version of what ipt_ULOG is already doing for IPv4 today. ipt_ULOG, ebt_ulog and finally also ip[6]t_LOG will be deprecated by this mechanism in the long term. Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netfilter/nfnetlink_log.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
new file mode 100644
index 000000000000..420ff4625cbf
--- /dev/null
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -0,0 +1,85 @@
1#ifndef _NFNETLINK_LOG_H
2#define _NFNETLINK_LOG_H
3
4/* This file describes the netlink messages (i.e. 'protocol packets'),
5 * and not any kind of function definitions. It is shared between kernel and
6 * userspace. Don't put kernel specific stuff in here */
7
8#include <linux/netfilter/nfnetlink.h>
9
10enum nfulnl_msg_types {
11 NFULNL_MSG_PACKET, /* packet from kernel to userspace */
12 NFULNL_MSG_CONFIG, /* connect to a particular queue */
13
14 NFULNL_MSG_MAX
15};
16
17struct nfulnl_msg_packet_hdr {
18 u_int16_t hw_protocol; /* hw protocol (network order) */
19 u_int8_t hook; /* netfilter hook */
20 u_int8_t _pad;
21} __attribute__ ((packed));
22
23struct nfulnl_msg_packet_hw {
24 u_int16_t hw_addrlen;
25 u_int16_t _pad;
26 u_int8_t hw_addr[8];
27} __attribute__ ((packed));
28
29struct nfulnl_msg_packet_timestamp {
30 u_int64_t sec;
31 u_int64_t usec;
32} __attribute__ ((packed));
33
34#define NFULNL_PREFIXLEN 30 /* just like old log target */
35
36enum nfulnl_attr_type {
37 NFULA_UNSPEC,
38 NFULA_PACKET_HDR,
39 NFULA_MARK, /* u_int32_t nfmark */
40 NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */
41 NFULA_IFINDEX_INDEV, /* u_int32_t ifindex */
42 NFULA_IFINDEX_OUTDEV, /* u_int32_t ifindex */
43 NFULA_HWADDR, /* nfulnl_msg_packet_hw */
44 NFULA_PAYLOAD, /* opaque data payload */
45 NFULA_PREFIX, /* string prefix */
46 NFULA_UID, /* user id of socket */
47
48 __NFULA_MAX
49};
50#define NFULA_MAX (__NFULA_MAX - 1)
51
52enum nfulnl_msg_config_cmds {
53 NFULNL_CFG_CMD_NONE,
54 NFULNL_CFG_CMD_BIND,
55 NFULNL_CFG_CMD_UNBIND,
56 NFULNL_CFG_CMD_PF_BIND,
57 NFULNL_CFG_CMD_PF_UNBIND,
58};
59
60struct nfulnl_msg_config_cmd {
61 u_int8_t command; /* nfulnl_msg_config_cmds */
62} __attribute__ ((packed));
63
64struct nfulnl_msg_config_mode {
65 u_int32_t copy_range;
66 u_int8_t copy_mode;
67 u_int8_t _pad;
68} __attribute__ ((packed));
69
70enum nfulnl_attr_config {
71 NFULA_CFG_UNSPEC,
72 NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */
73 NFULA_CFG_MODE, /* nfulnl_msg_config_mode */
74 NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */
75 NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */
76 NFULA_CFG_QTHRESH, /* u_int32_t */
77 __NFULA_CFG_MAX
78};
79#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
80
81#define NFULNL_COPY_NONE 0x00
82#define NFULNL_COPY_META 0x01
83#define NFULNL_COPY_PACKET 0x02
84
85#endif /* _NFNETLINK_LOG_H */