7 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
8 #include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
10 static int cb(
enum nf_conntrack_msg_type type,
11 struct nf_conntrack *ct,
16 nfct_snprintf(buf,
sizeof(buf), ct, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, NFCT_OF_SHOW_LAYER3);
19 return NFCT_CB_CONTINUE;
25 struct nfct_handle *h;
26 struct nf_conntrack *ct;
53 printf(
"TEST: get conntrack ");
55 printf(
"(%d)(%s)\n", ret, strerror(errno));
63 ret == -1 ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS);
void nfct_set_attr_u32(struct nf_conntrack *ct, const enum nf_conntrack_attr type, uint32_t value)
int nfct_query(struct nfct_handle *h, const enum nf_conntrack_query query, const void *data)
int nfct_close(struct nfct_handle *cth)
void nfct_destroy(struct nf_conntrack *ct)
int nfct_snprintf(char *buf, unsigned int size, const struct nf_conntrack *ct, const unsigned int msg_type, const unsigned int out_type, const unsigned int out_flags)
int nfct_callback_register(struct nfct_handle *h, enum nf_conntrack_msg_type type, int(*cb)(enum nf_conntrack_msg_type type, struct nf_conntrack *ct, void *data), void *data)
void nfct_set_attr_u16(struct nf_conntrack *ct, const enum nf_conntrack_attr type, uint16_t value)
struct nf_conntrack * nfct_new(void)
void nfct_set_attr_u8(struct nf_conntrack *ct, const enum nf_conntrack_attr type, uint8_t value)
struct nfct_handle * nfct_open(uint8_t, unsigned)