6 #include <netlink/cli/utils.h>
7 #include <netlink/cli/tc.h>
8 #include <netlink/route/qdisc/fifo.h>
10 static void print_usage(
void)
13 "Usage: nl-qdisc-add [...] bfifo [OPTIONS]...\n"
16 " --help Show this help text.\n"
17 " --limit=LIMIT Maximum queue length in number of bytes.\n"
20 " # Attach bfifo with a 4KB bytes limit to eth1\n"
21 " nl-qdisc-add --dev=eth1 --parent=root bfifo --limit=4096\n");
24 static void bfifo_parse_argv(
struct rtnl_tc *tc,
int argc,
char **argv)
26 struct rtnl_qdisc *qdisc = (
struct rtnl_qdisc *) tc;
34 static struct option long_opts[] = {
35 {
"help", 0, 0,
'h' },
36 {
"limit", 1, 0, ARG_LIMIT },
40 c = getopt_long(argc, argv,
"h", long_opts, &optidx);
53 "\"%s\": Invalid format.", optarg);
65 .tm_type = RTNL_TC_TYPE_QDISC,
66 .tm_parse_argv = bfifo_parse_argv,
69 static void __init bfifo_init(
void)
71 nl_cli_tc_register(&bfifo_module);
74 static void __exit bfifo_exit(
void)
76 nl_cli_tc_unregister(&bfifo_module);
void nl_cli_fatal(int err, const char *fmt,...)
Print error message and quit application.
int rtnl_qdisc_fifo_set_limit(struct rtnl_qdisc *qdisc, int limit)
Set limit of FIFO qdisc.
long nl_size2int(const char *str)
Convert a character string to a size.