summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
* tools: Use LDADD and link against .la files instead of LDFLAGS and -llibThomas Graf2011-09-131-1/+7
|
* Switch to libtool versioning systemThomas Graf2011-09-131-7/+10
| | | | | | | | | | | | | | | | | | It has been a request that multiple libnl versions should be installabe in parallel. In order to achieve this, the basename of the library was changed to libnl-3 which reflects the 3rd generation of libnl APIs. It also means that release based library versioning is left behind and libtool versioning is used instead. Projects using pkgconfig will automatically link against the new library basename and will not notice a difference. The SO versioning is based on the glib model: current := 100 * minor + micro - revision revision := revision age := age (number of backwards compatible versions)
* Remove GPL-3.0 license file.Thomas Graf2011-09-081-676/+0
| | | | There is no code licensed GPL-3.0 so we might as well remove this file.
* nl-link-name2ifindex: fix usage textJiri Pirko2011-08-301-1/+1
| | | | Signed-off-by: Jiri Pirko <jpirko@redhat.com>
* Make some functions and global variables staticPavel Roskin2011-08-118-10/+10
|
* 3.1 releaseThomas Graf2011-08-111-2/+0
|
* trafic class/classifer API improvements and documentationThomas Graf2011-03-291-4/+4
| | | | | | | - removed dead functions in header files - deprecated rtnl_class_foreach_*() functions due to their missing handling possibility of OOM situations - improved API documentation
* Deprecate rtnl_qdisc_foreach_child() and rtnl_qdisc_foreach_cls()Thomas Graf2011-03-241-1/+17
| | | | | | | | | Their usage is not completely safe, it is not possible to handle the out of memory situation of the allocate filter. It is very unlikely for this to cause any problem though. The functions are still accessible but gcc will warn about their deprecation.
* Allow NLSYSCONFDIR environment variable to overwrite built-in sysconfdirThomas Graf2011-03-241-1/+1
|
* fix module parent referencesThomas Graf2011-03-211-1/+1
|
* Unified TC APIThomas Graf2011-03-2113-192/+107
| | | | | | | | Finally got rid of all the qdisc/class/cls code duplication in the tc module API. The API takes care of allocation/freeing the tc object specific data. I hope I got it right this time.
* Make syntax of nl-link-list consistent and install itThomas Graf2010-11-162-33/+24
|
* Add all libraries for libtool to improve linkageGery Kahn2010-11-111-40/+1
| | | | | | | | This will fix finding libs while link, by adding them to LDFLAGS [It's no ideal but it's less of a mess than what we have now. -tgraf] Signed-off-by: Gery Kahn <geryk@ti.com>
* Extend rtnl_link_alloc_cache() to support address familiesThomas Graf2010-11-112-3/+24
| | | | | | | Adds a family argument which allows to request link dumps for a certain address family. This allows to f.e. dump ipv6 specific statistics and data. nl-link-list --family inet6
* link: Support IFLA_IFALIAS attributeThomas Graf2010-11-112-5/+20
| | | | | | | | - parse IFLA_IFALIAS if available - provides API to access/change ifalias rtnl_link_get_ifalias(link) rtnl_link_set_ifalias(link, alias) - extends nl-link-set to test functionality
* pktloc: support to specify a shift operator for packet locationsThomas GraF2010-11-041-5/+9
| | | | no users yet though.
* nl-qdisc-delete: Do not attempt to delete default qdiscsThomas GraF2010-11-031-0/+4
|
* nl-classid-lookup: Added --raw option to print classid without pretty ↵Thomas Graf2010-11-011-2/+10
| | | | printing it
* nl-qdisc-list: --recursive - print tc objects recursivelyThomas Graf2010-11-011-7/+94
|
* classid auto generation if provided tc name does not existThomas Graf2010-11-0110-17/+39
| | | | | | | | | | | | | | | | Manually editing etc/libnl/classid before adding tc objects is a pain. This patch adds code to attempt auto generating a unique tc id which will then be assigned to the provided name and added to the classid file. This will make the following commands work with prior definitions of the names "top" and "test" sudo sbin/nl-qdisc-add --dev eth0 --parent root --id top htb sudo sbin/nl-class-add --dev eth0 --parent top --id test htb --rate 100mbit It will generate the following ids automatically: 4001: top 4001:1 test
* src/nf-queue: revert nonsensical changePatrick McHardy2010-10-281-24/+0
| | | | | | | | | | | | The only part of commit d378220c (src/nf-queue.c: cleanup and improve performance of test program for NF_QUEUE) that actually makes sense is the increase in receive buffer size. Issuing verdicts for IDs not delivered to userspace is a wasted effort since the kernel drops packets itself when netlink message delivery fails. This would actually have been noticed by a return value of -ENOENT if the result of nfnl_queue_msg_send_verdict() would have been checked. Signed-off-by: Patrick McHardy <kaber@trash.net>