summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* src: whitespace: Remove trailing whitespace and inconsistent indentsDuncan Roe2021-09-062-16/+16
| | | | | | | | All .c and .h files now have no lines with trailing whitespace. All .c and .h files now indent with tabs followed by <8 spaces. Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: add LIBVERSION variable for ipulogJeremy Sowden2021-08-301-5/+6
| | | | | | | Replace hard-coded version-info in LDFLAGS. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* libipulog: fill in missing packet fields.Jeremy Sowden2021-08-301-7/+16
| | | | | | | | Retrieval of time-stamp, input- and output-device fields had not been implemented in `ipulog_get_packet`. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* libipulog: use correct index to find attribute in packet.Jeremy Sowden2021-08-301-1/+1
| | | | | | | The time-stamp is at `NFULA_TIMESTAMP-1` not `NFULA_TIMESTAMP`. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: use calloc instead of malloc + memset.Jeremy Sowden2021-08-302-6/+3
| | | | | Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: fix typo's in example.Jeremy Sowden2021-08-301-3/+3
| | | | | | | Use the right group number in nflog_bind_group example. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: link libnetfilter_log_libipulog.so explicitly to libnfnetlink.so.Jeremy Sowden2020-11-301-1/+1
| | | | | | | | | It uses symbols from libnfnetlink.so, but doesn't link to it, relying on an implicit transitive linkage through libnetfilter_log.so. Add `$(LIBNFNETLINK_LIBS)` to `$(libnetfilter_log_libipulog_la_LIBADD)`. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Florian Westphal <fw@strlen.de>
* build: remove duplicate `-lnfnetlink` from LDFLAGS.Jeremy Sowden2020-11-301-1/+1
| | | | | | | | `$(libnetfilter_log_la_LIBADD)` includes `$(LIBNFNETLINK_LIBS)`, so there's no need to include `-lnfnetlink` in `$(libnetfilter_log_la_LDFLAGS)`. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Florian Westphal <fw@strlen.de>
* nlmsg: Add NFULA_CT and NFULA_CT_INFO attributes supportKen-ichirou MATSUZAWA2015-10-121-1/+2
| | | | | | | This patch validate NFULA_CT and NFULA_CT_INFO attributes, Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nlmsg: add printf function in conjunction with libmnlKen-ichirou MATSUZAWA2015-08-242-5/+54
| | | | | | | | | | | To printf nflog netlink message in XML, nflog_snprintf_xml can be used after converting nflog nlattrs to nflog_data, but we should not have any code that mixes both new and old, which handles nflog_data, APIs. The idea is to deprecate libnfnetlink and any client of that library at some point, that will take quite time though since we'll have to mark those old interfaces as deprecated. Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
* src: introduce new functions independent from libnfnetlinkKen-ichirou MATSUZAWA2015-08-242-2/+163
| | | | | | | | | | | The libnetfilter_log.c file contains the old API, its use is discouraged since it depends on libnfnetlink. The idea is to provide a set of helper functions that we can use in conjunction with libmnl, similar to what we have in libnetfilter_queue/nlmsg.c Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
* src: Use stdint types everywhereFelix Janda2015-05-272-51/+51
| | | | | Signed-off-by: Felix Janda <felix.janda@posteo.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* configure: add --without-ipulog option to disable libipulog buildMatthieu Crapet2014-02-121-1/+5
| | | | | | | | This is a compat library used for netfilter ULOG target. ULOG only works with IPv4. NFLOG has replaced ULOG. Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: use -Wall across the entire sourceJan Engelhardt2010-12-301-2/+0
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* build: create a Make_global.am fileJan Engelhardt2010-12-301-1/+2
| | | | | | Just like the other Netfilter libraries. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* src: declare non-modified data as constJan Engelhardt2010-12-211-3/+3
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* src: remove redundant castsJan Engelhardt2010-12-211-1/+1
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doc: discourage the use of nflog_set_nlbufsiz()Pablo Neira Ayuso2010-11-041-0/+4
| | | | | | | | | | | The default buffer size (which is one memory page) provides the best results in terms of performance. For that reason, noone should use nflog_set_nlbufsiz() to set up a higher buffer in the applications (even if this is supported by the nfnetlink_log). Davem spotted this during the Netfilter Workshop 2010. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: no need for error message in PKG_CHECK_MODULESJan Engelhardt2010-10-311-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: remove -fPIC flagJan Engelhardt2010-10-311-1/+1
| | | | | | libtool automatically adds PIC flags as needed. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* build: avoid use of deprecated INCLUDESJan Engelhardt2010-10-301-1/+1
| | | | | | 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 major contributors that are Eric Leblond <eric@inl.fr> and Harald Welte <laforge@netfilter.org>. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfq: fix redundant LIBVERSION definitionlibnetfilter_log-1.0.0Pablo 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
* doc: add libnetfilter_log doxygen documentation and update copyright noticePablo Neira Ayuso2010-07-141-5/+431
| | | | | | | | | This patch adds the libnetfilter_log documentation in doxygen format. I have also added myself to the copyright header in the libnetfilter_log.c file according to my contributions available in the git repository. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nflog: revert previous patchPablo Neira Ayuso2010-07-111-1/+1
| | | | | | This patch reverts 9c3d1b12b2ceafd92336048985fac57f048d6e19 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nflog: do not default to NFLOG_XML_HW in nflog_snprintf_xml()Pablo Neira Ayuso2010-07-111-1/+1
| | | | | | | | | | | | If no flags are passed to nflog_snprintf_xml(), we print: <log></log> This is not very useful but, at least, it is a way to show that nflog_snprintf_xml() is working correctly (even if no flags were passed). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nflog: remove `0x' from HW protocol in output of nflog_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>
* nflog: 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>
* nflog: consistent nflog_snprintf_xml() return value with snprintf()Pablo Neira Ayuso2010-07-111-60/+63
| | | | | | | | | | | With this patch, nflog_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 nflog_snprintf_xml() consistent with the behaviour of snprintf(). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add nflog_snprintf_xml() to output a log in XML formatPablo Neira Ayuso2010-05-251-0/+155
| | | | | | This patch adds a new function to output the packet in XML format. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nflog: replace nfnl_talk by nfnl_query and disable sequence trackingPablo Neira Ayuso2009-02-171-6/+9
| | | | | | | | | | 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 binding to queues and high load of log messages at the same time. Reported-by: Anton Vazir <anton.vazir@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Suppress NFULNL_MSG_CONFIG callback registration.Eric Leblond2008-12-301-20/+0
| | | | | | | | It seems there is no NFULNL_MSG_CONFIG message send from kernel space to userspace. Thus the registration of an nfnetlink callback for this type of messages is not necessary. Signed-off-by: Eric Leblond <eric@inl.fr>
* Suppress reference to libnetfilter_queue which is the model of libnetfilter_log.Eric Leblond2008-12-301-7/+7
| | | | | | | | This patch fixes the description of the file was the one of libnetfilter_queue.c and it suppresses indication through out the file that it is a copy of the queue module. Signed-off-by: Eric Leblond <eric@inl.fr>
* Fix minor memory leak in nflog_close().Eric Leblond2008-12-151-1/+3
| | | | | The nflog_handle is allocated in nflog_open(). This patch adds the missing free in nflog_close().
* Add parsing function for raw hardware headerEric Leblond2008-07-171-0/+16
| | | | | | | | | | This patch adds support for the parsing of NFULA_HWTYPE, NFULA_HWHEADER, and NFULA_HWLEN part of the NFLOG message. This permits to have a ULOG like behaviour but thanks to NFULA_HWTYPE we will be able to parse the message cleanly in userspace. Signed-off-by: Eric Leblond <eric@inl.fr> Signed-off-by: Patrick McHardy <kaber@trash.net>
* Use union to ensure proper alignmentFabian Hugelshofer2008-06-181-32/+44
| | | | | | | | This patch increases portability, but alignment is still not respected in nflog_get_*() which still leaves libnetfilter_log unusable on particular platforms. Signed-off-by: Fabian Hugelshofer <hugelshofer2006@gmx.ch>
* Add NFULA_GID support/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net2008-04-211-0/+9
|
* [PATCH 2/6] libnetfilter_log pkt-config changes (KOVACS Krisztian ↵/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org2006-08-031-2/+2
| | | | <hidden@balabit.hu>)
* add support for instance-local and global sequence counters/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2006-01-261-0/+30
|
* Introduce various API changes throughout the library stack/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2006-01-142-24/+45
| | | | | | | | | | | 1) make libnfnetlink dynamically allocate it's handles 2) apply that change throughout libnetfilter_* 3) add {nfq,nflog,nfct}_open_nfnl() functions that open the specific subsystem on top of an existing nfnl_handle, which is required for upcoming libnetfilter_conntrack_helper The changes break ABI and API compatibility of libnfnetlink, but don't break ABI or API compatibility of the libnetfilter_* libraries.
* remove all references to KERNELDIRsvn_t_libnetfilter_log-0.0.12/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-11-141-1/+1
|
* - use local copy of nfnetlink_log.h instead of kernel include file/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-11-111-0/+3
| | | | - bump version number to 0.0.11
* - add librarry api versioning/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-11-062-7/+19
| | | | - add missing dependency from libipulog to libnetfilter_log
* we have to link against libnfnetlink, otherwise the dependency is missingsvn_t_libnetfilter_log-0.0.10/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-11-051-1/+1
|
* implement accessor functions similar to libnetfilter_queue/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-11-051-1/+76
|
* rename all functions to remove 'nl' (netlink) from prefix/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-11-052-51/+51
|
* rename libnfnetlink_log into libnetfilter_log/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-10-093-8/+8
|
* fix header dependencies/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-09-231-3/+0
|
* - some more work on libipulog compat API [almost finished]/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-08-081-6/+14
| | | | - improt ulog_test.c from libipulog in order to test libipulog compat API
* - replace HEADER_LEN with NFNL_HEADER_LEN from libnfnetlink/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org2005-08-071-27/+38
| | | | | | | | | | | - nfulnl_errno has to be non-static - use nfnl_talk() instead of nfnl_send() to check for error values in all configuration messages - group is 16bit, therefore use ntohs(), not ntohl() - return ENODEV (no such device) in case there is no callback, not EEXIST - cosmetic clenaup of structure declaraitions - implement nfulnl_fd() - fix memory leakage when nfulnl_open() fails