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 [...] pfifo [OPTIONS]...\n"
16 " --help Show this help text.\n"
17 " --limit=LIMIT Maximum queue length in number of packets.\n"
20 " # Attach pfifo with a 32 packet limit to eth1\n"
21 " nl-qdisc-add --dev=eth1 --parent=root pfifo --limit=32\n");
24 static void pfifo_parse_argv(
struct rtnl_tc *tc,
int argc,
char **argv)
26 struct rtnl_qdisc *qdisc = (
struct rtnl_qdisc *) tc;
33 static struct option long_opts[] = {
34 {
"help", 0, 0,
'h' },
35 {
"limit", 1, 0, ARG_LIMIT },
39 c = getopt_long(argc, argv,
"h", long_opts, &optidx);
58 .tm_type = RTNL_TC_TYPE_QDISC,
59 .tm_parse_argv = pfifo_parse_argv,
62 static void __init pfifo_init(
void)
64 nl_cli_tc_register(&pfifo_module);
67 static void __exit pfifo_exit(
void)
69 nl_cli_tc_unregister(&pfifo_module);
uint32_t nl_cli_parse_u32(const char *arg)
Parse a text based 32 bit unsigned integer argument.
int rtnl_qdisc_fifo_set_limit(struct rtnl_qdisc *qdisc, int limit)
Set limit of FIFO qdisc.