summaryrefslogtreecommitdiffstats
path: root/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:55:43 +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:55:43 +0000
commit689346d6528085eb4216007d658bd7f34ee6cb60 (patch)
tree25d22ab90b22ab159d92fb8383d57878a86ae5b7 /nfqnl_test.c
parenta019e98d464e442b323969d2fcd6c5385ec4aa91 (diff)
directory restructuring
Diffstat (limited to 'nfqnl_test.c')
-rw-r--r--nfqnl_test.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nfqnl_test.c b/nfqnl_test.c
index 28971da..834f5cb 100644
--- a/nfqnl_test.c
+++ b/nfqnl_test.c
@@ -4,27 +4,28 @@
#include <unistd.h>
#include <netinet/in.h>
-#include "libnfqnetlink.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, 0);
+ rv = nfqnl_open(&h);
if (rv < 0)
exit(rv);
nfqnl_bind_pf(&h, AF_INET);
- nfqnl_bind(&h, 0);
- nfqnl_set_mode(&h, 0, NFQNL_COPY_PACKET, 0xffff);
+ 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_unbind(&h, 0);
+ nfqnl_destroy_queue(&qh);
nfqnl_unbind_pf(&h, AF_INET);
nfqnl_close(&h);