11 #include <netlink/netlink.h>
12 #include <netlink/addr.h>
13 #include <netlink/cache.h>
14 #include <netlink/msg.h>
15 #include <netlink/attr.h>
28 extern struct nl_object_ops ct_obj_ops;
30 extern struct nfnl_ct * nfnl_ct_alloc(
void);
33 extern int nfnlmsg_ct_group(
struct nlmsghdr *);
34 extern int nfnlmsg_ct_parse(
struct nlmsghdr *,
struct nfnl_ct **);
35 extern int nfnlmsg_ct_parse_nested(
struct nlattr *,
struct nfnl_ct **);
37 extern void nfnl_ct_get(
struct nfnl_ct *);
38 extern void nfnl_ct_put(
struct nfnl_ct *);
42 extern int nfnl_ct_build_add_request(
const struct nfnl_ct *,
int,
44 extern int nfnl_ct_add(
struct nl_sock *,
const struct nfnl_ct *,
int);
46 extern int nfnl_ct_build_delete_request(
const struct nfnl_ct *,
int,
48 extern int nfnl_ct_del(
struct nl_sock *,
const struct nfnl_ct *,
int);
50 extern int nfnl_ct_build_query_request(
const struct nfnl_ct *,
int,
52 extern int nfnl_ct_query(
struct nl_sock *,
const struct nfnl_ct *,
int);
54 extern void nfnl_ct_set_family(
struct nfnl_ct *, uint8_t);
55 extern uint8_t nfnl_ct_get_family(
const struct nfnl_ct *);
57 extern void nfnl_ct_set_proto(
struct nfnl_ct *, uint8_t);
58 extern int nfnl_ct_test_proto(
const struct nfnl_ct *);
59 extern uint8_t nfnl_ct_get_proto(
const struct nfnl_ct *);
61 extern void nfnl_ct_set_tcp_state(
struct nfnl_ct *, uint8_t);
62 extern int nfnl_ct_test_tcp_state(
const struct nfnl_ct *);
63 extern uint8_t nfnl_ct_get_tcp_state(
const struct nfnl_ct *);
64 extern char * nfnl_ct_tcp_state2str(uint8_t,
char *,
size_t);
65 extern int nfnl_ct_str2tcp_state(
const char *name);
67 extern void nfnl_ct_set_status(
struct nfnl_ct *, uint32_t);
68 extern void nfnl_ct_unset_status(
struct nfnl_ct *, uint32_t);
69 extern int nfnl_ct_test_status(
const struct nfnl_ct *ct);
70 extern uint32_t nfnl_ct_get_status(
const struct nfnl_ct *);
71 extern char * nfnl_ct_status2str(
int,
char *,
size_t);
72 extern int nfnl_ct_str2status(
const char *);
74 extern void nfnl_ct_set_timeout(
struct nfnl_ct *, uint32_t);
75 extern int nfnl_ct_test_timeout(
const struct nfnl_ct *);
76 extern uint32_t nfnl_ct_get_timeout(
const struct nfnl_ct *);
78 extern void nfnl_ct_set_mark(
struct nfnl_ct *, uint32_t);
79 extern int nfnl_ct_test_mark(
const struct nfnl_ct *);
80 extern uint32_t nfnl_ct_get_mark(
const struct nfnl_ct *);
82 extern void nfnl_ct_set_use(
struct nfnl_ct *, uint32_t);
83 extern int nfnl_ct_test_use(
const struct nfnl_ct *);
84 extern uint32_t nfnl_ct_get_use(
const struct nfnl_ct *);
86 extern void nfnl_ct_set_id(
struct nfnl_ct *, uint32_t);
87 extern int nfnl_ct_test_id(
const struct nfnl_ct *);
88 extern uint32_t nfnl_ct_get_id(
const struct nfnl_ct *);
90 extern void nfnl_ct_set_zone(
struct nfnl_ct *, uint16_t);
91 extern int nfnl_ct_test_zone(
const struct nfnl_ct *);
92 extern uint16_t nfnl_ct_get_zone(
const struct nfnl_ct *);
94 extern int nfnl_ct_set_src(
struct nfnl_ct *,
int,
struct nl_addr *);
95 extern struct nl_addr * nfnl_ct_get_src(
const struct nfnl_ct *,
int);
97 extern int nfnl_ct_set_dst(
struct nfnl_ct *,
int,
struct nl_addr *);
98 extern struct nl_addr * nfnl_ct_get_dst(
const struct nfnl_ct *,
int);
100 extern void nfnl_ct_set_src_port(
struct nfnl_ct *,
int, uint16_t);
101 extern int nfnl_ct_test_src_port(
const struct nfnl_ct *,
int);
102 extern uint16_t nfnl_ct_get_src_port(
const struct nfnl_ct *,
int);
104 extern void nfnl_ct_set_dst_port(
struct nfnl_ct *,
int, uint16_t);
105 extern int nfnl_ct_test_dst_port(
const struct nfnl_ct *,
int);
106 extern uint16_t nfnl_ct_get_dst_port(
const struct nfnl_ct *,
int);
108 extern void nfnl_ct_set_icmp_id(
struct nfnl_ct *,
int, uint16_t);
109 extern int nfnl_ct_test_icmp_id(
const struct nfnl_ct *,
int);
110 extern uint16_t nfnl_ct_get_icmp_id(
const struct nfnl_ct *,
int);
112 extern void nfnl_ct_set_icmp_type(
struct nfnl_ct *,
int, uint8_t);
113 extern int nfnl_ct_test_icmp_type(
const struct nfnl_ct *,
int);
114 extern uint8_t nfnl_ct_get_icmp_type(
const struct nfnl_ct *,
int);
116 extern void nfnl_ct_set_icmp_code(
struct nfnl_ct *,
int, uint8_t);
117 extern int nfnl_ct_test_icmp_code(
const struct nfnl_ct *,
int);
118 extern uint8_t nfnl_ct_get_icmp_code(
const struct nfnl_ct *,
int);
120 extern void nfnl_ct_set_packets(
struct nfnl_ct *,
int, uint64_t);
121 extern int nfnl_ct_test_packets(
const struct nfnl_ct *,
int);
122 extern uint64_t nfnl_ct_get_packets(
const struct nfnl_ct *,
int);
124 extern void nfnl_ct_set_bytes(
struct nfnl_ct *,
int, uint64_t);
125 extern int nfnl_ct_test_bytes(
const struct nfnl_ct *,
int);
126 extern uint64_t nfnl_ct_get_bytes(
const struct nfnl_ct *,
int);
128 extern void nfnl_ct_set_timestamp(
struct nfnl_ct *, uint64_t, uint64_t);
129 extern int nfnl_ct_test_timestamp(
const struct nfnl_ct *);
130 extern const struct nfnl_ct_timestamp *nfnl_ct_get_timestamp(
const struct nfnl_ct *);
int nfnl_ct_alloc_cache(struct nl_sock *, struct nl_cache **)
Build a conntrack cache holding all conntrack currently in the kernel.
int nfnl_ct_dump_request(struct nl_sock *)
Send nfnl ct dump request.