Thomas Graf [Mon, 21 Mar 2011 14:51:52 +0000 (15:51 +0100)]
Unified TC API
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.
Thomas Graf [Fri, 19 Nov 2010 01:25:37 +0000 (02:25 +0100)]
Documentation updates
- moved documentation from lib/doc.c to doc/src/
- splitted pages into separate files
- worked over core sections, explaining the receiving and sending
behaviour in much more details including the the available
mechanisms to customize the behaviour
- updated the html stylesheet file for increased readability, probably
needs some doxygen patching to achieve what I am looking for.
- enabled call graphs, not expanded by default
Thomas Graf [Tue, 16 Nov 2010 11:41:43 +0000 (12:41 +0100)]
link: AF_INET link module
Note: The code for this is not upstream yet.
Extends the link api to allow address family modules to fill a link
message and implements a AF_INET address family link module which
uses the new interface.
Thomas Graf [Thu, 11 Nov 2010 14:50:49 +0000 (15:50 +0100)]
link: API for address family specific link data
Introduces a new API to handle address familiy specific link data such as
IFLA_PROTINFO. It provides entry hooks for parsing IFLA_PROTINFO attributes
and allows to include the parsed data when a link object is dumped.
Thomas Graf [Thu, 11 Nov 2010 12:57:10 +0000 (13:57 +0100)]
link: Support IFLA_IFALIAS attribute
- 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
Thomas Graf [Mon, 1 Nov 2010 07:17:40 +0000 (08:17 +0100)]
classid auto generation if provided tc name does not exist
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
Patrick McHardy [Mon, 25 Oct 2010 15:32:23 +0000 (17:32 +0200)]
src/nf-queue: revert nonsensical change
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.
Thomas Graf [Thu, 28 Oct 2010 22:20:42 +0000 (00:20 +0200)]
Tons of ematch work
- 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)
Thomas Graf [Thu, 28 Oct 2010 22:17:07 +0000 (00:17 +0200)]
Fix use of uninitialized data at the end of netlink message
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.
Thomas Graf [Tue, 26 Oct 2010 23:21:50 +0000 (01:21 +0200)]
Packet location updates
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.
Thomas Graf [Tue, 26 Oct 2010 10:54:33 +0000 (12:54 +0200)]
Unified TC attributes interface
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.
Thomas Graf [Wed, 20 Oct 2010 13:32:45 +0000 (15:32 +0200)]
Remove NL_DUMP_ENV code
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.
Thomas Graf [Wed, 20 Oct 2010 12:57:39 +0000 (14:57 +0200)]
nl-class-add tool
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.
Thomas Graf [Tue, 19 Oct 2010 14:31:23 +0000 (16:31 +0200)]
classid database
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.