summaryrefslogtreecommitdiffstats
path: root/_queue/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-26 06:56:22 +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-26 06:56:22 +0000
commit18a29c4921fb1aa80ddbcdb77eccfbc571e4f6aa (patch)
tree26d5c56276c651009132cafbfbdfbc752262f57b /_queue/nfqnl_test.c
parentd9419f765c2f7662fa30ed88e0b739adba42e5f1 (diff)
add new queue userspace library
Diffstat (limited to '_queue/nfqnl_test.c')
-rw-r--r--_queue/nfqnl_test.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/_queue/nfqnl_test.c b/_queue/nfqnl_test.c
new file mode 100644
index 0000000..28971da
--- /dev/null
+++ b/_queue/nfqnl_test.c
@@ -0,0 +1,33 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+
+#include "libnfqnetlink.h"
+
+int main(int argc, char **argv)
+{
+ struct nfqnl_handle h;
+ int rv;
+ char buf[4096];
+
+ rv = nfqnl_open(&h, 0);
+ if (rv < 0)
+ exit(rv);
+
+ nfqnl_bind_pf(&h, AF_INET);
+ nfqnl_bind(&h, 0);
+ nfqnl_set_mode(&h, 0, NFQNL_COPY_PACKET, 0xffff);
+
+ while (recv(h.nfnlh.fd, buf, sizeof(buf), 0) > 0) {
+ printf("pkt received\n");
+ }
+
+ nfqnl_unbind(&h, 0);
+ nfqnl_unbind_pf(&h, AF_INET);
+
+ nfqnl_close(&h);
+
+ exit(0);
+}