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