diff options
author | Thomas Graf <tgraf@suug.ch> | 2010-10-19 11:06:42 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2010-10-19 11:06:42 (GMT) |
commit | c0cd587dfc46ca8e8e5f9da51e878e0678950f23 (patch) | |
tree | 10aaa6c61ac3416f2fd579c3d05c9210c7d4ef83 /include | |
parent | 3229b32e39363c439f0d042b561417e7b48aa786 (diff) | |
download | libnl-c0cd587dfc46ca8e8e5f9da51e878e0678950f23.zip libnl-c0cd587dfc46ca8e8e5f9da51e878e0678950f23.tar.gz libnl-c0cd587dfc46ca8e8e5f9da51e878e0678950f23.tar.bz2 |
nl-qdisc-add tool
Adds a cli based tool to add/update/replace qdiscs. This tool requires
each qdisc to be supported via a dynamic loadable module in
pkglibdir/cli/qdisc/$name.so.
So far HTB and blackhole have been implemented.
Syntax:
nl-qdisc-add --dev eth2 --parent root --id 1: htb --r2q=5
nl-qdisc-add --update-only --dev eth2 --id 1: htb --r2q=10
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/cli/qdisc.h | 13 | ||||
-rw-r--r-- | include/netlink/cli/utils.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/netlink/cli/qdisc.h b/include/netlink/cli/qdisc.h index 9fc4506..78b08dc 100644 --- a/include/netlink/cli/qdisc.h +++ b/include/netlink/cli/qdisc.h @@ -13,11 +13,24 @@ #define __NETLINK_CLI_QDISC_H_ #include <netlink/route/qdisc.h> +#include <netlink/route/qdisc-modules.h> #define nl_cli_qdisc_alloc_cache(sk) \ nl_cli_alloc_cache((sk), "queueing disciplines", \ rtnl_qdisc_alloc_cache) +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 nl_list_head qm_list; +}; + +extern struct nl_cli_qdisc_module *nl_cli_qdisc_lookup(struct rtnl_qdisc_ops *); +extern void nl_cli_qdisc_register(struct nl_cli_qdisc_module *); +extern void nl_cli_qdisc_unregister(struct nl_cli_qdisc_module *); + extern struct rtnl_qdisc *nl_cli_qdisc_alloc(void); extern void nl_cli_qdisc_parse_dev(struct rtnl_qdisc *, struct nl_cache *, char *); diff --git a/include/netlink/cli/utils.h b/include/netlink/cli/utils.h index 2a23208..da41c10 100644 --- a/include/netlink/cli/utils.h +++ b/include/netlink/cli/utils.h @@ -73,6 +73,8 @@ extern int nl_cli_confirm(struct nl_object *, extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *, int (*ac)(struct nl_sock *, struct nl_cache **)); +extern void nl_cli_load_module(const char *, const char *); + #ifdef __cplusplus } #endif |