summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* src: add support for UID/GID socket infoValentina Giusti2014-01-082-0/+48
| | | | | | | | With this patch libnetfilter_queue is able to parse UID/GID socket information. Signed-off-by: Valentina Giusti <Valentina.Giusti@bmw-carit.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: extra: add prefix nfq_ to internal checksum functionsPablo Neira Ayuso2013-08-135-13/+13
| | | | | | | | These functions are internal and they belong to the libnetfilter_queue scope, so let's add the corresponding nfq_ prefix. Suggested-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: avoid symbol namespace pollutionFlorian Westphal2013-08-133-3/+49
| | | | | | | | | | | | | | | As of f40eabb01 (add pkt_buff and protocol helper functions) libnetfilter_queue accidentally exports the internal function named 'checksum'. This is a bit too generic and may cause crashes with applications that worked fine before. This patch makes the functions checksum, checksum_tcpudp_ipv4 and checksum_tcpudp_ipv6 local by building with fvis-hidden and adding EXPORTs for the legacy api calls and the ones that seem to have missing EXPORT tags (mainly pktbuff api). Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Merge branch 'next'Pablo Neira Ayuso2013-08-132-0/+19
|\ | | | | | | | | | | | | | | Get the following patches into master: examples/nf-queue: receive large gso packets src: add new GSO handling capabilities examples/nf-queue: handle recv error, use larger buffer
| * src: add new GSO handling capabilitiesFlorian Westphal2013-04-302-0/+19
| | | | | | | | | | | | allows userspace to ask for large gso packets via nfqueue. Signed-off-by: Florian Westphal <fw@strlen.de>
* | fix valgrind errors of uninitialised byte during call to nfq_unbind_pfTamas Lengyel2013-06-011-0/+1
|/ | | | | | | | | | | | | | | | Valgrind generates error reports during a call to the nfq_unbind_pf function: ==00:00:00:08.662 22111== 4 errors in context 1 of 1: ==00:00:00:08.662 22111== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ... ==00:00:00:08.662 22111== Uninitialised value was created by a stack allocation ==00:00:00:08.662 22111== at 0x679C30B: __build_send_cfg_msg (libnetfilter_queue.c:178 Signed-off-by: Tamas K Lengyel <tamas.k.lengyel@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de>
* build: don't install internal.hFlorian Westphal2013-04-271-1/+1
| | | | Signed-off-by: Florian Westphal <fw@strlen.de>
* src: document NFQA_CFG_F_CONNTRACK flagPablo Neira Ayuso2013-03-141-5/+9
| | | | | | Suggested by Eric Leblond. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doxygen: improve documentationEric Leblond2013-01-251-1/+21
| | | | | This patch improves the doxygen documentation and adds a reference to an external article.
* doxygen: improve fail-open documentation.Eric Leblond2013-01-251-0/+8
|
* fix compilation warning in nfq_get_payloadPablo Neira Ayuso2012-08-211-1/+2
| | | | | | | libnetfilter_queue.c: In function 'nfq_get_payload': libnetfilter_queue.c:1116:8: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: nf-queue: fix compilation warning with gcc-4.7Pablo Neira Ayuso2012-08-201-6/+7
| | | | | | | nf-queue.c: In function ‘main’: nf-queue.c:146:12: warning: unused variable ‘id’ [-Wunused-variable] Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: update doxygen documentation for new API for libmnlPablo Neira Ayuso2012-08-205-6/+85
| | | | | | This patch updates the doxygen documentation for the new API. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* pktbuff: fix pktb_push, _pull and _put functionPablo Neira Ayuso2012-08-201-2/+5
| | | | | | Fix wrong arithmetics and missing pktb->len update Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* extra: pktbuff: pktb_expand_tail return 0 if there is no room in the tailPablo Neira Ayuso2012-08-201-3/+9
| | | | | | | | | | | | pktb_expand_tail returns 0 if there is no room for the mangling. Note that we don't support dynamic reallocation, instead the caller is responsible for allocating the extra room via pktb_alloc according to the maximum amount of bytes it needs for the mangling. Since pkt_buff layout is not exposed, we can change this in the future if we prefer dynamic reallocation. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add mangle functions for IPv4/TCP and IPv4/UDPPablo Neira Ayuso2012-08-067-4/+137
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add pkt_buff and protocol helper functionsPablo Neira Ayuso2012-08-068-1/+826
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add new libnetfilter_queue API for libmnlPablo Neira Ayuso2012-08-063-2/+191
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: implement API to set per-queue flagsKrishna Kumar2012-07-142-1/+43
| | | | | | | | | | Implement API to set per-queue flags. This is initially used to implement fail-open support in NFQUEUE. [ Pablo mangled this patch to bump LIBVERSION as well ] Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: bump version to 1.0.1libnetfilter_queue-1.0.1Pablo Neira Ayuso2012-01-021-1/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: add notes on NF_STOLEN and NF_REPEAT to documentationFlorian Westphal2011-09-061-1/+6
| | | | | | | | | | | | The verdict NF_STOLEN must not be used. When using NF_REPEAT, one way to prevent re-queueing of the same packet is to also set an nfmark using nfq_set_verdict2, and set up the nefilter rules to only queue a packet when the mark is not (yet) set. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* src: add NFQNL_MSG_VERDICT_BATCH supportFlorian Westphal2011-09-061-6/+44
| | | | | | | | | | | | | add nfq_set_verdict_batch() and nfq_set_verdict_batch2 (to also set the nfmark of all packets). verdicts sent by the _batch variant will affect all queued skbs whose id is smaller or equal to the given id. This facility is available from Linux 3.1 onwards. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* build: use -Wall across the entire sourceJan Engelhardt2010-12-301-1/+0
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* build: create a Make_global.am fileJan Engelhardt2010-12-301-1/+1
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doc: fix wrong documentation on NFQNL_COPY_NONEPablo Neira Ayuso2010-12-071-1/+1
| | | | | | NFQNL_COPY_NONE means noop and should not be used. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: document some performance tweaks for libnetfilter_queuePablo Neira Ayuso2010-11-031-1/+22
| | | | | | | This patch documents some performance tweaks for libnetfilter_queue applications. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Merge branch 'master' of git://dev.medozas.de/libnetfilter_queuePablo Neira Ayuso2010-11-011-3/+3
|\
| * build: remove -fPIC flagJan Engelhardt2010-10-301-1/+1
| | | | | | | | | | | | libtool automatically adds PIC flags as needed. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * build: no need for error message in PKG_CHECK_MODULESJan Engelhardt2010-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | PKG_CHECK_MODULES already produces its own (and more verbose) messsage when a module cannot be found. Mucking around with CFLAGS and LIBS is also not needed since pkgconfig takes care of providing variables, so let's use them in Makefile.am. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * build: avoid use of deprecated INCLUDESJan Engelhardt2010-10-301-1/+1
| | | | | | | | | | | | | | | | Makefile.am: "INCLUDES" is the old name for "AM_CPPFLAGS" (or "*_CPPFLAGS") And remove unused $(all_includes) Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* | license: upgrade to GPLv2+Pablo Neira Ayuso2010-10-291-1/+1
|/ | | | | | | | | | | | This patch upgrades the license to GPLv2+. I have received an explicit ACK via email from contributors that are: * Harald Welte <laforge@netfilter.org>. * Holger Freyther <zecke@selfish.org> * Alessandro Vesely <vesely@tana.it> * Bart Schuymer <bdschuym@pandora.be> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: fix redundant LIBVERSION definitionPablo Neira Ayuso2010-07-151-1/+19
| | | | | | | | I accidentally inserted LIBVERSION to Makefile.am but the one used is in src/Makefile.am. This patch removes the previous definition. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: add myself to the copyright noticePablo Neira Ayuso2010-07-151-0/+1
| | | | | | | This patch adds myself to the copyright notice according to my contributions in the git repository. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: add missing documentation on nfq_snprintf_xml()Pablo Neira Ayuso2010-07-151-0/+32
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: remove `0x' from HW protocol in output of nfq_snprintf_xml()Pablo Neira Ayuso2010-07-111-2/+2
| | | | | | This patch removes the prefix `0x' of the HW protocol. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: fix HW address output in nfq_snprintf_xml()Pablo Neira Ayuso2010-07-111-3/+3
| | | | | | | | | | | | This patch fixes the output of the HW address in XML files: <src>800:800:800:800:800:</src> now it looks fine: <src>0019a917a400</src> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: consistent nfq_snprintf_xml() return value with snprintf()Pablo Neira Ayuso2010-07-111-58/+61
| | | | | | | | | | With this patch, nfq_snprintf_xml() returns the number of characters printed. If the output was truncated, then the return value is the number of characters that would have been written if enough space had been available. This makes nfq_snprintf_xml() consistent with the behaviour of snprintf(). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: fix compilation warning in nfq_snprintf_xml()Pablo Neira Ayuso2010-07-111-1/+1
| | | | | | | In 21fd1834b5ce0a1f5b590f7e1ad23bba64fbafdf, we changed nfq_get_payload() to take an unsigned char * instead of signed char *. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add nfq_snprintf_xml() to output a packet in XML formatPablo Neira Ayuso2010-06-131-0/+151
| | | | | | This patch adds a new function to output the packet in XML format. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* payload buffer datatypes are consistentDavid Fabro2010-06-101-1/+1
| | | | | | | | | | | | | | The 'data' parameter to nfq_get_payload() returns pointer to unsigned char (rather than signed char) to make it consistent with the 'buf' parameter of nfq_set_verdict(), nfq_set_verdict2(), and nfq_set_verdict_mark(), all of which refer to the same data. Either signed or unsigned is fine, but they should be consistent as the output of nfq_get_payload() may be passed back into nfq_set_verdict*(); in that case, this change eliminates the need for typecasting in the calling code when using compilers that enforce strict typecasting. Signed-off-by: David Favro <netfilter@meta-dynamic.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* non-modified payload arguments are pointer-to-constDavid Fabro2010-06-101-5/+6
| | | | | | | | | | | | | | The payload parameters to nfq_set_verdict(), nfq_set_verdict2(), and nfq_set_verdict_mark() are not modified by those functions, and therefore should have datatype pointer-to-const. This both causes the source-code to more effectively represent what is the purpose of the parameter, and eliminates the need to cast away const-ness when calling the functions with compilers that enforce strict casting. All existing calling code should not need modification as pointer-to-X automatically converts to pointer-to-const-X. Signed-off-by: David Favro <netfilter@meta-dynamic.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: remove references to deprecated nfq_set_verdict_mark()Pablo Neira Ayuso2010-05-101-2/+2
| | | | | | Now, we refer to nfq_set_verdict2() instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: document possible verdicts on packets and minor change in exampleAlessandro Vesely2010-05-101-2/+11
| | | | | Signed-off-by: Alessandro Vessely <vesely@tana.it> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: enhancementsDavid Favro2010-05-101-14/+17
| | | | | | | | | | * Several parameters are clarified. * Several previously undocumented return-values are documented. * nfq_set_verdict_mark() [now deprecated]: notes that mark is in network byte order. Signed-off-by: David Favro <netfilter@meta-dynamic.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: deprecate nfq_set_verdict_mark() in favour of nfq_set_verdict2()Pablo Neira Ayuso2010-05-091-0/+19
| | | | | | | | | | | | This patch deprecates nfq_set_verdict_mark() in favour of nfq_set_verdict2() which does exactly the same but it also convert the mark value from host-byte order to network-byte order as expected by nfnetlink_queue. I know, this is hackish, but I prefer adding new functions instead of API versioning which is also ugly. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* remove libipq_compatPatrick McHardy2009-09-172-254/+1
| | | | | | | | It has never been finished and nowadays people should be using libnfnetlink_queue directly anyways. In case someone wants to finish it, it can easily be restored from the history. Signed-off-by: Patrick McHardy <kaber@trash.net>
* nfq: add minor comment in the documentation to warn about privilegesPablo Neira Ayuso2009-07-161-0/+4
| | | | | | | | This patch adds a minor notice to warn developers that its application needs CAP_NET_ADMIN in order to send to and receive packets from kernel-space. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: replace nfnl_talk by nfnl_query and disable sequence trackingPablo Neira Ayuso2009-02-171-3/+6
| | | | | | | | | | This patch replaces the nfnl_talk() calls by the newer nfnl_query(). This patch also disables netlink sequence tracking by default. Spurious race conditions in the sequence tracking may occur while creating queues and receiving high load of packets at the same time. Reported-by: Anton Vazir <anton.vazir@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Switch documentation style to doxygen.Eric Leblond2008-12-191-125/+307
| | | | | | | This patch modifies the documentation format to switch to doxygen format. This leads to a interesting and useful output. An example can be found at the following url: http://www.nufw.org/doc/libnetfilter_queue/
* Suppress double call of nfnl_subsys_close()Eric Leblond2008-12-191-1/+0
| | | | | | | | nfnl_close() is calling nfnl_subsys_close() for all available subsys. Thus it is not necessary to call it in the nfq_close() function. Signed-off-by: Eric Leblond <eric@inl.fr>