10 #define NETLINK_EXP_H_
12 #include <netlink/netlink.h>
13 #include <netlink/addr.h>
14 #include <netlink/cache.h>
15 #include <netlink/msg.h>
17 #include <linux/version.h>
25 enum nfnl_exp_tuples {
26 NFNL_EXP_TUPLE_EXPECT,
27 NFNL_EXP_TUPLE_MASTER,
33 extern struct nl_object_ops exp_obj_ops;
35 extern struct nfnl_exp * nfnl_exp_alloc(
void);
38 extern int nfnlmsg_exp_group(
struct nlmsghdr *);
39 extern int nfnlmsg_exp_parse(
struct nlmsghdr *,
struct nfnl_exp **);
41 extern void nfnl_exp_get(
struct nfnl_exp *);
42 extern void nfnl_exp_put(
struct nfnl_exp *);
46 extern int nfnl_exp_build_add_request(
const struct nfnl_exp *,
int,
48 extern int nfnl_exp_add(
struct nl_sock *,
const struct nfnl_exp *,
int);
50 extern int nfnl_exp_build_delete_request(
const struct nfnl_exp *,
int,
52 extern int nfnl_exp_del(
struct nl_sock *,
const struct nfnl_exp *,
int);
54 extern int nfnl_exp_build_query_request(
const struct nfnl_exp *,
int,
56 extern int nfnl_exp_query(
struct nl_sock *,
const struct nfnl_exp *,
int);
58 extern void nfnl_exp_set_family(
struct nfnl_exp *, uint8_t);
59 extern uint8_t nfnl_exp_get_family(
const struct nfnl_exp *);
61 extern void nfnl_exp_set_timeout(
struct nfnl_exp *, uint32_t);
62 extern int nfnl_exp_test_timeout(
const struct nfnl_exp *);
63 extern uint32_t nfnl_exp_get_timeout(
const struct nfnl_exp *);
65 extern void nfnl_exp_set_id(
struct nfnl_exp *, uint32_t);
66 extern int nfnl_exp_test_id(
const struct nfnl_exp *);
67 extern uint32_t nfnl_exp_get_id(
const struct nfnl_exp *);
69 extern int nfnl_exp_set_helper_name(
struct nfnl_exp *,
void *);
70 extern int nfnl_exp_test_helper_name(
const struct nfnl_exp *);
71 extern const char * nfnl_exp_get_helper_name(
const struct nfnl_exp *);
73 extern void nfnl_exp_set_zone(
struct nfnl_exp *, uint16_t);
74 extern int nfnl_exp_test_zone(
const struct nfnl_exp *);
75 extern uint16_t nfnl_exp_get_zone(
const struct nfnl_exp *);
77 extern void nfnl_exp_set_flags(
struct nfnl_exp *, uint32_t);
78 extern int nfnl_exp_test_flags(
const struct nfnl_exp *);
79 extern void nfnl_exp_unset_flags(
struct nfnl_exp *exp, uint32_t flags);
80 extern uint32_t nfnl_exp_get_flags(
const struct nfnl_exp *);
81 extern char * nfnl_exp_flags2str(
int flags,
char *buf,
size_t len);
82 int nfnl_exp_str2flags(
const char *name);
84 extern void nfnl_exp_set_class(
struct nfnl_exp *, uint32_t);
85 extern int nfnl_exp_test_class(
const struct nfnl_exp *);
86 extern uint32_t nfnl_exp_get_class(
const struct nfnl_exp *);
88 extern int nfnl_exp_set_fn(
struct nfnl_exp *,
void *);
89 extern int nfnl_exp_test_fn(
const struct nfnl_exp *);
90 extern const char * nfnl_exp_get_fn(
const struct nfnl_exp *);
92 extern void nfnl_exp_set_nat_dir(
struct nfnl_exp *, uint8_t);
93 extern int nfnl_exp_test_nat_dir(
const struct nfnl_exp *);
94 extern uint8_t nfnl_exp_get_nat_dir(
const struct nfnl_exp *);
99 extern int nfnl_exp_set_src(
struct nfnl_exp *,
int,
struct nl_addr *);
100 extern int nfnl_exp_test_src(
const struct nfnl_exp *,
int);
101 extern struct nl_addr * nfnl_exp_get_src(
const struct nfnl_exp *,
int);
103 extern int nfnl_exp_set_dst(
struct nfnl_exp *,
int,
struct nl_addr *);
104 extern int nfnl_exp_test_dst(
const struct nfnl_exp *,
int);
105 extern struct nl_addr * nfnl_exp_get_dst(
const struct nfnl_exp *,
int);
107 extern void nfnl_exp_set_l4protonum(
struct nfnl_exp *,
int, uint8_t);
108 extern int nfnl_exp_test_l4protonum(
const struct nfnl_exp *,
int);
109 extern uint8_t nfnl_exp_get_l4protonum(
const struct nfnl_exp *,
int);
111 extern void nfnl_exp_set_ports(
struct nfnl_exp *,
int, uint16_t, uint16_t);
112 extern int nfnl_exp_test_ports(
const struct nfnl_exp *,
int);
113 extern uint16_t nfnl_exp_get_src_port(
const struct nfnl_exp *,
int);
114 extern uint16_t nfnl_exp_get_dst_port(
const struct nfnl_exp *,
int);
116 extern void nfnl_exp_set_icmp(
struct nfnl_exp *,
int, uint16_t, uint8_t, uint8_t);
117 extern int nfnl_exp_test_icmp(
const struct nfnl_exp *,
int);
118 extern uint16_t nfnl_exp_get_icmp_id(
const struct nfnl_exp *,
int);
119 extern uint8_t nfnl_exp_get_icmp_type(
const struct nfnl_exp *,
int);
120 extern uint8_t nfnl_exp_get_icmp_code(
const struct nfnl_exp *,
int);
int nfnl_exp_alloc_cache(struct nl_sock *, struct nl_cache **)
Build a expectation cache holding all expectations currently in the kernel.
int nfnl_exp_dump_request(struct nl_sock *)
Send nfnl exp dump request.