Merge HEAD from ../linux-2.6
[linux-2.6] / include / linux / netfilter / nfnetlink_queue.h
1 #ifndef _NFNETLINK_QUEUE_H
2 #define _NFNETLINK_QUEUE_H
3
4 #include <linux/types.h>
5 #include <linux/netfilter/nfnetlink.h>
6
7 enum nfqnl_msg_types {
8         NFQNL_MSG_PACKET,               /* packet from kernel to userspace */
9         NFQNL_MSG_VERDICT,              /* verdict from userspace to kernel */
10         NFQNL_MSG_CONFIG,               /* connect to a particular queue */
11
12         NFQNL_MSG_MAX
13 };
14
15 struct nfqnl_msg_packet_hdr {
16         u_int32_t       packet_id;      /* unique ID of packet in queue */
17         u_int16_t       hw_protocol;    /* hw protocol (network order) */
18         u_int8_t        hook;           /* netfilter hook */
19 } __attribute__ ((packed));
20
21 struct nfqnl_msg_packet_hw {
22         u_int16_t       hw_addrlen;
23         u_int16_t       _pad;
24         u_int8_t        hw_addr[8];
25 } __attribute__ ((packed));
26
27 struct nfqnl_msg_packet_timestamp {
28         aligned_u64     sec;
29         aligned_u64     usec;
30 } __attribute__ ((packed));
31
32 enum nfqnl_attr_type {
33         NFQA_UNSPEC,
34         NFQA_PACKET_HDR,
35         NFQA_VERDICT_HDR,               /* nfqnl_msg_verdict_hrd */
36         NFQA_MARK,                      /* u_int32_t nfmark */
37         NFQA_TIMESTAMP,                 /* nfqnl_msg_packet_timestamp */
38         NFQA_IFINDEX_INDEV,             /* u_int32_t ifindex */
39         NFQA_IFINDEX_OUTDEV,            /* u_int32_t ifindex */
40         NFQA_IFINDEX_PHYSINDEV,         /* u_int32_t ifindex */
41         NFQA_IFINDEX_PHYSOUTDEV,        /* u_int32_t ifindex */
42         NFQA_HWADDR,                    /* nfqnl_msg_packet_hw */
43         NFQA_PAYLOAD,                   /* opaque data payload */
44
45         __NFQA_MAX
46 };
47 #define NFQA_MAX (__NFQA_MAX - 1)
48
49 struct nfqnl_msg_verdict_hdr {
50         u_int32_t verdict;
51         u_int32_t id;
52 } __attribute__ ((packed));
53
54
55 enum nfqnl_msg_config_cmds {
56         NFQNL_CFG_CMD_NONE,
57         NFQNL_CFG_CMD_BIND,
58         NFQNL_CFG_CMD_UNBIND,
59         NFQNL_CFG_CMD_PF_BIND,
60         NFQNL_CFG_CMD_PF_UNBIND,
61 };
62
63 struct nfqnl_msg_config_cmd {
64         u_int8_t        command;        /* nfqnl_msg_config_cmds */
65         u_int8_t        _pad;
66         u_int16_t       pf;             /* AF_xxx for PF_[UN]BIND */
67 } __attribute__ ((packed));
68
69 enum nfqnl_config_mode {
70         NFQNL_COPY_NONE,
71         NFQNL_COPY_META,
72         NFQNL_COPY_PACKET,
73 };
74
75 struct nfqnl_msg_config_params {
76         u_int32_t       copy_range;
77         u_int8_t        copy_mode;      /* enum nfqnl_config_mode */
78 } __attribute__ ((packed));
79
80
81 enum nfqnl_attr_config {
82         NFQA_CFG_UNSPEC,
83         NFQA_CFG_CMD,                   /* nfqnl_msg_config_cmd */
84         NFQA_CFG_PARAMS,                /* nfqnl_msg_config_params */
85         __NFQA_CFG_MAX
86 };
87 #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
88
89 #endif /* _NFNETLINK_QUEUE_H */