summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* classid auto generation if provided tc name does not existThomas Graf2010-11-0114-47/+162
| | | | | | | | | | | | | | | | 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
* Support for meta matchThomas Graf2010-10-318-3/+644
| | | | | Syntax: meta(pktlen > 768)
* text ematch supportThomas Graf2010-10-297-8/+310
|
* attr: Add padding if nested data does not end at an alignment boundryThomas Graf2010-10-291-0/+17
| | | | | This could happen if a user put an unaligned amount of data inside an attribute with nlmsg_append().
* Improved debugging messages while constructing messages/attributesThomas Graf2010-10-292-7/+19
|
* routing rules: adapt to unified routing rulesThomas Graf2010-10-294-248/+315
| | | | | | - Use FRA_ definitions - Removed obsoleted fields - Added fwmask and goto support
* Revert "routing rules: mark support"Thomas Graf2010-10-293-13/+19
| | | | This reverts commit ee88c71d16a6b777c916275401a971eea78871d6.
* Revert "Include RTA_MARK in routing rule messages"Thomas Graf2010-10-291-3/+0
| | | | This reverts commit 6862c6592ad598dde0d827039b30df1a947822d1.
* Support RT_TABLE_COMPATThomas Graf2010-10-291-0/+1
|
* Support neighbour flag NTF_USEThomas Graf2010-10-291-0/+2
|
* Support for 64bit link counters IFLA_STATS64Thomas Graf2010-10-282-8/+46
|
* Updated arp and ethernet codesThomas Graf2010-10-281-0/+20
|
* Include RTA_MARK in routing rule messagesThomas Graf2010-10-281-0/+3
|
* routing rules: mark supportThomas Graf2010-10-283-19/+13
| | | | | | | | | Obsolete RTA_PROTOINFO code and parse RTA_MARK rtnl_rule_set_mark(rule, mark) rtnl_rule_get_mark(rule) now access the mark as in firewall mark
* 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>
* cgroup classifier improvementsThomas Graf2010-10-284-31/+128
| | | | | | | | | | | - enabled again - ematch support - cli tools module Example: nl-qdisc-add --dev eth0 --parent root --id 1: htb nl-cls-add --dev eth0 --parent 1: --id dead: cgroup nl-class-add --dev eth0 --parent 1: --id 1:<CGROUP> htb --rate 77mbit
* basic: Only add ematches to message if availableThomas Graf2010-10-281-1/+5
|
* Tons of ematch workThomas Graf2010-10-2818-228/+1078
| | | | | | | | | | - 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)
* Fix use of uninitialized data at the end of netlink messageThomas Graf2010-10-281-1/+1
| | | | | | | The netlink message buffer is preallocated to a page and later expanded as needed. Everything was properly paded and zeroed out except for the unused part at the end. Use calloc() to allocate the buffer.
* Avoid memcpy()/memset() when reserving space for nested attributesThomas Graf2010-10-281-4/+7
|
* Extended pktloc to support nbyte locations for ipv6, etc.Thomas Graf2010-10-285-11/+59
| | | | | 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-2611-75/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2611-170/+507
| | | | cli based tools to add/update/list/delete classifiers
* Unified TC attributes interfaceThomas Graf2010-10-2640-643/+714
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update include/linux header copiesThomas Graf2010-10-2118-279/+452
| | | | | Adapts ratespec code taking into account that the kernel now takes care of overhead calculations.
* nl-qdisc-add(8), nl-qdisc-delete(8), nl-qdisc-list(8)Thomas Graf2010-10-214-1/+121
|
* nl-class-list toolThomas Graf2010-10-203-1/+118
| | | | Same syntax as nl-qdisc-list
* nl-class-delete toolThomas Graf2010-10-205-5/+153
| | | | 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.
* Remove NL_DUMP_ENV codeThomas Graf2010-10-209-348/+0
| | | | | | | Dumping objects as environment variables has never been implemented completely and only increases the size of the library for no real purpose. Integration into scripts is better achieved by implementing a python module anyway.
* make nl-qdisc-list installableThomas Graf2010-10-202-21/+24
| | | | Also improves usability of nl-qdisc-list
* nl-class-add toolThomas Graf2010-10-2013-15/+418
| | | | | | | | | | Adds a cli based tool to add/update traffic classes. This tool requires each class to be supported via the respetive qdisc module in pkglibdir/cli/qdisc/$name.so. Syntax: nl-class-add --dev eth2 --parent 1: --id 1:1 htb --rate 100mbit nl-class-add --update --dev eth2 --id 1:1 htb --rate 200mbit
* pfifo/bfifo qdisc support for cli libsThomas Graf2010-10-193-1/+160
|
* remove obsolete nl-qdisc-add codeThomas Graf2010-10-191-196/+0
|
* classid databaseThomas Graf2010-10-1913-113/+535
| | | | | | | | | A database to resolve qdisc/class names to classid values and vice versa. The function rtnl_tc_handle2str() and rtnl_tc_str2handle() will resolve names automatically. A CLI based tool nl-classid-lookup is provided to integrate the database into existing iproute2 scripts.
* HTB: Append TCA_OPTIONS even if no options are setThomas Graf2010-10-191-7/+7
| | | | | The kernel requires the TCA_OPTIONS{TCA_HTB_INIT} attribute to be present even if the default values are to be used.
* nl-qdisc-add toolThomas Graf2010-10-199-3/+400
| | | | | | | | | | | | Adds a cli based tool to add/update/replace qdiscs. This tool requires each qdisc to be supported via a dynamic loadable module in pkglibdir/cli/qdisc/$name.so. So far HTB and blackhole have been implemented. Syntax: nl-qdisc-add --dev eth2 --parent root --id 1: htb --r2q=5 nl-qdisc-add --update-only --dev eth2 --id 1: htb --r2q=10
* - Prepare for 2.1.x treeThomas Graf2010-10-145-10/+5
| | | | - Bump interface number, we will break API in the development tree
* Generic Netlink multicast groups supportdima2010-10-1410-3/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | I have a patch against commit d378220c96c3c8b6f27dca33e7d8ba03318f9c2d extending libnl with a facility to receive generic netlink messages sent to multicast groups. Essentially it add one new function genl_ctrl_resolve_grp which prototype looks like this int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family_name, const char *grp_name) It resolves the family name and the group name to group id. Then the returned id can be used in nl_socket_add_membership to subscribe to multicast messages. Besides that it adds two more functions uint32_t nl_socket_get_peer_groups(struct nl_sock *sk) void nl_socket_set_peer_groups(struct nl_sock *sk, uint32_t groups) allowing to modify the socket peer groups field. So it's possible to multicast messages from the user space using the legacy interface. Looks like there is no way (or I was not able to find one?) to modify the netlink socket destination group from the user space, when the group id is greater then 32.
* Don't include pktloc_syntax.h in BUILT_SOURCESlibnl2_0Thomas Graf2010-10-131-1/+0
|
* route_obj: don't add empty destination to nlmsgDavid Lamparter2010-10-131-1/+2
| | | | | | | | | | don't try to give the kernel an empty RTA_DST attribute. this would previously happening on trying to delete the default route as returned from the kernel. the kernel doesn't add a RTA_DST atttribute, so libnl does nl_addr_alloc(0) and inserts a zero-length RTA_DST attribute into the deletion request, which the kernel then refuses with ERANGE. Signed-off-by: David Lamparter <equinox@diac24.net>
* automake: add ${top_builddir}/include to AM_CFLAGSAndreas Bießmann2010-10-133-3/+3
| | | | | | | | | | | This patch enables out-of-source builds like this $ cd builddir && src_dir/configure && make Before this patch there was an error about missing netlink/version.h which is built by automake in top_builddir rather than top_srcdir which is already in include search path. Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
* Use CPPFLAGSThomas Graf2010-10-131-1/+1
|
* Put preprocessor definitions in AM_CPPFLAGSMatthew L. Creech2010-10-132-2/+2
| | | | | | | | When an alternate kernel header include directory is added in CPPFLAGS, the libnl build fails. This is because the local copy of kernel headers is added in AM_CFLAGS, which gets included after CPPFLAGS in the automake-generated makefile. Switching to AM_CPPFLAGS fixes the problems.
* add user data to change_func_t for cachesAndreas Fett2010-10-134-14/+20
| | | | | | | | | | | the patch below adds the possibility to pass user data to callbacks of type change_func_t when using the nl_cache_mngr_* family of functions. If there is any better way to do this, without duplicating the code in cache_mngr.c please let me know.
* Trivial fix for TBF memleakDenys Fedorysychenko2010-10-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, running alloc / free cache loop will lead to huge memory leaks on machine with 3000 interfaces with tbf qdiscs. Here was valgrind output: ==5580== 18,070,728 bytes in 347,514 blocks are definitely lost in loss record 32 of 32 ==5580== at 0x4025485: calloc (in /lib/valgrind/vgpreload_memcheck-x86- linux.so) ==5580== by 0x405F410: tbf_msg_parser (tbf.c:46) ==5580== by 0x405302B: qdisc_msg_parser (qdisc.c:119) ==5580== by 0x4033DC9: nl_cache_parse (cache.c:643) ==5580== by 0x4033E7C: update_msg_parser (cache.c:460) ==5580== by 0x4038A11: nl_recvmsgs (netlink-local.h:112) ==5580== by 0x4034175: __cache_pickup (cache.c:483) ==5580== by 0x40343FF: nl_cache_pickup (cache.c:516) ==5580== by 0x403447D: nl_cache_refill (cache.c:698) ==5580== by 0x4034AB7: nl_cache_alloc_and_fill (cache.c:198) ==5580== by 0x4053216: rtnl_qdisc_alloc_cache (qdisc.c:388) ==5580== by 0x80489DB: main (in /home/root/nltest) Patch complied and tested for same test case, no more leaks anymore.
* libnl: optionally disable cli tools.Karl Hiramoto2010-10-132-1/+12
| | | | | | | | | | | | | | | | | | compile and link time can reduced, most non-developers don't need these cli tools. ./configure --disable-cli time make real 0m40.485s user 0m33.784s sys 0m2.793s ./configure time make real 0m53.097s user 0m42.077s sys 0m4.396s Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
* Ignore vim swap filesThomas Graf2010-07-031-0/+1
|
* Let git ignore generated pktloc source filesThomas Graf2010-07-031-0/+4
|
* Fix compile warning in utils.cThomas Graf2010-07-031-1/+1
|