rename libnfnetlink_queue to libnetfilter_queue
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>
Sun, 9 Oct 2005 15:46:20 +0000 (15:46 +0000)
committerr.kubiak <r.kubiak@samsung.com>
Mon, 16 Nov 2015 13:12:05 +0000 (14:12 +0100)
12 files changed:
include/Makefile.am
include/libnetfilter_queue/Makefile.am [new file with mode: 0644]
include/libnetfilter_queue/libipq.h [new file with mode: 0644]
include/libnetfilter_queue/libnfnetlink_queue.h [new file with mode: 0644]
include/libnfnetlink_queue/Makefile.am [deleted file]
include/libnfnetlink_queue/libipq.h [deleted file]
include/libnfnetlink_queue/libnfnetlink_queue.h [deleted file]
src/Makefile.am
src/libipq_compat.c
src/libnfnetlink_queue.c
utils/Makefile.am
utils/nfqnl_test.c

index 4040f9fca25e1a60407897d091534b029a4caca2..42fd73355967f359bce878f1606037f7034c24ee 100644 (file)
@@ -1,3 +1,3 @@
 
-SUBDIRS = libnfnetlink_queue
+SUBDIRS = libnetfilter_queue
 
diff --git a/include/libnetfilter_queue/Makefile.am b/include/libnetfilter_queue/Makefile.am
new file mode 100644 (file)
index 0000000..fc9a2f6
--- /dev/null
@@ -0,0 +1,3 @@
+
+pkginclude_HEADERS = libnetfilter_queue.h libipq.h
+
diff --git a/include/libnetfilter_queue/libipq.h b/include/libnetfilter_queue/libipq.h
new file mode 100644 (file)
index 0000000..06c10c1
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * libipq.h
+ *
+ * IPQ library for userspace.
+ *
+ * Author: James Morris <jmorris@intercode.com.au>
+ *
+ * Copyright (c) 2000-2001 Netfilter Core Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef _LIBIPQ_H
+#define _LIBIPQ_H
+
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <asm/types.h>
+#include <linux/netlink.h>
+
+#ifdef KERNEL_64_USERSPACE_32
+#include "ip_queue_64.h"
+typedef u_int64_t ipq_id_t;
+#else
+#include <linux/netfilter_ipv4/ip_queue.h>
+typedef unsigned long ipq_id_t;
+#endif
+
+#ifdef DEBUG_LIBIPQ
+#include <stdio.h>
+#define LDEBUG(x...) fprintf(stderr, ## x)
+#else
+#define LDEBUG(x...)
+#endif /* DEBUG_LIBIPQ */
+
+/* FIXME: glibc sucks */
+#ifndef MSG_TRUNC
+#define MSG_TRUNC 0x20
+#endif
+
+struct ipq_handle
+{
+       struct nfqnl_handle *nfqnlh;
+       struct nfqnl_q_handle *qh;
+       u_int8_t family;
+       u_int8_t blocking;
+};
+
+struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
+
+int ipq_destroy_handle(struct ipq_handle *h);
+
+ssize_t ipq_read(const struct ipq_handle *h,
+                unsigned char *buf, size_t len, int timeout);
+
+int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
+
+ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
+
+int ipq_message_type(const unsigned char *buf);
+
+int ipq_get_msgerr(const unsigned char *buf);
+
+int ipq_set_verdict(const struct ipq_handle *h,
+                    ipq_id_t id,
+                    unsigned int verdict,
+                    size_t data_len,
+                    unsigned char *buf);
+
+int ipq_ctl(const struct ipq_handle *h, int request, ...);
+
+char *ipq_errstr(void);
+void ipq_perror(const char *s);
+
+#endif /* _LIBIPQ_H */
+
diff --git a/include/libnetfilter_queue/libnfnetlink_queue.h b/include/libnetfilter_queue/libnfnetlink_queue.h
new file mode 100644 (file)
index 0000000..9c2b40d
--- /dev/null
@@ -0,0 +1,87 @@
+/* libnfqnetlink.h: Header file for the Netfilter Queue library.
+ *
+ * (C) 2005 by Harald Welte <laforge@gnumonks.org>
+ *
+ *
+ * Changelog : 
+ *     (2005/08/11)  added  parsing function (Eric Leblond <regit@inl.fr>)
+ * 
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ */
+
+#ifndef __LIBCTNETLINK_H
+#define __LIBCTNETLINK_H
+
+#include <libnfnetlink/libnfnetlink.h>
+
+#include <linux/netfilter/nfnetlink.h>
+#include <linux/netfilter/nfnetlink_queue.h>
+
+struct nfqnl_handle;
+struct nfqnl_q_handle;
+
+extern int nfqnl_errno;
+
+extern struct nfnl_handle *nfqnl_nfnlh(struct nfqnl_handle *h);
+extern int nfqnl_fd(struct nfqnl_handle *h);
+
+typedef int  nfqnl_callback(struct nfqnl_q_handle *gh, struct nfgenmsg *nfmsg,
+                      struct nfattr *nfa[], void *data);
+
+
+extern struct nfqnl_handle *nfqnl_open(void);
+extern int nfqnl_close(struct nfqnl_handle *h);
+
+extern int nfqnl_bind_pf(struct nfqnl_handle *h, u_int16_t pf);
+extern int nfqnl_unbind_pf(struct nfqnl_handle *h, u_int16_t pf);
+
+extern struct nfqnl_q_handle *nfqnl_create_queue(struct nfqnl_handle *h,
+                                                u_int16_t num,
+                                                nfqnl_callback *cb,
+                                                void *data);
+extern int nfqnl_destroy_queue(struct nfqnl_q_handle *qh);
+
+extern int nfqnl_handle_packet(struct nfqnl_handle *h, char *buf, int len);
+
+extern int nfqnl_set_mode(struct nfqnl_q_handle *qh,
+                         u_int8_t mode, unsigned int len);
+
+extern int nfqnl_set_verdict(struct nfqnl_q_handle *qh,
+                            u_int32_t id,
+                            u_int32_t verdict,
+                            u_int32_t data_len,
+                            unsigned char *buf);
+
+extern int nfqnl_set_verdict_mark(struct nfqnl_q_handle *qh, 
+                                 u_int32_t id,
+                                 u_int32_t verdict, 
+                                 u_int32_t mark,
+                                 u_int32_t datalen,
+                                 unsigned char *buf);
+
+/* message parsing function */
+
+extern struct nfqnl_msg_packet_hdr *
+                               nfqnl_get_msg_packet_hdr(struct nfattr *nfa[]);
+
+extern u_int32_t nfqnl_get_nfmark(struct nfattr *nfa[]);
+
+extern struct nfqnl_msg_packet_timestamp *
+                               nfqnl_get_timestamp(struct nfattr *nfa[]);
+
+/* return 0 if not set */
+extern u_int32_t nfqnl_get_indev(struct nfattr *nfa[]);
+extern u_int32_t nfqnl_get_physindev(struct nfattr *nfa[]);
+extern u_int32_t nfqnl_get_outdev(struct nfattr *nfa[]);
+extern u_int32_t nfqnl_get_physoutdev(struct nfattr *nfa[]);
+
+extern struct nfqnl_msg_packet_hw *nfqnl_get_packet_hw(struct nfattr *nfa[]);
+
+/* return 0 if problem */
+extern int nfqnl_get_payload(struct nfattr *nfa[],
+                            char ** data, unsigned int* datalen);
+
+
+
+#endif /* __LIBNFQNETLINK_H */
diff --git a/include/libnfnetlink_queue/Makefile.am b/include/libnfnetlink_queue/Makefile.am
deleted file mode 100644 (file)
index ebdfd5c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-pkginclude_HEADERS = libnfnetlink_queue.h libipq.h
-
diff --git a/include/libnfnetlink_queue/libipq.h b/include/libnfnetlink_queue/libipq.h
deleted file mode 100644 (file)
index 06c10c1..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * libipq.h
- *
- * IPQ library for userspace.
- *
- * Author: James Morris <jmorris@intercode.com.au>
- *
- * Copyright (c) 2000-2001 Netfilter Core Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-#ifndef _LIBIPQ_H
-#define _LIBIPQ_H
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <asm/types.h>
-#include <linux/netlink.h>
-
-#ifdef KERNEL_64_USERSPACE_32
-#include "ip_queue_64.h"
-typedef u_int64_t ipq_id_t;
-#else
-#include <linux/netfilter_ipv4/ip_queue.h>
-typedef unsigned long ipq_id_t;
-#endif
-
-#ifdef DEBUG_LIBIPQ
-#include <stdio.h>
-#define LDEBUG(x...) fprintf(stderr, ## x)
-#else
-#define LDEBUG(x...)
-#endif /* DEBUG_LIBIPQ */
-
-/* FIXME: glibc sucks */
-#ifndef MSG_TRUNC
-#define MSG_TRUNC 0x20
-#endif
-
-struct ipq_handle
-{
-       struct nfqnl_handle *nfqnlh;
-       struct nfqnl_q_handle *qh;
-       u_int8_t family;
-       u_int8_t blocking;
-};
-
-struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
-
-int ipq_destroy_handle(struct ipq_handle *h);
-
-ssize_t ipq_read(const struct ipq_handle *h,
-                unsigned char *buf, size_t len, int timeout);
-
-int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
-
-ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
-
-int ipq_message_type(const unsigned char *buf);
-
-int ipq_get_msgerr(const unsigned char *buf);
-
-int ipq_set_verdict(const struct ipq_handle *h,
-                    ipq_id_t id,
-                    unsigned int verdict,
-                    size_t data_len,
-                    unsigned char *buf);
-
-int ipq_ctl(const struct ipq_handle *h, int request, ...);
-
-char *ipq_errstr(void);
-void ipq_perror(const char *s);
-
-#endif /* _LIBIPQ_H */
-
diff --git a/include/libnfnetlink_queue/libnfnetlink_queue.h b/include/libnfnetlink_queue/libnfnetlink_queue.h
deleted file mode 100644 (file)
index 9c2b40d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* libnfqnetlink.h: Header file for the Netfilter Queue library.
- *
- * (C) 2005 by Harald Welte <laforge@gnumonks.org>
- *
- *
- * Changelog : 
- *     (2005/08/11)  added  parsing function (Eric Leblond <regit@inl.fr>)
- * 
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- */
-
-#ifndef __LIBCTNETLINK_H
-#define __LIBCTNETLINK_H
-
-#include <libnfnetlink/libnfnetlink.h>
-
-#include <linux/netfilter/nfnetlink.h>
-#include <linux/netfilter/nfnetlink_queue.h>
-
-struct nfqnl_handle;
-struct nfqnl_q_handle;
-
-extern int nfqnl_errno;
-
-extern struct nfnl_handle *nfqnl_nfnlh(struct nfqnl_handle *h);
-extern int nfqnl_fd(struct nfqnl_handle *h);
-
-typedef int  nfqnl_callback(struct nfqnl_q_handle *gh, struct nfgenmsg *nfmsg,
-                      struct nfattr *nfa[], void *data);
-
-
-extern struct nfqnl_handle *nfqnl_open(void);
-extern int nfqnl_close(struct nfqnl_handle *h);
-
-extern int nfqnl_bind_pf(struct nfqnl_handle *h, u_int16_t pf);
-extern int nfqnl_unbind_pf(struct nfqnl_handle *h, u_int16_t pf);
-
-extern struct nfqnl_q_handle *nfqnl_create_queue(struct nfqnl_handle *h,
-                                                u_int16_t num,
-                                                nfqnl_callback *cb,
-                                                void *data);
-extern int nfqnl_destroy_queue(struct nfqnl_q_handle *qh);
-
-extern int nfqnl_handle_packet(struct nfqnl_handle *h, char *buf, int len);
-
-extern int nfqnl_set_mode(struct nfqnl_q_handle *qh,
-                         u_int8_t mode, unsigned int len);
-
-extern int nfqnl_set_verdict(struct nfqnl_q_handle *qh,
-                            u_int32_t id,
-                            u_int32_t verdict,
-                            u_int32_t data_len,
-                            unsigned char *buf);
-
-extern int nfqnl_set_verdict_mark(struct nfqnl_q_handle *qh, 
-                                 u_int32_t id,
-                                 u_int32_t verdict, 
-                                 u_int32_t mark,
-                                 u_int32_t datalen,
-                                 unsigned char *buf);
-
-/* message parsing function */
-
-extern struct nfqnl_msg_packet_hdr *
-                               nfqnl_get_msg_packet_hdr(struct nfattr *nfa[]);
-
-extern u_int32_t nfqnl_get_nfmark(struct nfattr *nfa[]);
-
-extern struct nfqnl_msg_packet_timestamp *
-                               nfqnl_get_timestamp(struct nfattr *nfa[]);
-
-/* return 0 if not set */
-extern u_int32_t nfqnl_get_indev(struct nfattr *nfa[]);
-extern u_int32_t nfqnl_get_physindev(struct nfattr *nfa[]);
-extern u_int32_t nfqnl_get_outdev(struct nfattr *nfa[]);
-extern u_int32_t nfqnl_get_physoutdev(struct nfattr *nfa[]);
-
-extern struct nfqnl_msg_packet_hw *nfqnl_get_packet_hw(struct nfattr *nfa[]);
-
-/* return 0 if problem */
-extern int nfqnl_get_payload(struct nfattr *nfa[],
-                            char ** data, unsigned int* datalen);
-
-
-
-#endif /* __LIBNFQNETLINK_H */
index c75d7086177bf0fd15cf12a477c30f8ad6493081..d9f1f75f9347dd784fcd52276b628b068b37deea 100644 (file)
@@ -3,11 +3,11 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/include -I${KERNELDIR}
 AM_CFLAGS=-fPIC -Wall
 LIBS=
 
