summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Create LZMA-compressed dist-filesHEADmasterPhil Sutter2022-12-091-1/+1
| | | | | | | | Use a more modern alternative to bzip2. Suggested-by: Jan Engelhardt <jengelh@inai.de> Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Phil Sutter <phil@nwl.cc>
* build: bump version to 1.0.3libnetfilter_acct-1.0.3Pablo Neira Ayuso2016-08-221-1/+1
| | | | | | | This release contains the quota support available in the Linux kernel >= 3.16. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add JSON output formatHarald Welte2016-02-292-0/+47
| | | | | | | | | | | the original output format looks a bit like JSON, but isn't. The XML output is useful if you deal with XML, but a lot of applications prefer more lightweight formats like YAML/JSON. This adds the JSON output format to libnetfilter_acct, which will subsequently be used by a similar change in the nfacct utility. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: Sync with kernel headersFelix Janda2015-05-212-11/+25
| | | | | Signed-off-by: Felix Janda <felix.janda@posteo.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Fix overquota output resultAlexey Perevalov2014-07-311-3/+11
| | | | | | | | | | | Current implementation shows "packet" for none byte quota type. It means "packet" was used for overquota counter as well and it wasn't so informative. This commmit adds additional column - overquota with yes/no value. Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: fix broken output handlingPablo Neira Ayuso2014-04-282-13/+19
| | | | | | | | | In 948fa3b ("Extend accounting capabilities to support quotas"), the error handling of snprintf is incorrect since this function may return -1 on error. Add a new SNPRINTF_CHECK() macro to offload the complicated handling of snprintf. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Extend accounting capabilities to support quotasMathieu Poirier2014-04-284-4/+78
| | | | | | | | | The accounting framework already supports accounting at the quota and byte level. As such it is a natural extention to add a ceiling limit to those metrics. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* xml: fix inversion between pkt and bytesEric Leblond2014-02-041-2/+2
| | | | | | | | The nfacct_snprintf_xml used to ouput accounting in XML format was inverting packet and bytes. This patch restores the correct order. Signed-off-by: Eric Leblond <eric@regit.org>
* configure: uclinux is also linuxGustavo Zacarias2013-09-171-1/+1
| | | | | Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: remove sys/types.hPablo Neira Ayuso2013-06-111-2/+0
| | | | | | | | It is present since the initial import, but it doesn't seem to be useful these days. Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: use C++ headers in C++ modePablo Neira Ayuso2013-06-071-1/+10
| | | | | Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* use PRIu64 and remove unnecessary castMr Dash Four2013-03-151-7/+4
| | | | | | | | | This patch corrects all nfacct_snprintf_* functions to use PRIu64, given that we are using uint64_t type variables and also removes the unnecessary casts. Signed-off-by: Mr Dash Four <mr.dash.four@googlemail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: bump version to 1.0.2libnetfilter_acct-1.0.2Pablo Neira Ayuso2013-03-031-1/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Fix packets and bytes inversion.Eric Leblond2012-12-261-5/+5
| | | | | Pkts and bytes are inversed in some part of the code. This patch fixes most of the occurence of this problem.
* Add include needed for integer types definition.Eric Leblond2012-11-051-0/+1
|
* build: resolve compile abort on RHEL5 #2Jan Engelhardt2012-10-131-0/+12
| | | | | | | | | | | libnetfilter_acct.c: In function 'nfacct_nlmsg_build_payload': libnetfilter_acct.c:422: warning: implicit declaration of function 'htobe64' libnetfilter_acct.c: In function 'nfacct_nlmsg_parse_payload': libnetfilter_acct.c:477: warning: implicit declaration of function 'be64toh' Signed-off-by: Jan Engelhardt <jengelh@inai.de>
* build: resolve compile abort on RHEL5 #1Jan Engelhardt2012-10-133-56/+70
| | | | | | | | | | [ 24s] In file included from libnetfilter_acct.c:18: [ 24s] ../include/linux/netfilter/nfnetlink.h:4:46: error: linux/netfilter/nfnetlink_compat.h: No such file or directory Slurp in new headers from the kernel du jour (v3.6-10970-g4d7127d). Signed-off-by: Jan Engelhardt <jengelh@inai.de>
* Partially revert "src: remove unnecessary castings"Pablo Neira Ayuso2012-10-101-3/+7
| | | | | | | This partially reverts commit 6e8573c9f62fc9db99c120298d9539be27fe282e. %lu in 32-bits arch is only 4 bytes. Thanks to Jan Engelhardt for spotting this.
* Merge git://git.inai.de/libnetfilter_acct masterPablo Neira Ayuso2012-10-101-0/+1
|\ | | | | | | Pick extremely little change in configure.ac from Jan's tree.
| * build: resolve automake-1.12 warningsJan Engelhardt2012-10-081-0/+1
| | | | | | | | | | | | | | | | am/ltlibrary.am: warning: 'libnetfilter_acct.la': linking libtool libraries using a non-POSIX archiver requires 'AM_PROG_AR' in 'configure.ac' Signed-off-by: Jan Engelhardt <jengelh@inai.de>
* | src: NFACCT_PKTS and NFACCT_BYTES are MNL_TYPE_U64libnetfilter_acct-1.0.1Pablo Neira Ayuso2012-10-091-5/+0
| | | | | | | | | | | | | | No need to duplicate the same code to validate their size since they are both unsigned 64-bits integers. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* | src: remove unnecessary castingsPablo Neira Ayuso2012-10-091-8/+4
|/ | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: remove unnecessary pkgconfig->config.status dependencyJan Engelhardt2012-06-241-2/+0
| | | | Signed-off-by: Jan Engelhardt <jengelh@inai.de>
* build: bump version to 1.0.1Pablo Neira Ayuso2012-06-221-1/+1
| | | | | | | To satisfy ulogd2 correct library version checking. Even if there's no plan to release a new version of the library anytime soon. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: NFACCT_SNPRINTF_T_XML flag for nfacct_snprintf to output timePablo Neira Ayuso2012-06-222-22/+101
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: fix nfacct-get examplelibnetfilter_acct-1.0.0Pablo Neira Ayuso2012-03-271-1/+2
| | | | | | I forgot to adapt it to use the new nfacct_snprintf API. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfacct: change prototype of nfacct_snprintf() to support output in XMLPablo Neira Ayuso2012-03-274-18/+42
| | | | | | | | | | | | | | | | This patch adds supports for XML output for nfacct_snprintf(). This also bumps the library current version number and it adds a new version in the symbol map. I decided to do so because, although no official release has happened so far. Many distributors have already decided to provide packages for this. We don't provide the old symbol version for nfacct_snprintf, I think that's too much (given the lifetime of it). But we make sure that we break the binary gracefully in case of version mismatches (not silently, with unexpectable side effects). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* extend READMEPablo Neira Ayuso2012-02-291-0/+17
| | | | | | | * Detail how to compile if you get a working copy from the git tree. * Include licensing terms. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfacct: check if attribute is set in nfacct_attr_get*Pablo Neira Ayuso2012-02-011-4/+8
| | | | | | | Instead of returning the data even if unset. Reported-by: Alejandro Castaño del Castillo <alex@wadobo.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfacct: use NFACCT_ATTR_* flags in nfacct_nlmsg_build_payloadPablo Neira Ayuso2012-02-011-3/+3
| | | | | | | Instead of checking is name, packets and bytes are set. Reported-by: Alejandro Castaño del Castillo <alex@wadobo.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nfacct: modify nfacct_snprint outputPablo Neira Ayuso2012-01-011-3/+3
| | | | | | | | | Now it looks like: { pkts = 00000000000000000000, bytes = 00000000000000000000 } = test1; { pkts = 00000000000000000000, bytes = 00000000000000000000 } = test2; Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: add missing LIBMNL_CFLAGS to compilation processJan Engelhardt2011-12-291-1/+1
| | | | | Otherwise, the preprocessor may fail to find libmnl if it is not in a standard-searched directory.
* Add examples/.gitignoreJan Engelhardt2011-12-291-0/+3
|
* Update .gitignoreJan Engelhardt2011-12-291-3/+3
| | | | Only ignore these paths if they are a directory.
* build: remove unnecessary AC_EXEEXTJan Engelhardt2011-12-291-1/+0
| | | | ${EXEEXT} is nowhere used in Makefiles.
* build: enable automake warningsJan Engelhardt2011-12-291-1/+2
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* update .gitignore filePablo Neira Ayuso2011-12-291-5/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: update configure.ac and gcc4_visibility.m4Pablo Neira Ayuso2011-12-292-4/+6
| | | | | | | | | | This patch includes the recent changes that Jan proposed for other library. Also, this patch relaxes the libmnl dependency to >= 1.0.0 (previously it checked for 1.0.1, not really required). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* update README filePablo Neira Ayuso2011-12-291-22/+16
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add COPYING file and other licensing stuffPablo Neira Ayuso2011-12-295-1/+506
| | | | | | | | | License is LGPLv2.1+, fix header of libnetfilter_acct.c which tells LGPLv2 or any later (mind the missing .1 after v2). Examples of this library are in the public domain. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: add library documentation in doxygenPablo Neira Ayuso2011-12-293-25/+342
| | | | | | This patch adds the library documentation in doxygen format. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: major API redesignPablo Neira Ayuso2011-12-296-102/+333
| | | | | | | | | | | | | | | This patch reworks the initial API. Now it provides functions to: - allocate/release accounting objects. - set/unset/get attributes of accounting objects. - build one netlink message from one accounting object. - parse one netlink message to one accounting object. - print one accounting object into a buffer. Binary layout of nfacct objects are opaque. This is good for extensibility without breaking backward compatibility. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* update nfnetlink_acct.hPablo Neira Ayuso2011-12-231-2/+4
| | | | | | to get it in sync with kernel changes. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: nfacct-get allows to zero counters with `-z' optionPablo Neira Ayuso2011-12-231-2/+12
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* extend nfacct_list to allow to zero countersPablo Neira Ayuso2011-12-142-3/+7
|
* examples: add nfacct-del to delete accounting objectsPablo Neira Ayuso2011-12-142-2/+5
| | | | This also fixes one wrong flag in nfacct_delete(...)
* add NFNL_MSG_ACCT_GET_CTRZEROPablo Neira Ayuso2011-12-141-0/+1
|
* add README filePablo Neira Ayuso2011-12-021-0/+61
|
* examples: nfacct-add: initialize counters, otherwise we add garbagePablo Neira Ayuso2011-12-021-1/+1
|
* fix endianness in 64-bits packet and bytes countersPablo Neira Ayuso2011-12-021-4/+7
| | | | | In nfnetlink, the policy is that attributes are in network byte order.