17 #include <netlink/netlink.h>
18 #include <netlink/addr.h>
19 #include <netlink/cache.h>
20 #include <netlink/msg.h>
33 extern struct nl_object_ops ct_obj_ops;
35 extern struct nfnl_ct * nfnl_ct_alloc(
void);
38 extern int nfnlmsg_ct_group(
struct nlmsghdr *);
39 extern int nfnlmsg_ct_parse(
struct nlmsghdr *,
struct nfnl_ct **);
41 extern void nfnl_ct_get(
struct nfnl_ct *);
42 extern void nfnl_ct_put(
struct nfnl_ct *);
44 extern int nfnl_ct_dump_request(
struct nl_sock *);
46 extern int nfnl_ct_build_add_request(
const struct nfnl_ct *,
int,
48 extern int nfnl_ct_add(
struct nl_sock *,
const struct nfnl_ct *,
int);
50 extern int nfnl_ct_build_delete_request(
const struct nfnl_ct *,
int,
52 extern int nfnl_ct_del(
struct nl_sock *,
const struct nfnl_ct *,
int);
54 extern int nfnl_ct_build_query_request(
const struct nfnl_ct *,
int,
56 extern int nfnl_ct_query(
struct nl_sock *,
const struct nfnl_ct *,
int);
58 extern void nfnl_ct_set_family(
struct nfnl_ct *, uint8_t);
59 extern uint8_t nfnl_ct_get_family(
const struct nfnl_ct *);
61 extern void nfnl_ct_set_proto(
struct nfnl_ct *, uint8_t);
62 extern int nfnl_ct_test_proto(
const struct nfnl_ct *);
63 extern uint8_t nfnl_ct_get_proto(
const struct nfnl_ct *);
65 extern void nfnl_ct_set_tcp_state(
struct nfnl_ct *, uint8_t);
66 extern int nfnl_ct_test_tcp_state(
const struct nfnl_ct *);
67 extern uint8_t nfnl_ct_get_tcp_state(
const struct nfnl_ct *);
68 extern char * nfnl_ct_tcp_state2str(uint8_t,
char *,
size_t);
69 extern int nfnl_ct_str2tcp_state(
const char *name);
71 extern void nfnl_ct_set_status(
struct nfnl_ct *, uint32_t);
72 extern void nfnl_ct_unset_status(
struct nfnl_ct *, uint32_t);
73 extern uint32_t nfnl_ct_get_status(
const struct nfnl_ct *);
74 extern char * nfnl_ct_status2str(
int,
char *,
size_t);
75 extern int nfnl_ct_str2status(
const char *);
77 extern void nfnl_ct_set_timeout(
struct nfnl_ct *, uint32_t);
78 extern int nfnl_ct_test_timeout(
const struct nfnl_ct *);
79 extern uint32_t nfnl_ct_get_timeout(
const struct nfnl_ct *);
81 extern void nfnl_ct_set_mark(
struct nfnl_ct *, uint32_t);
82 extern int nfnl_ct_test_mark(
const struct nfnl_ct *);
83 extern uint32_t nfnl_ct_get_mark(
const struct nfnl_ct *);
85 extern void nfnl_ct_set_use(
struct nfnl_ct *, uint32_t);
86 extern int nfnl_ct_test_use(
const struct nfnl_ct *);
87 extern uint32_t nfnl_ct_get_use(
const struct nfnl_ct *);
89 extern void nfnl_ct_set_id(
struct nfnl_ct *, uint32_t);
90 extern int nfnl_ct_test_id(
const struct nfnl_ct *);
91 extern uint32_t nfnl_ct_get_id(
const struct nfnl_ct *);
93 extern void nfnl_ct_set_zone(
struct nfnl_ct *, uint16_t);
94 extern int nfnl_ct_test_zone(
const struct nfnl_ct *);
95 extern uint16_t nfnl_ct_get_zone(
const struct nfnl_ct *);
97 extern int nfnl_ct_set_src(
struct nfnl_ct *,
int,
struct nl_addr *);
98 extern struct nl_addr * nfnl_ct_get_src(
const struct nfnl_ct *,
int);
100 extern int nfnl_ct_set_dst(
struct nfnl_ct *,
int,
struct nl_addr *);
101 extern struct nl_addr * nfnl_ct_get_dst(
const struct nfnl_ct *,
int);
103 extern void nfnl_ct_set_src_port(
struct nfnl_ct *,
int, uint16_t);
104 extern int nfnl_ct_test_src_port(
const struct nfnl_ct *,
int);
105 extern uint16_t nfnl_ct_get_src_port(
const struct nfnl_ct *,
int);
107 extern void nfnl_ct_set_dst_port(
struct nfnl_ct *,
int, uint16_t);
108 extern int nfnl_ct_test_dst_port(
const struct nfnl_ct *,
int);
109 extern uint16_t nfnl_ct_get_dst_port(
const struct nfnl_ct *,
int);
111 extern void nfnl_ct_set_icmp_id(
struct nfnl_ct *,
int, uint16_t);
112 extern int nfnl_ct_test_icmp_id(
const struct nfnl_ct *,
int);
113 extern uint16_t nfnl_ct_get_icmp_id(
const struct nfnl_ct *,
int);
115 extern void nfnl_ct_set_icmp_type(
struct nfnl_ct *,
int, uint8_t);
116 extern int nfnl_ct_test_icmp_type(
const struct nfnl_ct *,
int);
117 extern uint8_t nfnl_ct_get_icmp_type(
const struct nfnl_ct *,
int);
119 extern void nfnl_ct_set_icmp_code(
struct nfnl_ct *,
int, uint8_t);
120 extern int nfnl_ct_test_icmp_code(
const struct nfnl_ct *,
int);
121 extern uint8_t nfnl_ct_get_icmp_code(
const struct nfnl_ct *,
int);
123 extern void nfnl_ct_set_packets(
struct nfnl_ct *,
int, uint64_t);
124 extern int nfnl_ct_test_packets(
const struct nfnl_ct *,
int);
125 extern uint64_t nfnl_ct_get_packets(
const struct nfnl_ct *,
int);
127 extern void nfnl_ct_set_bytes(
struct nfnl_ct *,
int, uint64_t);
128 extern int nfnl_ct_test_bytes(
const struct nfnl_ct *,
int);
129 extern uint64_t nfnl_ct_get_bytes(
const struct nfnl_ct *,
int);
131 extern void nfnl_ct_set_timestamp(
struct nfnl_ct *, uint64_t, uint64_t);
132 extern int nfnl_ct_test_timestamp(
const struct nfnl_ct *);
133 extern const struct nfnl_ct_timestamp *nfnl_ct_get_timestamp(
const struct nfnl_ct *);