6 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
8 static int cb(
enum nf_conntrack_msg_type type,
9 struct nf_conntrack *ct,
14 nfct_snprintf(buf,
sizeof(buf), ct, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, NFCT_OF_SHOW_LAYER3 | NFCT_OF_TIMESTAMP);
17 return NFCT_CB_CONTINUE;
23 uint32_t family = AF_INET;
24 struct nfct_handle *h;
35 printf(
"TEST: get conntrack ");
37 printf(
"(%d)(%s)\n", ret, strerror(errno));
43 ret == -1 ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS);
int nfct_query(struct nfct_handle *h, const enum nf_conntrack_query query, const void *data)
int nfct_close(struct nfct_handle *cth)
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)
struct nfct_handle * nfct_open(uint8_t, unsigned)