dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

5 Commits

Author SHA1 Message Date
Thomas Graf c4f803366e Fix build warnings of nl-(qdisc|class|cls)-add
Reported-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-24 14:10:33 +01:00
Thomas Graf 8eb5b5532e 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.

I hope I got it right this time.
2011-03-21 15:51:52 +01:00
Thomas Graf 4267d8f336 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
2010-11-01 08:17:40 +01:00
Thomas Graf 4c6d1c5dfb 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.
2010-10-26 12:54:33 +02:00
Thomas Graf 27883b0f9b 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.

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
2010-10-20 14:57:39 +02:00