summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-081-0/+127
| |
* | nf-log example: correct copy-range parsingКоренберг Марк (дома)2012-10-191-1/+1
|/
* "%llu" replaced with "%" PRIu64Коренберг Марк (дома)2012-08-301-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-291-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>
* Tons of ematch workThomas Graf2010-10-291-0/+17
| | | | | | | | | | - Fixes a bunch of bugs related to ematches - Adds support for the nbyte ematch - Adds a bison/flex parser for ematch expressions, expressions may look like this: ip.length > 256 && pattern(ip6.src = 3ffe::/16) documenation on syntax follows - adds ematch support to the basic classifier (--ematch EXPR)
* Extended pktloc to support nbyte locations for ipv6, etc.Thomas Graf2010-10-291-5/+19
| | | | | The alignment column/field now also takes a number, specifying the length in bytes of the field described by the location
* Packet location updatesThomas Graf2010-10-273-9/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch includes various bugfixes in the packet location parser. Namely it removes two memory leaks if parsing fails. The parser is correctly quit if an allocation error occurs and it is no longer possible to add duplicates. It removes the possibility to differ between net and host byteorder. This is better done in the actual classifiers as it makes more sense to specify this together with the value to compare against. The patch also extends the API to add new packet locations via rtnl_pktloc_add(). It introduces reference counting, therefore you now have to give back packet locations with rtnl_pktloc_put() after looking them up with rtnl_pktloc_lookup(). But you are allowed to keep using them if the packet location file has been reread. The packet location file now also understands "eth", "ip", and "tcp" for "link", "net", and "transport". A --list option has been added to nl-pktloc-lookup to list all packet location definitions A --u32=VALUE option has been added to let nl-pktloc-lookup print the definition in iproute2's u32 selector style. A manual page has been written for nl-pktloc-lookup. Finally, nl-pktloc-lookup has been made installable.
* nl-cls-* toolsThomas Graf2010-10-267-163/+368
| | | | cli based tools to add/update/list/delete classifiers
* Unified TC attributes interfaceThomas Graf2010-10-2611-106/+146
| | | | | | | | | | | | | | | | | | | | | | | | So far all common tc atttributes were accessed via specific functions, i.e. rtnl_class_set_parent(), rtnl_qdisc_set_parent(), rtnl_cls_set_parent() which implied a lot of code duplication. Since all tc objects are derived from struct rtnl_tc and these common attributes are already stored in there this patch removes all type specific functions and makes rtnl_tc_* attribute functions public. rtnl_qdisc_set_parent(qdisc, 10); becomes: rtnl_tc_set_parent((struct rtnl_tc *) qdisc, 10); This patch also adds the following new attributes to tc objects therefore removing them as tc specific attributes: - mtu - mpu - overhead This allows for the rate table calculations to be unified as well taking into account the new kernel behavior to take care of overhead automatically.
* nl-class-list toolThomas Graf2010-10-203-1/+118
| | | | Same syntax as nl-qdisc-list
* nl-class-delete toolThomas Graf2010-10-204-1/+152
| | | | Tool based on nl-qdisc-delete to delete traffic classes.
* Make nl-qdisc-delete installableThomas Graf2010-10-203-31/+65
| | | | | Fixes nl_cli_confirm() and adds a check enforcing --yes before deleting all qdiscs on all devices.