summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* cgroup classifier improvementsThomas Graf2010-10-281-5/+4
| | | | | | | | | | | - 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
* Tons of ematch workThomas Graf2010-10-286-49/+111
| | | | | | | | | | - 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-281-1/+2
| | | | | 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-262-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-261-0/+38
| | | | cli based tools to add/update/list/delete classifiers
* Unified TC attributes interfaceThomas Graf2010-10-2612-92/+100
| | | | | | | | | | | | | | | | | | | | | | | | 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-2115-253/+439
| | | | | Adapts ratespec code taking into account that the kernel now takes care of overhead calculations.
* nl-class-delete toolThomas Graf2010-10-201-4/+1
| | | | Tool based on nl-qdisc-delete to delete traffic classes.
* Remove NL_DUMP_ENV codeThomas Graf2010-10-201-1/+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.
* nl-class-add toolThomas Graf2010-10-202-2/+34
| | | | | | | | | | 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
* classid databaseThomas Graf2010-10-192-0/+2
| | | | | | | | | 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.
* nl-qdisc-add toolThomas Graf2010-10-192-0/+15
| | | | | | | | | | | | 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
* Generic Netlink multicast groups supportdima2010-10-146-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* add user data to change_func_t for cachesAndreas Fett2010-10-132-3/+7
| | | | | | | | | | | 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.
* Fix compile warning in nl.cThomas Graf2010-07-031-1/+1
|
* Packet Location InterfaceThomas Graf2010-07-023-1/+47
|
* Don't install private header files.Thomas Graf2010-04-191-5/+1
|
* object: fix attribute comparisonPatrick McHardy2010-04-191-2/+14
| | | | | | | | | Currently two attributes are regarded as different if they are absent in both objects to be compared. This is obviously incorrect, change to regard objects as different if an attribute is only present on one of them or if the attribute data differs. Signed-off-by: Patrick McHardy <kaber@trash.net>
* addr: restore anycast functionsPatrick McHardy2010-04-191-0/+3
| | | | | | Seems it got lost during some cleanups. Signed-off-by: Patrick McHardy <kaber@trash.net>
* new function nfnl_queue_msg_send_verdict_payload()Karl Hiramoto2010-03-101-1/+3
| | | | | | | | | nfnl_queue_msg_send_verdict_payload() will to send the verdict, mark, and possibly changed payload through the netlink socket. Add a few docbook comments in other funcs. Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
* new feature nl_send_iovec(), nl_auto_complete() and code refactoring.Karl Hiramoto2010-03-101-0/+4
| | | | | | | | | | | | | Create new function nl_send_iovec() to be used to send multiple 'struct iovec' through the netlink socket. This will be used for NF_QUEUE, to send packet payload of a modified packet. Refactor nl_send() to use nl_send_iovec() sending a single struct iovec. Create new function nl_auto_complete() by refactoring nl_send_auto_complete(), so other functions that call nl_send may also use nl_auto_complete() Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
* CLI - Command Line Interface LibraryThomas Graf2009-12-168-0/+286
| | | | | Moved common code in src/ used by CLI tools to src/lib/ for possible use by other CLI tools. Just link to libnl-cli.{so|la}
* Merge branch 'master' of git://dev.medozas.de/libnlThomas Graf2009-09-022-42/+67
|\ | | | | | | | | | | Conflicts: lib/Makefile src/Makefile
| * Move to automake-based buildJan Engelhardt2009-06-222-42/+67
| | | | | | | | | | | | | | | | | | | | | | | | Issues solved: * PACKAGE_VERSION was abused for SOVERSION * unneeded DEP stage * did not support out-of-tree builds * no way to turn off silent mode * overriding CFLAGS at make time was not supported * no static libs were provided Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* | Add support for getting and deleting queueing classes.olc2009-09-021-0/+5
| |
* | - Reworked the classifier interface.Thomas Graf2009-09-0210-12/+299
| | | | | | | | | | | | - Added initial ematch support - Added support for the basic classifier - Added support for the cgroup classifier
* | Declare struct ucred in handlers.h and netlink.hPavel Roskin2009-07-202-0/+3
|/ | | | | | Both files refer to it. The sources including those files are not guaranteed to include sys/socket.h to ensure that struct ucred is defined.
* nl_object_priv() is inline, so define it in the headerPavel Roskin2009-04-161-1/+5
|
* Remove obsoleted struct nl_handle definitionThomas Graf2008-12-101-3/+0
|
* Consistent naming of socket functionsThomas Graf2008-12-101-42/+32
|
* Allow to pass multiple group values to membership functionsHolger Eitzenberger2008-12-031-4/+12
| | | | | | | | | | | | | | | Instead of calling the membership functions several times it is helpfull to extend the API and make the single group functions a special case. The value 0 (NFNLGRP_NONE) terminates this list. Example use: nl_socket_add_memberships(sock, group_1, group_2, 0); nl_socket_drop_memberships(sock, group_1, group_2, 0); Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
* libnl: nfqueue: add nfqueue specific socket allocation functionPatrick McHardy2008-10-231-0/+2
| | | | | | | | | | | | | | | | | commit e92539843a0c7e5116254382626cce226bf2135e Author: Patrick McHardy <kaber@trash.net> Date: Thu Oct 23 13:46:16 2008 +0200 libnl: nfqueue: add nfqueue specific socket allocation function nfqueue users usually send verdict messages from the receive callback. When waiting for ACKs, the receive callback might be called again recursively until the stack blows up. Add a nfqueue specific socket allocation function that automatically disables ACKing for the socket. Signed-off-by: Patrick McHardy <kaber@trash.net>
* Add internal wait_for_ack() which only waits for ACK if !NL_NO_AUTO_ACKThomas Graf2008-10-201-0/+8
| | | | | This changeset ensures that internal code properly synchronizes to ACKs if ACKs are enabled and otherwise return immediately.
* Add socket flag NL_NO_AUTO_ACK to allow disabling auto ACKSThomas Graf2008-10-202-0/+3
|
* Error handling for rtnl_cls_set_kind() & addition of rtnl_cls_get_ops()Thomas Graf2008-10-151-1/+2
|
* Use 16bit ints for classifier prio/protocolThomas Graf2008-10-152-6/+6
|
* Replace NL_KEEP code with proper message reference countingThomas Graf2008-10-143-18/+2
| | | | | | Adds reference counting to netlink messages so callbacks can hold on to a message without using the broken keep message flag.
* From: Kees Cook <kees@outflux.net>Thomas Graf2008-10-101-0/+1
| | | | | | Hello! It seems that libnl is missing an include for limits.h, which causes it to FTBFS when glibc 2.8 is installed (currently in experimental, so I left this bug severity at "normal").
* libnl: fix about 100 warningsHolger Schurig2008-08-181-0/+1
| | | | | | | | | | | | | In file included from addr.c:28: ../include/netlink-local.h:119:1: warning: "__deprecated" redefined In file included from /usr/include/linux/stddef.h:4, from /usr/include/linux/posix_types.h:4, from /usr/include/linux/types.h:8, from ../include/netlink-local.h:37, from addr.c:28: /usr/include/linux/compiler.h:45:1: warning: this is the location of the previous definition This happens about 100 times. Suggested patch:
* Remove XML dumpingThomas Graf2008-06-171-1/+0
| | | | Bloats the library, not frequently used
* Fix compile errors when linking against libnl-genlThomas Graf2008-06-172-9/+9
|
* Improvements to address utilitiesThomas Graf2008-06-171-0/+7
| | | | | | - Moved env var dumping to nl-addr-list.c - support for ipv6 lifetimes - correct and complete help texts
* <netlink/addr.h> requires <netdb.h>Thomas Graf2008-06-171-0/+1
|
* Need <linux/in_route.h>Thomas Graf2008-06-161-0/+1
|
* Extend nl_time2int() and rename it to nl_str2msec()Thomas Graf2008-06-161-0/+1
| | | | Support parsing of more complex time duration input.
* Introduce nla_strdup() to help parse strings attributesThomas Graf2008-06-131-0/+1
|
* Remove unused dp_dump_line()Thomas Graf2008-05-261-2/+0
|
* Update linux/rtnetlink.h to upstream versionThomas Graf2008-05-261-2/+3
|
* Remove old line counting while dumpingThomas Graf2008-05-238-29/+16
|
* Present port and icmp values in host byte order and beautify printingThomas Graf2008-05-221-0/+2
| | | | | | | | This changes make nfnl_ct_get_src_port() and others return the value in host byte order rather than in network byte order. Also splits printing into details and statistical section and improves readability.