8#include <netlink/cli/utils.h>
9#include <netlink/cli/tc.h>
10#include <netlink/route/qdisc/fifo.h>
12static void print_usage(
void)
15"Usage: nl-qdisc-add [...] pfifo [OPTIONS]...\n"
18" --help Show this help text.\n"
19" --limit=LIMIT Maximum queue length in number of packets.\n"
22" # Attach pfifo with a 32 packet limit to eth1\n"
23" nl-qdisc-add --dev=eth1 --parent=root pfifo --limit=32\n");
26static void pfifo_parse_argv(
struct rtnl_tc *tc,
int argc,
char **argv)
35 static struct option long_opts[] = {
36 {
"help", 0, 0,
'h' },
37 {
"limit", 1, 0, ARG_LIMIT },
41 c = getopt_long(argc, argv,
"h", long_opts, &optidx);
60 .tm_type = RTNL_TC_TYPE_QDISC,
61 .tm_parse_argv = pfifo_parse_argv,
64static void _nl_init pfifo_init(
void)
66 nl_cli_tc_register(&pfifo_module);
69static void _nl_exit pfifo_exit(
void)
71 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.