bab78934557667c75ef652eddc657f1f7369d327
[platform/upstream/libnetfilter_queue.git] / 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 #include "libnfqnetlink.h"
16
17
18 #define NFQN
19 struct nfqnl_handle
20 {
21         struct nfnl_handle nfnlh;
22 };
23
24 struct ctnl_msg_handler {
25         int type;
26         int (*handler)(struct sockaddr_nl *, struct nlmsghdr *, void *arg);
27 };
28
29 struct ctnl_handle {
30         struct nfnl_handle nfnlh;
31         struct ctnl_msg_handler *handler[NFQNL_MSG_MAX];
32 };
33
34 extern int nfqnl_open(struct nfqnl_handle *, unsigned int );
35 extern int nfqnl_close(struct nfqnl_handle *h);
36
37 extern int nfqnl_bind_pf(const struct nfqnl_handle *h, u_int16_t pf);
38 extern int nfqnl_unbind_pf(const struct nfqnl_handle *h, u_int16_t pf);
39
40 extern int nfqnl_bind(const struct nfqnl_handle *h, u_int16_t num);
41 extern int nfqnl_unbind(const struct nfqnl_handle *h, u_int16_t num);
42
43 extern int nfqnl_set_mode(const struct nfqnl_handle *h, u_int16_t num,
44                           u_int8_t mode, unsigned int len);
45
46 extern int nfqnl_set_verdict(const struct nfqnl_handle *h,
47                              u_int32_t id,
48                              u_int32_t verdict,
49                              u_int32_t mark,
50                              u_int32_t data_len,
51                              unsigned char *buf);
52
53 #endif  /* __LIBNFQNETLINK_H */