directory restructuring
[platform/upstream/libnetfilter_queue.git] / include / libnfnetlink_queue / libnfnetlink_queue.h
1 /* libnfqnetlink.h: Header file for the Netfilter Queue library.
2  *
3  * (C) 2005 by Harald Welte <laforge@gnumonks.org>
4  *
5  * This software may be used and distributed according to the terms
6  * of the GNU General Public License, incorporated herein by reference.
7  */
8
9 #ifndef __LIBCTNETLINK_H
10 #define __LIBCTNETLINK_H
11
12 #include <linux/netfilter/nfnetlink.h>
13 #include <linux/netfilter/nfnetlink_queue.h>
14 #include <libnfnetlink.h>
15
16
17 #define NFQN
18 struct nfqnl_handle
19 {
20         struct nfnl_handle nfnlh;
21 };
22
23 struct nfqnl_q_handle
24 {
25         struct nfqnl_handle *h;
26         u_int16_t id;
27 };
28
29 struct ctnl_msg_handler {
30         int type;
31         int (*handler)(struct sockaddr_nl *, struct nlmsghdr *, void *arg);
32 };
33
34 struct ctnl_handle {
35         struct nfnl_handle nfnlh;
36         struct ctnl_msg_handler *handler[NFQNL_MSG_MAX];
37 };
38
39 extern int nfqnl_open(struct nfqnl_handle *h);
40 extern int nfqnl_close(struct nfqnl_handle *h);
41
42 extern int nfqnl_bind_pf(struct nfqnl_handle *h, u_int16_t pf);
43 extern int nfqnl_unbind_pf(struct nfqnl_handle *h, u_int16_t pf);
44
45 extern int nfqnl_create_queue(struct nfqnl_handle *h,
46                               struct nfqnl_q_handle *qh, u_int16_t num);
47 extern int nfqnl_destroy_queue(struct nfqnl_q_handle *qh);
48
49 extern int nfqnl_set_mode(struct nfqnl_q_handle *qh,
50                           u_int8_t mode, unsigned int len);
51
52 extern int nfqnl_set_verdict(struct nfqnl_q_handle *qh,
53                              u_int32_t id,
54                              u_int32_t verdict,
55                              u_int32_t data_len,
56                              unsigned char *buf);
57
58 extern int nfqnl_set_verdict_mark(struct nfqnl_q_handle *qh, u_int32_t id,
59                            u_int32_t verdict, u_int32_t mark,
60                            u_int32_t datalen, unsigned char *buf);
61 #endif  /* __LIBNFQNETLINK_H */