summaryrefslogtreecommitdiffstats
path: root/utils/nfqnl_test.c
diff options
context:
space:
mode:
author/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2005-07-30 20:59:07 +0000
committer/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2005-07-30 20:59:07 +0000
commit5c4d06957c850d884dabe015ba11844af6a755a8 (patch)
treeaab2ea1058b3935fcb366f22ec8a8b8d584e7bda /utils/nfqnl_test.c
parent689346d6528085eb4216007d658bd7f34ee6cb60 (diff)
more restructuring work
Diffstat (limited to 'utils/nfqnl_test.c')
-rw-r--r--utils/nfqnl_test.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c
new file mode 100644
index 0000000..834f5cb
--- /dev/null
+++ b/utils/nfqnl_test.c
@@ -0,0 +1,34 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+
+#include "libnfnetlink_queue.h"
+
+int main(int argc, char **argv)
+{
+ struct nfqnl_handle h;
+ struct nfqnl_q_handle qh;
+ int rv;
+ char buf[4096];
+
+ rv = nfqnl_open(&h);
+ if (rv < 0)
+ exit(rv);
+
+ nfqnl_bind_pf(&h, AF_INET);
+ nfqnl_create_queue(&h, &qh, 0);
+ nfqnl_set_mode(&qh, NFQNL_COPY_PACKET, 0xffff);
+
+ while (recv(h.nfnlh.fd, buf, sizeof(buf), 0) > 0) {
+ printf("pkt received\n");
+ }
+
+ nfqnl_destroy_queue(&qh);
+ nfqnl_unbind_pf(&h, AF_INET);
+
+ nfqnl_close(&h);
+
+ exit(0);
+}