-lib_LTLIBRARIES = libnfnetlink_queue.la libnfnetlink_queue_libipq.la
+lib_LTLIBRARIES = libnetfilter_queue.la libnetfilter_queue_libipq.la
 
-libnfnetlink_queue_la_LDFLAGS = -Wc,-nostartfiles
-libnfnetlink_queue_la_SOURCES = libnfnetlink_queue.c 
+libnetfilter_queue_la_LDFLAGS = -Wc,-nostartfiles
+libnetfilter_queue_la_SOURCES = libnetfilter_queue.c 
 
-libnfnetlink_queue_libipq_la_LDFLAGS = -Wc,-nostartfiles
-libnfnetlink_queue_libipq_la_SOURCES = libipq_compat.c
+libnetfilter_queue_libipq_la_LDFLAGS = -Wc,-nostartfiles
+libnetfilter_queue_libipq_la_SOURCES = libipq_compat.c
 
index d263aed5543fae3dad7b3303f681dfc92882862f..86481ac07d6c06de1322f0414c45b9be0259d496 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * libipq - backwards compatibility library for libnfnetlink_queue
+ * libipq - backwards compatibility library for libnetfilter_queue
  *
  * (C) 2005 by Harald Welte <laforge@netfilter.org>
  *
@@ -27,8 +27,8 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
-#include <libnfnetlink_queue/libnfnetlink_queue.h>
-#include <libnfnetlink_queue/libipq.h>
+#include <libnetfilter_queue/libnetfilter_queue.h>
+#include <libnetfilter_queue/libipq.h>
 
 /****************************************************************************
  *
index 10ece4847e7e8a7307352f6d8e0990022fff9782..8e84c50fd86bd703f756eb1dea5de9bd3bfb2f08 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/socket.h>
 
 #include <libnfnetlink/libnfnetlink.h>
-#include <libnfnetlink_queue/libnfnetlink_queue.h>
+#include <libnetfilter_queue/libnetfilter_queue.h>
 
 struct nfqnl_handle
 {
index c7ed00b50cf648ceee139378ec124259ae1b0e5f..4ccc1ad72a97c89196bb3c10e2aea2f257cbe32c 100644 (file)
@@ -4,7 +4,7 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/include -I${KERNELDIR}
 bin_PROGRAMS = nfqnl_test
 
 nfqnl_test_SOURCES = nfqnl_test.c
-nfqnl_test_LDADD = ../src/libnfnetlink_queue.la
+nfqnl_test_LDADD = ../src/libnetfilter_queue.la
 nfqnl_test_LDFLAGS = -dynamic
 
 
index ae8c072755467c0b1e9112a6071c986621b9cfeb..26de1c581b835b4d13155de4991f55a6be578539 100644 (file)
@@ -5,7 +5,7 @@
 #include <netinet/in.h>
 #include <linux/netfilter.h>           /* for NF_ACCEPT */
 
-#include <libnfnetlink_queue/libnfnetlink_queue.h>
+#include <libnetfilter_queue/libnetfilter_queue.h>
 
 /* returns packet id */
 static u_int32_t print_pkt (struct nfattr *tb[])