summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* attr: validate MNL_TYPE_MSEC same as MNL_TYPE_U64Ken-ichirou MATSUZAWA2013-12-071-0/+1
| | | | | Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: use mnl_nlmsg_get_payload()Ken-ichirou MATSUZAWA2013-12-071-1/+1
| | | | | | | not increment (nlmsghdr) pointer Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: fix trivial error messageKen-ichirou MATSUZAWA2013-12-0715-34/+34
| | | | | Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: set attr tableKen-ichirou MATSUZAWA2013-12-072-0/+8
| | | | | | | Florian adviced rtnl-route-event.c has same problem Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* doc: mnl_socket_open returns NULL on errorShawn Landden2013-12-071-1/+1
| | | | Signed-off-by: Florian Westphal <fw@strlen.de>
* 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: don't force compiler to enter C++11 modePablo Neira Ayuso2013-07-161-8/+3
| | | | | | | | | | | Thomas reports that g++ forces you to enable C++11 mode if you want to use <cstdint>. Tested with g++ (GCC) 4.4.4. He reports that this compiles fine without the special headers. So let's get rid of them. This reverts bb8c40e. Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Tested-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
* examples: netfilter: add nfct daemon skeleton codePablo Neira Ayuso2013-07-052-1/+370
| | | | | | | | This patch adds the skeleton code for a daemon that collects statistics via ctnetlink. Consider it a simplified version of ulogd2. It also contains some documentation on several interesting tweaks. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: cache copy of nfnetlink_conntrack.hPablo Neira Ayuso2013-06-114-1/+255
| | | | | | | To ensure that examples compile in any installation. This header is not installed in the system. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: netfilter: add nfct-dumpPablo Neira Ayuso2013-05-312-0/+322
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: add rtnl-addr-dumpPablo Neira Ayuso2013-05-282-1/+138
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: rtnl-link-dump: display HW addressPablo Neira Ayuso2013-05-271-1/+19
|
* examples: rtnl-route-dump: display also metric/priorityPablo Neira Ayuso2013-05-021-0/+3
| | | | | | If present in the route message, otherwise simply skip it. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: rtnl-route-add: fix typo in IPv6 supportPablo Neira Ayuso2013-05-021-1/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: rtnl-route-event: update Makefile.amPablo Neira Ayuso2013-04-241-1/+5
| | | | | | So you can compile rtnl-route-event via `make check' Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: rtnl-route-event: add example to listen to IPv4/IPv6 routesPablo Neira Ayuso2013-04-241-0/+330
| | | | | | Derived from rtnl-route-dump.c Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: rtnl-route-add improvements (including IPv6 support)Pablo Neira Ayuso2013-04-241-24/+57
| | | | | | | | | | | | | | | Now, both IPv4 and IPv6 are supported simultaneously in one single file. While at it: * I moved the declarations to the beginning of the main function. * Renamed mask by prefix, which seems more appropriate to me. * Use RTPROTO_STATIC, as the route has been added by the administrator. * Set NLM_F_ACK, so we get a report from the kernel about our query and treat reply from the kernel. * Stricter argc checking. * Use perror instead of printf for error reporting. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* callback: fix missing handling of NLM_F_DUMP_INTRStephen Hemminger2013-03-271-1/+8
| | | | | | | | | | Propagate the error to the user-space application, that should retry. [ I have mangled this patch to document EINTR in mnl_cb_run. --pablo ] Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* headers: update netlink.h to 3.9Stephen Hemminger2013-03-261-5/+10
| | | | | | | | Use sanitized kernel header from 3.9 upstream kernel. Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: add kobject-eventPablo Neira Ayuso2013-03-264-2/+57
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: add genl-group-eventsPablo Neira Ayuso2013-03-192-1/+68
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doxygen: fix a variable name.Eric Leblond2013-03-141-1/+1
| | | | | | Variable name in doxygen description was not correct. Signed-off-by: Eric Leblond <eric@regit.org>
* examples: rtnl-route-dump: add IPv6 supportPhilip Prindeville2012-08-091-5/+108
| | | | | | | | | [ Pablo has modified the original patch modified to fix some compilation warnings with gcc-4.7 and select the protocol family as argument from the command line. ] Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* parse: add mnl_attr_for_each_payloadlibmnl-1.0.3Pablo Neira Ayuso2012-05-185-6/+45
| | | | | | | | | | | | This function allows you to parse the payload of the Netlink message. Thus, you can skip the headers and go down to the part of the message you want to parse. This patch has updated the LIBVERSION and it also bumps the version to 1.0.3, in case that someone wants to package some snapshot, not to mess with the new symbol we have added. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nlmsg: fix valgrind warnings about paddingStephen Hemminger2012-04-191-2/+3
| | | | | | | | | When using mnl_nlmsg_put_extra_header() it pads out the addtional header but only zeros the original size not the padded value. Which cause valgrind to complain about sendto() with uninitialized byte. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: libmnl 1.0.2 releaselibmnl-1.0.2Pablo Neira Ayuso2012-01-021-1/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* example: release them in the public domainPablo Neira Ayuso2012-01-0212-72/+12
| | | | | | | | I have decided to release the examples in this library in the public domain. Jan Engelhardt, who has been the sole contributor so far, has agreed with this re-licensing by communication via e-mail. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: kernel-like compilation messagesPablo Neira Ayuso2011-12-271-0/+3
| | | | | | | | | | CC socket.lo CC callback.lo CC nlmsg.lo CC attr.lo CCLD libmnl.la Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: disable implicit .tar.gz archive generation and use POSIX modeJan Engelhardt2011-12-171-1/+1
|
* m4: resolve autoconf-2.68 warningsJan Engelhardt2011-12-171-2/+2
| | | | | | | | | | Newer autoconf desires proper full quoting and use of AC_LANG_SOURCE. Import new m4 file from git://dev.medozas.de/m4_jengelh. m4/gcc4_visibility.m4:4: CHECK_GCC_FVISIBILITY is expanded from... configure.ac:15: the top level configure.ac:15: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
* build: use AC_CONFIG_AUX_DIR and stash away toolsJan Engelhardt2011-12-172-5/+2
|
* Update .gitignoreJan Engelhardt2011-12-171-3/+3
| | | | Only ignore these paths if they are a directory.
* build: abort autogen on subcommand failureJan Engelhardt2011-08-091-1/+1
| | | | | | | | Needed to stop an automated build process when automake requirements are not fulfilled. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* COPYING: update file (FSF address was outdated)Pablo Neira Ayuso2011-06-021-22/+63
| | | | | | | | | Prabin reported that the FSF address was outdated, I downloaded the current version of LGPL 2.1 from the website and put it in the tree. Reported-by: Prabin Kumar Datta <prabindatta@fedoraproject.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: fix wrong comment describing mnl_nlmsg_batch_stop()Sean Robinson2011-03-171-3/+3
| | | | | | | | | | | Sean says: "I did find a discrepancy in the comments versus practice in one function and I have attached a patch fixing those comments to this message." Sligtly mangled by myself. Signed-off-by: Sean Robinson <seankrobinson@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: use sanitized header from headers_installJan Engelhardt2011-03-171-127/+1
| | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: use limits.h headerJan Engelhardt2011-03-051-2/+1
| | | | | | | | values.h is not present on other systems, and the glibc copy reads right away: Old compatibility names for <limits.h> and <float.h> constants. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doxygen: exclude EXPORT_SYMBOL and skip .git filesPablo Neira Ayuso2011-02-081-2/+2
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* doc: don't show up EXPORT_SYMBOL in doxygenPablo Neira Ayuso2011-02-036-87/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | Patrick reports that the doxygen output shows up EXPORT_SYMBOL and tells how to fix this: > I just noticed the EXPORT_SYMBOLs in libmnl showing up in > the doxygen output. Just in case you want to avoid this, > what I'm doing in libdect is (besides the appopriate linker > flags): > > #define __visible __attribute__((visibility("default"))) > > #define EXPORT_SYMBOL(x) typeof(x) (x) __visible > > > This allows to use EXPORT_SYMBOL as in the kernel, IOW > after the function definition. This patch also removes -Wredundant-decls to avoid a warning in every single use of this new approach. Now, this looks more like the Linux kernel way of exporting symbols. Reported-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples/genl: support dumping the genl familiesJan Engelhardt2011-01-081-2/+6
| | | | | | The usage text already specified [family] as optional, now implement it :-) Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* examples/genl: fix newline imbalanceJan Engelhardt2011-01-081-2/+3
| | | | | | Running `genl-family-get VFS_DQUOT` forgets to print a newline. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* Merge branch 'master' of git://dev.medozas.de/libmnlPablo Neira Ayuso2011-01-062-5/+6
|\
| * build: use only AC_CANONICAL_HOSTJan Engelhardt2010-12-311-2/+2
| | | | | | | | | | | | | | Calculating AC_CANONICAL_TARGET is superfluous, because libmnl is not a code generator. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
| * build: use AM_CPPFLAGSJan Engelhardt2010-12-312-3/+4
| | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* | header: fix invalid use of type void * in arithmetic of mnl_for_each_nest(...)Pablo Neira Ayuso2010-12-301-2/+2
|/ | | | | | | | | | | | | This patch fixes the following warnings: netlink.c:121: warning: pointer of type ‘void *’ used in arithmetic netlink.c:121: warning: pointer of type ‘void *’ used in subtraction We cannot use type void * for pointer arithmetic operations. This was introduced in 478dc5f4ab8d0a639d1bafe3bd53ff3309727836 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: libmnl 1.0.1 releaselibmnl-1.0.1Pablo Neira Ayuso2010-12-262-2/+2
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* header: fix signess issues in MNL_SOCKET_BUFFER_SIZEPablo Neira Ayuso2010-12-251-1/+1
| | | | | | | | | This patch fixes the following compilation warning: warning: comparison between signed and unsigned integer expressions warning: signed and unsigned type in conditional expression Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* headers: add local copy of linux/netlink.h to libmnlPablo Neira Ayuso2010-12-224-2/+277
| | | | | | | Davem suggested to add a copy of linux/netlink.h to avoid compilation problems in all cases scenarios. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: add missing unistd.hJan Engelhardt2010-12-201-0/+1
| | | | | | | | | | | | When a project uses MNL_SOCKET_BUFFER_SIZE without having included unistd.h, it gets: mystuff.c:36:2: warning: implicit declaration of function "getpagesize" It is libmnl's job to include this, since mystuff.c did not use getpagesize anywhere. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* doc: add new website at netfilter.org to doxygenPablo Neira Ayuso2010-12-171-2/+2
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>