diff options
author | Thomas Graf <tgraf@suug.ch> | 2010-10-26 10:54:33 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2010-10-26 10:54:33 (GMT) |
commit | 4c6d1c5dfb4f7e4a9392895f3da709b55c970e02 (patch) | |
tree | 9303851dcc87e2e3f9c25805ccf24f4a543fe23d /src/nl-qdisc-delete.c | |
parent | b9d965b01b42103389b2a2c0cc3133293447a64d (diff) | |
download | libnl-4c6d1c5dfb4f7e4a9392895f3da709b55c970e02.zip libnl-4c6d1c5dfb4f7e4a9392895f3da709b55c970e02.tar.gz libnl-4c6d1c5dfb4f7e4a9392895f3da709b55c970e02.tar.bz2 |
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.
Diffstat (limited to 'src/nl-qdisc-delete.c')
-rw-r--r-- | src/nl-qdisc-delete.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nl-qdisc-delete.c b/src/nl-qdisc-delete.c index 24424a7..e91b054 100644 --- a/src/nl-qdisc-delete.c +++ b/src/nl-qdisc-delete.c @@ -10,6 +10,7 @@ */ #include <netlink/cli/utils.h> +#include <netlink/cli/tc.h> #include <netlink/cli/qdisc.h> #include <netlink/cli/link.h> @@ -63,6 +64,7 @@ static void delete_cb(struct nl_object *obj, void *arg) int main(int argc, char *argv[]) { struct rtnl_qdisc *qdisc; + struct rtnl_tc *tc; struct nl_cache *link_cache, *qdisc_cache; int nfilter = 0; @@ -71,6 +73,7 @@ int main(int argc, char *argv[]) link_cache = nl_cli_link_alloc_cache(sock); qdisc_cache = nl_cli_qdisc_alloc_cache(sock); qdisc = nl_cli_qdisc_alloc(); + tc = (struct rtnl_tc *) qdisc; for (;;) { int c, optidx = 0; @@ -104,15 +107,15 @@ int main(int argc, char *argv[]) case 'v': nl_cli_print_version(); break; case 'd': nfilter++; - nl_cli_qdisc_parse_dev(qdisc, link_cache, optarg); + nl_cli_tc_parse_dev(tc, link_cache, optarg); break; case 'p': nfilter++; - nl_cli_qdisc_parse_parent(qdisc, optarg); + nl_cli_tc_parse_parent(tc, optarg); break; case 'i': nfilter++; - nl_cli_qdisc_parse_handle(qdisc, optarg); + nl_cli_tc_parse_handle(tc, optarg); break; case 'k': nfilter++; |