summaryrefslogtreecommitdiffstats
path: root/src/nl-cls-add.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2011-03-21 14:51:52 (GMT)
committerThomas Graf <tgraf@suug.ch>2011-03-21 14:51:52 (GMT)
commit8eb5b5532eae985a5f0911dccf2db8cb4e0a5de4 (patch)
tree0fec48d114edbb535bd234f2684acccf81447d13 /src/nl-cls-add.c
parent5dc897d5de9f54078221b241e0122713207f5e0c (diff)
downloadlibnl-8eb5b5532eae985a5f0911dccf2db8cb4e0a5de4.zip
libnl-8eb5b5532eae985a5f0911dccf2db8cb4e0a5de4.tar.gz
libnl-8eb5b5532eae985a5f0911dccf2db8cb4e0a5de4.tar.bz2
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.
Diffstat (limited to 'src/nl-cls-add.c')
-rw-r--r--src/nl-cls-add.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nl-cls-add.c b/src/nl-cls-add.c
index fad9313..054bab3 100644
--- a/src/nl-cls-add.c
+++ b/src/nl-cls-add.c
@@ -5,7 +5,7 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2 of the License.
*
- * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch>
*/
#include <netlink/cli/utils.h>
@@ -56,8 +56,8 @@ int main(int argc, char *argv[])
.dp_type = NL_DUMP_DETAILS,
.dp_fd = stdout,
};
- struct nl_cli_cls_module *cm;
- struct rtnl_cls_ops *ops;
+ struct nl_cli_tc_module *tm;
+ struct rtnl_tc_ops *ops;
int err, flags = NLM_F_CREATE | NLM_F_EXCL;
char *kind, *id = NULL;
@@ -139,16 +139,15 @@ int main(int argc, char *argv[])
}
kind = argv[optind++];
- rtnl_cls_set_kind(cls, kind);
+ rtnl_tc_set_kind(tc, kind);
- if (!(ops = rtnl_cls_lookup_ops(cls)))
+ if (!(ops = rtnl_tc_get_ops(tc)))
nl_cli_fatal(ENOENT, "Unknown classifier \"%s\".", kind);
- if (!(cm = nl_cli_cls_lookup(ops)))
+ if (!(tm = nl_cli_tc_lookup(ops)))
nl_cli_fatal(ENOTSUP, "Classifier type \"%s\" not supported.", kind);
- if ((err = cm->cm_parse_argv(cls, argc, argv)) < 0)
- nl_cli_fatal(err, "Unable to parse classifier options");
+ tm->tm_parse_argv(tc, argc, argv);
if (!quiet) {
printf("Adding ");