summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2010-10-20 12:57:39 (GMT)
committerThomas Graf <tgraf@suug.ch>2010-10-20 12:57:39 (GMT)
commit27883b0f9b0da6bb33ccc185107a2870df25d030 (patch)
treefbda57a6026fbc6653648ecb9d588d2d9e938b5e /include
parent18848090f99cae37ac1a3052369ab4d26ed9ada0 (diff)
downloadlibnl-27883b0f9b0da6bb33ccc185107a2870df25d030.zip
libnl-27883b0f9b0da6bb33ccc185107a2870df25d030.tar.gz
libnl-27883b0f9b0da6bb33ccc185107a2870df25d030.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/netlink/cli/class.h29
-rw-r--r--include/netlink/cli/qdisc.h7
2 files changed, 34 insertions, 2 deletions
diff --git a/include/netlink/cli/class.h b/include/netlink/cli/class.h
new file mode 100644
index 0000000..9c17761
--- /dev/null
+++ b/include/netlink/cli/class.h
@@ -0,0 +1,29 @@
+/*
+ * netlink/cli/class.h CLI Class Helpers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_CLASS_H_
+#define __NETLINK_CLI_CLASS_H_
+
+#include <netlink/route/class.h>
+#include <netlink/route/class-modules.h>
+
+#define nl_cli_class_alloc_cache(sk) \
+ nl_cli_alloc_cache((sk), "traffic classes", \
+ rtnl_class_alloc_cache)
+
+extern struct rtnl_class *nl_cli_class_alloc(void);
+
+extern void nl_cli_class_parse_dev(struct rtnl_class *, struct nl_cache *, char *);
+extern void nl_cli_class_parse_parent(struct rtnl_class *, char *);
+extern void nl_cli_class_parse_handle(struct rtnl_class *, char *);
+extern void nl_cli_class_parse_kind(struct rtnl_class *, char *);
+
+#endif
diff --git a/include/netlink/cli/qdisc.h b/include/netlink/cli/qdisc.h
index 78b08dc..537e1a9 100644
--- a/include/netlink/cli/qdisc.h
+++ b/include/netlink/cli/qdisc.h
@@ -6,7 +6,7 @@
* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch>
*/
#ifndef __NETLINK_CLI_QDISC_H_
@@ -23,11 +23,14 @@ struct nl_cli_qdisc_module
{
const char * qm_name;
struct rtnl_qdisc_ops * qm_ops;
- void (*qm_parse_argv)(struct rtnl_qdisc *, int, char **);
+ struct rtnl_class_ops * qm_class_ops;
+ void (*qm_parse_qdisc_argv)(struct rtnl_qdisc *, int, char **);
+ void (*qm_parse_class_argv)(struct rtnl_class *, int, char **);
struct nl_list_head qm_list;
};
extern struct nl_cli_qdisc_module *nl_cli_qdisc_lookup(struct rtnl_qdisc_ops *);
+extern struct nl_cli_qdisc_module *nl_cli_qdisc_lookup_by_class(struct rtnl_class_ops *);
extern void nl_cli_qdisc_register(struct nl_cli_qdisc_module *);
extern void nl_cli_qdisc_unregister(struct nl_cli_qdisc_module *);