6 #include <netlink/cli/utils.h>
7 #include <netlink/cli/tc.h>
9 static void print_usage(
void)
12 "Usage: nl-qdisc-add [...] blackhole [OPTIONS]...\n"
15 " --help Show this help text.\n"
18 " # Drop all outgoing packets on eth1\n"
19 " nl-qdisc-add --dev=eth1 --parent=root blackhole\n");
22 static void blackhole_parse_argv(
struct rtnl_tc *tc,
int argc,
char **argv)
26 static struct option long_opts[] = {
27 {
"help", 0, 0,
'h' },
31 c = getopt_long(argc, argv,
"h", long_opts, &optidx);
45 .tm_name =
"blackhole",
46 .tm_type = RTNL_TC_TYPE_QDISC,
47 .tm_parse_argv = blackhole_parse_argv,
50 static void __init blackhole_init(
void)
52 nl_cli_tc_register(&blackhole_module);
55 static void __exit blackhole_exit(
void)
57 nl_cli_tc_unregister(&blackhole_module);