6 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
8 static int event_cb(
enum nf_conntrack_msg_type type,
21 return NFCT_CB_CONTINUE;
27 struct nfct_handle *h;
29 h =
nfct_open(EXPECT, NF_NETLINK_CONNTRACK_EXP_NEW |
30 NF_NETLINK_CONNTRACK_EXP_UPDATE |
31 NF_NETLINK_CONNTRACK_EXP_DESTROY);
39 printf(
"TEST: waiting for 10 expectation events...\n");
43 printf(
"TEST: expectation events ");
45 printf(
"(%d)(%s)\n", ret, strerror(errno));
51 ret == -1 ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS);
int nfct_close(struct nfct_handle *cth)
int nfexp_snprintf(char *buf, unsigned int size, const struct nf_expect *exp, const unsigned int msg_type, const unsigned int out_type, const unsigned int out_flags)
int nfexp_callback_register(struct nfct_handle *h, enum nf_conntrack_msg_type type, int(*cb)(enum nf_conntrack_msg_type type, struct nf_expect *exp, void *data), void *data)
int nfexp_catch(struct nfct_handle *h)
struct nfct_handle * nfct_open(uint8_t, unsigned)