8#include <netlink/cli/utils.h>
9#include <netlink/cli/tc.h>
10#include <netlink/cli/cls.h>
11#include <netlink/route/cls/cgroup.h>
13static void print_usage(
void)
16"Usage: nl-cls-add [...] cgroup [OPTIONS]...\n"
19" -h, --help Show this help text.\n"
20" -e, --ematch=EXPR Ematch expression\n"
23" nl-cls-add --dev=eth0 --parent=q_root cgroup\n");
26static void parse_argv(
struct rtnl_tc *tc,
int argc,
char **argv)
28 struct rtnl_cls *cls = (
struct rtnl_cls *) tc;
29 struct rtnl_ematch_tree *tree;
33 static struct option long_opts[] = {
34 {
"help", 0, 0,
'h' },
35 {
"ematch", 1, 0,
'e' },
39 c = getopt_long(argc, argv,
"he:", long_opts, &optidx);
49 tree = nl_cli_cls_parse_ematch(cls, optarg);
50 rtnl_cgroup_set_ematch(cls, tree);
59 .tm_type = RTNL_TC_TYPE_CLS,
60 .tm_parse_argv = parse_argv,
63static void _nl_init cgroup_init(
void)
65 nl_cli_tc_register(&cgroup_module);
68static void _nl_exit cgroup_exit(
void)
70 nl_cli_tc_unregister(&cgroup_module);