17 #include <netlink/netlink.h>
18 #include <netlink/addr.h>
19 #include <netlink/cache.h>
20 #include <netlink/msg.h>
31 extern struct nfnl_ct * nfnl_ct_alloc(
void);
34 extern int nfnlmsg_ct_group(
struct nlmsghdr *);
35 extern struct nfnl_ct * nfnlmsg_ct_parse(
struct nlmsghdr *);
37 extern void nfnl_ct_get(
struct nfnl_ct *);
38 extern void nfnl_ct_put(
struct nfnl_ct *);
40 extern int nfnl_ct_dump_request(
struct nl_handle *);
42 extern void nfnl_ct_set_family(
struct nfnl_ct *, uint8_t);
43 extern uint8_t nfnl_ct_get_family(
const struct nfnl_ct *);
45 extern void nfnl_ct_set_proto(
struct nfnl_ct *, uint8_t);
46 extern int nfnl_ct_test_proto(
const struct nfnl_ct *);
47 extern uint8_t nfnl_ct_get_proto(
const struct nfnl_ct *);
49 extern void nfnl_ct_set_tcp_state(
struct nfnl_ct *, uint8_t);
50 extern int nfnl_ct_test_tcp_state(
const struct nfnl_ct *);
51 extern uint8_t nfnl_ct_get_tcp_state(
const struct nfnl_ct *);
52 extern char * nfnl_ct_tcp_state2str(uint8_t,
char *,
size_t);
53 extern int nfnl_ct_str2tcp_state(
const char *name);
55 extern void nfnl_ct_set_status(
struct nfnl_ct *, uint32_t);
56 extern void nfnl_ct_unset_status(
struct nfnl_ct *, uint32_t);
57 extern uint32_t nfnl_ct_get_status(
const struct nfnl_ct *);
59 extern void nfnl_ct_set_timeout(
struct nfnl_ct *, uint32_t);
60 extern int nfnl_ct_test_timeout(
const struct nfnl_ct *);
61 extern uint32_t nfnl_ct_get_timeout(
const struct nfnl_ct *);
63 extern void nfnl_ct_set_mark(
struct nfnl_ct *, uint32_t);
64 extern int nfnl_ct_test_mark(
const struct nfnl_ct *);
65 extern uint32_t nfnl_ct_get_mark(
const struct nfnl_ct *);
67 extern void nfnl_ct_set_use(
struct nfnl_ct *, uint32_t);
68 extern int nfnl_ct_test_use(
const struct nfnl_ct *);
69 extern uint32_t nfnl_ct_get_use(
const struct nfnl_ct *);
71 extern void nfnl_ct_set_id(
struct nfnl_ct *, uint32_t);
72 extern int nfnl_ct_test_id(
const struct nfnl_ct *);
73 extern uint32_t nfnl_ct_get_id(
const struct nfnl_ct *);
75 extern int nfnl_ct_set_src(
struct nfnl_ct *,
int,
77 extern struct nl_addr * nfnl_ct_get_src(
const struct nfnl_ct *,
int);
79 extern int nfnl_ct_set_dst(
struct nfnl_ct *,
int,
81 extern struct nl_addr * nfnl_ct_get_dst(
const struct nfnl_ct *,
int);
83 extern void nfnl_ct_set_src_port(
struct nfnl_ct *,
int, uint16_t);
84 extern int nfnl_ct_test_src_port(
const struct nfnl_ct *,
int);
85 extern uint16_t nfnl_ct_get_src_port(
const struct nfnl_ct *,
int);
87 extern void nfnl_ct_set_dst_port(
struct nfnl_ct *,
int, uint16_t);
88 extern int nfnl_ct_test_dst_port(
const struct nfnl_ct *,
int);
89 extern uint16_t nfnl_ct_get_dst_port(
const struct nfnl_ct *,
int);
91 extern void nfnl_ct_set_icmp_id(
struct nfnl_ct *,
int, uint16_t);
92 extern int nfnl_ct_test_icmp_id(
const struct nfnl_ct *,
int);
93 extern uint16_t nfnl_ct_get_icmp_id(
const struct nfnl_ct *,
int);
95 extern void nfnl_ct_set_icmp_type(
struct nfnl_ct *,
int, uint8_t);
96 extern int nfnl_ct_test_icmp_type(
const struct nfnl_ct *,
int);
97 extern uint8_t nfnl_ct_get_icmp_type(
const struct nfnl_ct *,
int);
99 extern void nfnl_ct_set_icmp_code(
struct nfnl_ct *,
int, uint8_t);
100 extern int nfnl_ct_test_icmp_code(
const struct nfnl_ct *,
int);
101 extern uint8_t nfnl_ct_get_icmp_code(
const struct nfnl_ct *,
int);
103 extern void nfnl_ct_set_packets(
struct nfnl_ct *,
int, uint64_t);
104 extern int nfnl_ct_test_packets(
const struct nfnl_ct *,
int);
105 extern uint64_t nfnl_ct_get_packets(
const struct nfnl_ct *,
int);
107 extern void nfnl_ct_set_bytes(
struct nfnl_ct *,
int, uint64_t);
108 extern int nfnl_ct_test_bytes(
const struct nfnl_ct *,
int);
109 extern uint64_t nfnl_ct_get_bytes(
const struct nfnl_ct *,
int);
struct nl_cache * nfnl_ct_alloc_cache(struct nl_handle *handle)
Build a conntrack cache holding all conntrack currently in the kernel.