summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Remove NL_DUMP_ENV codeThomas Graf2010-10-202-3/+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-207-2/+240
| | | | | | | | | | 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
* remove obsolete nl-qdisc-add codeThomas Graf2010-10-191-196/+0
|
* classid databaseThomas Graf2010-10-193-1/+85
| | | | | | | | | 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-194-3/+233
| | | | | | | | | | | | 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-141-3/+1
| | | | - Bump interface number, we will break API in the development tree
* automake: add ${top_builddir}/include to AM_CFLAGSAndreas Bießmann2010-10-132-2/+2
| | | | | | | | | | | 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-131-1/+1
| | | | | | | | 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.
* Packet Location InterfaceThomas Graf2010-07-022-1/+42
|
* src/nf-queue.c: cleanup and improve performance of test program for NF_QUEUEKarl Hiramoto2010-04-191-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | * Fix filename in file header * If the kernel or netlink socket becomes over loaded, the kernel starts printing error messages like: nf_queue: full at 1024 entries, dropping packets(s). Dropped: 1 nf_queue: full at 1024 entries, dropping packets(s). Dropped: 2 nf_queue: full at 1024 entries, dropping packets(s). Dropped: 3 So detect out of order packet ID's and set the NF_ACCEPT verdictÂ, so they will be removed from the kernel queue. * increase socket buffer to improve performance without these changes sending more than 100 KB/s over tcp HTTP lo(localhost) was difficult on my core2 duo machine, due to so many dropped packets. After these changes over 150 MB/s was easy. * improve help text Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
* CLI - Command Line Interface LibraryThomas Graf2009-12-1662-1454/+1212
| | | | | 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}
* libnl: fix automake breakagePatrick McHardy2009-11-101-2/+18
| | | | | | | | libnl-route must be handled before libnl-nf in lib_LTLIBRARIES since the later depends on the former. Additionally nf-monitor, nl-list-caches, nl-list-sockets and nl-util-addr have been dropped from the Makefile. Signed-off-by: Patrick McHardy <kaber@trash.net>
* - Compile with _GNU_SOURCEThomas Graf2009-09-031-1/+1
| | | | - Fixed classifier.c -> cls.c
* Merge branch 'master' of git://dev.medozas.de/libnlThomas Graf2009-09-022-66/+86
|\ | | | | | | | | | | Conflicts: lib/Makefile src/Makefile
| * build: make use of library dependenciesJan Engelhardt2009-07-051-25/+25
| |
| * Move to automake-based buildJan Engelhardt2009-06-232-62/+86
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | - Reworked the classifier interface.Thomas Graf2009-09-0210-1/+701
|/ | | | | | - Added initial ematch support - Added support for the basic classifier - Added support for the cgroup classifier
* Separate compiling from linkingPavel Roskin2009-04-161-3/+3
| | | | | This helps users understand where possible warnings come from. It also allows more find-grained control over the build flags.
* Include limits.h to fix undefined ULONG_MAX in src/utils.cPavel Roskin2009-04-161-0/+1
|
* libnl: fix socket function rename related build failurePatrick McHardy2009-01-214-4/+4
| | | | Signed-off-by: Patrick McHardy <kaber@trash.net>
* Remove obsoleted struct nl_handle definitionThomas Graf2008-12-106-6/+6
|
* libnl: nfqueue: add nfqueue specific socket allocation functionPatrick McHardy2008-10-231-1/+4
| | | | | | | | | | | | | | | | | 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>
* Explicitely link to nl-route when linking nf apps.Thomas Graf2008-08-191-1/+1
| | | | | ld won't resolve its own deps in -L../lib/ for some reason.
* Remove XML dumpingThomas Graf2008-06-172-3/+0
| | | | Bloats the library, not frequently used
* Fix compile errors when linking against libnl-genlThomas Graf2008-06-173-1/+2
|