libnetfilter_conntrack  1.0.6
expect_flush.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <errno.h>
5 
6 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
7 
8 int main(void)
9 {
10  int ret;
11  uint8_t family = AF_INET;
12  struct nfct_handle *h;
13 
14  h = nfct_open(EXPECT, 0);
15  if (!h) {
16  perror("nfct_open");
17  return -1;
18  }
19 
20  ret = nfexp_query(h, NFCT_Q_FLUSH, &family);
21 
22  printf("TEST: flush expectations ");
23  if (ret == -1)
24  printf("(%d)(%s)\n", ret, strerror(errno));
25  else
26  printf("(OK)\n");
27 
28  nfct_close(h);
29 
30  ret == -1 ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS);
31 }
int nfct_close(struct nfct_handle *cth)
Definition: main.c:105
int nfexp_query(struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
Definition: expect/api.c:668
struct nfct_handle * nfct_open(uint8_t, unsigned)
Definition: main.c:84