summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* build: move -rdynamic from CPPFLAGS to LDFLAGSTobias Klauser2016-03-311-2/+2
| | | | | | | | | | The -rdynamic flag is a linker flag, not a compiler/preprocessor flag, so move it to LDFLAGS. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Thomas Haller <thaller@redhat.com> http://lists.infradead.org/pipermail/libnl/2016-March/002100.html
* link/neigh: add flags option to link and neighbor cachesDavid Ahern2015-11-193-3/+33
| | | | | | | | | | | | | Both link and neighbor cache support specify multiple groups (nl_af_group), but the alloc_cache functions for both do not set the NL_CACHE_AF_ITER flag before populating the cache so only the first group is used by default. This patch adds an API to pass in flags to make that happen and updates the nl-neigh-list command to make use of it. http://lists.infradead.org/pipermail/libnl/2015-October/001996.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: fix path to cli linker version script for out-of-tree buildjfarrell2015-06-191-2/+2
| | | | https://github.com/thom311/libnl/pull/78
* build: extend configure option --enable-cli and install all cli programsThomas Haller2015-03-181-15/+23
| | | | | | | | | | | | Previously, some cli programs were installed to sbin/ and most were not installed at all. Now, by default install all of them to bin/ directory. But extend the configure option to allow specifying 'no-inst', 'bin', or 'sbin'. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build/trivial: sort PROGRAMS list in src/Makefile.amThomas Haller2015-03-181-18/+40
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* route: remove unnecessary include of private linux/if.hDavid Chappelle2015-03-171-0/+1
| | | | | | | | | | | | | | | | | | | Including linux/if.h in netlink/route/link.h causes issues in cases where libnl is used in conjuntion with other third party libraries that include net/if.h. Seems to be a long checkered history of symbol collisions between these two files. As it turns out, including linux/if.h from within netlink/route/link.h is actually unecessary. I resurrected a forgotten path from this thread: http://lists.infradead.org/pipermail/libnl/2012-April/000525.html By removing the include as the patch suggests we can get around the nuissance of the symbol collisions. https://github.com/thom311/libnl/pull/73 Signed-off-by: Thomas Haller <thaller@redhat.com>
* correct --protocol option for nl-cls-* utilitiesCong Wang2015-02-253-3/+3
| | | | | | | Just in the help message. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: add linker scripts for libnl-cli-3.so libraryThomas Haller2015-02-021-0/+6
| | | | | | | libnl-cli-3.so was unversioned previously. This is an ABI change (but backward compatible). Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: deprecate IDIAG_SS_* socket statesThomas Haller2014-11-241-1/+1
| | | | | | | | | | These values mirror TCP_* socket states from 'netinit/tcp.h'. There is no good reason to expose a copy of those values. User space should use the original values (if they care). The only value that is actually useful is IDIAGNL_SS_ALL. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: move copy of linux headers to private directoryThomas Haller2014-09-242-0/+2
| | | | | | | | | | | | | | | | | | | libnl3 contains a private copy of some kernel header files. Normally, users are expected to install libnl and specify -I$PREFIX/include/libnl3 as include path. As the private kernel header files are not installed, this works fine. However, it can be convenient to build against the libnl source directory, without installing libnl. In this case, the private kernel header files shaddow the system provided ones. This is undesired. Move these files to a different directory to avoid this clash. http://lists.infradead.org/pipermail/libnl/2014-September/001645.html Signed-off-by: Thomas Haller <thaller@redhat.com> Acked-by: Thomas Graf <tgraf@suug.ch>
* build/trivial: prettify makefiles by wrapping long linesThomas Haller2014-09-242-2/+14
| | | | | Signed-off-by: Thomas Haller <thaller@redhat.com> Acked-by: Thomas Graf <tgraf@suug.ch>
* src: Silence all warningsThomas Graf2014-08-266-15/+9
| | | | | Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* nf: nfnl_*_str2copy_mode() should return intThomas Graf2014-08-262-2/+2
| | | | | | | | | | | | | ... to be able to return a negative error code for unknown modes. [thaller@redhat.com: This is potentially an ABI break, but since the size of the enum is implementation defined, it seems anyway unstable to have them as function arguments/return values.] http://lists.infradead.org/pipermail/libnl/2014-August/001616.html Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: Fix typo in error messageTobias Klauser2014-06-171-1/+1
| | | | | | | s/neighbout/neighbour/ Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add error checking to nl-route-get about out-of-memoryThomas Haller2014-06-101-2/+6
| | | | | | | This is mainly to appease coverity which warned about this. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* gitignore: ignore 'nf-ct-add' (netfilter/ct)Thomas Haller2014-04-301-0/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* netfilter/ct: expand CT parameters that can be used in add/delete operationsRich Fought2014-04-143-1/+150
| | | | | | | | | | | | This expands functionality for manipulating conntracks over netlink by adding other attributes to nfnl_ct_build_message(). Added a command link program to add conntracks. https://github.com/thom311/libnl/pull/55 [thaller@redhat.com: cleaned up whitespace from original patch] Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* remove the obsolete src/cls directoryCong Wang2014-01-314-324/+0
| | | | | Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: separate compiler and linker flagsJan Engelhardt2013-11-272-5/+8
| | | | | | | | | -Wall is a compiler flag, and thus should be in CFLAGS, not CPPFLAGS. Similarly, -l belongs into LDADD/LIBADD because of ordering constraints. Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* nl-link-set: Add --state optionJulien BERNARD2013-10-221-0/+9
| | | | | | | | | | | | | I modified the nl-link-set.c file to be able to set the interface up or down. I joined the patch. With the new nl-link-set binary I can set the tap interface down. I am working with Ubuntu 12.04 LTS 64bits and the libnl and libnl-route packages built from libnl3-3.2.3 from ubuntu reprositories. -- Julien BERNARD Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Priority of the '<' operator is higher than that of the '=' operatormaksqwe2013-08-261-1/+1
| | | | | Signed-off-by: maksqwe <maksqwe1@ukr.net> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add idiag-socket-detailsJoe Damato2013-07-253-1/+95
| | | | | | This small program lists all sockets on the system seen by netlink and serves as a simple example showing how to alloc an idiag msg cache and dump the objects in it.
* Add support for inet diag Netlink protocol.Joe Damato2013-07-191-1/+2
| | | | | | | | | | | | | - Inet diag allows users to gather low-level socket information. - This library provides a higher-level API for creating inetdiag requests (via idiagnl_connect and idiagnl_send_simple) and parsing the replies (via idiagnl_msg_parse). A cache is also provided (via idiagnl_msg_alloc_cache). - Request and message objects provide APIs for accessing and setting the various properties of each. - This library also allows the user to parse the inetdiag response attributes which contain information about traffic class, TOS, congestion, socket memory info, and more depending on the kernel version used. - Includes doxygen documentation.
* nl-route-add: Add NLM_F_EXCL flag to route addroopa2013-03-241-1/+1
| | | | | Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Use thread-safe strerror_r() instead of strerror()Thomas Graf2013-02-281-1/+2
| | | | | | | We have only ever fed well known error codes into strerror() so it should never have been a problem though. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Merge pull request #29 from rmfought/natdir32Thomas Graf2013-01-241-0/+18
|\ | | | | netfilter: expectation NAT direction is 32 bit attribute
| * netfilter: expectation NAT direction is 32 bit attributeRich Fought2013-01-231-0/+18
| |
* | Fix build warnings of nl-(qdisc|class|cls)-addThomas Graf2013-01-243-0/+6
| | | | | | | | | | Reported-by: Jeroen Roovers <jer@gentoo.org> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Move private header files to <netlink-private/*>Thomas Graf2013-01-242-2/+2
|/ | | | | | | This clarifies the seperation between public and private header files. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: provide safe variant of nl_cache_mngt_require() and use itThomas Graf2012-11-161-1/+4
| | | | | | | | This makes runtime removal of cache operations possible if non-safe API is not in use by application. The non-safe API will be removed in the next major version. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Merge branch 'master' of https://github.com/rmfought/libnlThomas Graf2012-10-267-1/+645
|\
| * Source cleanup for upstreamRich Fought2012-10-194-126/+122
| |
| * Updated nfnetlink includes; removed ifdefs; added delete exp programRich Fought2012-10-166-15/+249
| |
| * BugfixesRich Fought2012-10-104-2/+170
| |
| * bugfixesRich Fought2012-10-092-0/+10
| |
| * update gitignoreRich Fought2012-10-091-0/+1
| |
| * Expectation get cli toolRich Fought2012-10-092-1/+131
| |
| * Compile CLIRich Fought2012-10-092-23/+1
| |
| * Starting CLI workRich Fought2012-10-091-0/+127
| |
* | nf-log example: correct copy-range parsingКоренберг Марк (дома)2012-10-191-1/+1
|/
* "%llu" replaced with "%" PRIu64Коренберг Марк (дома)2012-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | On some architectures, uint64_t is defined as: typedef unsigned long long int __u64; on another architectures as: typedef unsigned long int __u64; So, according to man 3 printf, uint64_t should be printed as "%llu" on some architectures, and as "%lu" on another. The same for scanf. To eliminate that challenge, there is inttypes.h, in which appropriate constants are defined for current architecture. 32-bit types (and even 16 and 8 bit types) should be printed using such constants if printed variable defined as uint_XXXt or intXXXt type. But in reality 32-bit and less types does not gain run-time error (except in scanf), because they pushed to stack as 32-bit values at least. So, I decide not to fix that.
* nl_cli_route_parse_table fixed typo in codeКоренберг Марк (дома)2012-08-281-1/+1
| | | | Bug introduced in 2bdcde7e8e8bb78b165f093f1a708134f417e557
* Fix types-related warnings based on clang diagnosticsКоренберг Марк2012-06-131-3/+11
| | | | | | | | | | | | | | | | | 1. Fix some places where unsigned value compared < 0 2. Fix obsolete %Z specifier to more portable %z 3. Some erroneous types substitution 4. nl_msec2str() - 64-bit msec is now properly used, Only safe changes. I mean int <--> uint32_t and signed/unsigned fixes. Some functinos require size_t argument instead of int, but changes of signatures of that functions is terrible thing. Also, I do not pretend for a full list of fixes. Just to shut up clang -Wall -Wextra One more thing. ifindex. I don't change that because changes will be too big for simple fix.
* genl: Support registration of families without depending on cachesThomas Graf2012-06-011-2/+2
| | | | | | | | | | | | Introduces the functions genl_register_family() and genl_unregister_family() to register a Generic Netlink family which does not implement a cachable type. API users can direct received messages into genl_handle_msg() which will validate the messages and call the callback functions defined in the commands definition. See test/test-genl.c for an example on how to use it.
* FTBFS with musl libc: Missing includesIsaac2012-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello, libnl 3.2.9 does not build with musl libc, without patching. I' using a current musl libc (http://www.etalabs.net/musl/) with linux 2.6.32 headers. At first there were a couple problems on the musl side, but those are resolved. However, I found some other issues: First, two files were missing #include <byteswap.h>: lib/netfilter/log_msg.c lib/netfilter/queue_msg.c These files used __bswap_64 (which should be bswap_64), a macro declared in byteswap.h Second, I got this error after fixing that: In file included from nf-queue.c:16: ./include/linux/netfilter.h:53: error: field in has incomplete type ./include/linux/netfilter.h:54: error: field in6 has incomplete type I found that src/nf-queue.c is missing an #include <netinet/in.h> Attached is a patch which resolves these issues. I've tested with both musl and glibc, and it builds cleanly on both.
* genl-ctrl-list: Mark for installationThomas Graf2012-04-201-1/+1
|
* genl-ctrl-list: fix copyright and summaryThomas Graf2012-04-201-2/+2
|
* genl-ctrl-list: Introduce -d|--details as a shortcut for --format=detailsThomas Graf2012-04-201-3/+5
|
* Ingnore src/nl-link-enslave and nl-link-releaseThomas Graf2011-09-191-0/+2
|
* bonding: API to create/enslave/releaseThomas Graf2011-09-163-1/+98
| | | | | | | | | | | | | | Although it has been possible to create bonding devices, enslave and release using the regular link API. The added API simplifies usage and hides some of the compatibility logic. F.e. enslave() and release() will both verify that the master assignment has in fact been changed and return -NLE_OPNOTSUPP if it did not. Also the API will make sure to use RTM_NEWLINK or RTM_SETLINK depending on what is availble. Examples are provided in src/ as nl-link-enslave.c and nl-link-release.c