2 * net/sched/act_api.c Packet action API.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Author: Jamal Hadi Salim
14 #include <linux/types.h>
15 #include <linux/kernel.h>
16 #include <linux/string.h>
17 #include <linux/errno.h>
18 #include <linux/slab.h>
19 #include <linux/skbuff.h>
20 #include <linux/init.h>
21 #include <linux/kmod.h>
22 #include <linux/err.h>
23 #include <linux/module.h>
24 #include <net/net_namespace.h>
26 #include <net/sch_generic.h>
27 #include <net/act_api.h>
28 #include <net/netlink.h>
30 void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo)
32 spin_lock_bh(&hinfo->lock);
33 hlist_del(&p->tcfc_head);
34 spin_unlock_bh(&hinfo->lock);
35 gen_kill_estimator(&p->tcfc_bstats,
38 * gen_estimator est_timer() might access p->tcfc_lock
39 * or bstats, wait a RCU grace period before freeing p
41 kfree_rcu(p, tcfc_rcu);
43 EXPORT_SYMBOL(tcf_hash_destroy);
45 int tcf_hash_release(struct tcf_common *p, int bind,
46 struct tcf_hashinfo *hinfo)
55 if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) {
56 tcf_hash_destroy(p, hinfo);
62 EXPORT_SYMBOL(tcf_hash_release);
64 static int tcf_dump_walker(struct sk_buff *skb, struct netlink_callback *cb,
65 struct tc_action *a, struct tcf_hashinfo *hinfo)
67 struct hlist_head *head;
69 int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
72 spin_lock_bh(&hinfo->lock);
76 for (i = 0; i < (hinfo->hmask + 1); i++) {
77 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)];
79 hlist_for_each_entry_rcu(p, head, tcfc_head) {
86 nest = nla_nest_start(skb, a->order);
89 err = tcf_action_dump_1(skb, a, 0, 0);
92 nlmsg_trim(skb, nest);
95 nla_nest_end(skb, nest);
97 if (n_i >= TCA_ACT_MAX_PRIO)
102 spin_unlock_bh(&hinfo->lock);
108 nla_nest_cancel(skb, nest);
112 static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a,
113 struct tcf_hashinfo *hinfo)
115 struct hlist_head *head;
116 struct hlist_node *n;
117 struct tcf_common *p;
121 nest = nla_nest_start(skb, a->order);
123 goto nla_put_failure;
124 if (nla_put_string(skb, TCA_KIND, a->ops->kind))
125 goto nla_put_failure;
126 for (i = 0; i < (hinfo->hmask + 1); i++) {
127 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)];
128 hlist_for_each_entry_safe(p, n, head, tcfc_head) {
129 if (ACT_P_DELETED == tcf_hash_release(p, 0, hinfo))
130 module_put(a->ops->owner);
134 if (nla_put_u32(skb, TCA_FCNT, n_i))
135 goto nla_put_failure;
136 nla_nest_end(skb, nest);
140 nla_nest_cancel(skb, nest);
144 int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
145 int type, struct tc_action *a)
147 struct tcf_hashinfo *hinfo = a->ops->hinfo;
149 if (type == RTM_DELACTION) {
150 return tcf_del_walker(skb, a, hinfo);
151 } else if (type == RTM_GETACTION) {
152 return tcf_dump_walker(skb, cb, a, hinfo);
154 WARN(1, "tcf_generic_walker: unknown action %d\n", type);
158 EXPORT_SYMBOL(tcf_generic_walker);
160 struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo)
162 struct tcf_common *p = NULL;
163 struct hlist_head *head;
165 spin_lock_bh(&hinfo->lock);
166 head = &hinfo->htab[tcf_hash(index, hinfo->hmask)];
167 hlist_for_each_entry_rcu(p, head, tcfc_head)
168 if (p->tcfc_index == index)
170 spin_unlock_bh(&hinfo->lock);
174 EXPORT_SYMBOL(tcf_hash_lookup);
176 u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo)
183 } while (tcf_hash_lookup(val, hinfo));
188 EXPORT_SYMBOL(tcf_hash_new_index);
190 int tcf_hash_search(struct tc_action *a, u32 index)
192 struct tcf_hashinfo *hinfo = a->ops->hinfo;
193 struct tcf_common *p = tcf_hash_lookup(index, hinfo);
201 EXPORT_SYMBOL(tcf_hash_search);
203 struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, int bind,
204 struct tcf_hashinfo *hinfo)
206 struct tcf_common *p = NULL;
207 if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) {
215 EXPORT_SYMBOL(tcf_hash_check);
217 struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
218 struct tc_action *a, int size, int bind,
219 u32 *idx_gen, struct tcf_hashinfo *hinfo)
221 struct tcf_common *p = kzalloc(size, GFP_KERNEL);
224 return ERR_PTR(-ENOMEM);
229 spin_lock_init(&p->tcfc_lock);
230 INIT_HLIST_NODE(&p->tcfc_head);
231 p->tcfc_index = index ? index : tcf_hash_new_index(idx_gen, hinfo);
232 p->tcfc_tm.install = jiffies;
233 p->tcfc_tm.lastuse = jiffies;
235 int err = gen_new_estimator(&p->tcfc_bstats, &p->tcfc_rate_est,
243 a->priv = (void *) p;
246 EXPORT_SYMBOL(tcf_hash_create);
248 void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo)
250 unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask);
252 spin_lock_bh(&hinfo->lock);
253 hlist_add_head(&p->tcfc_head, &hinfo->htab[h]);
254 spin_unlock_bh(&hinfo->lock);
256 EXPORT_SYMBOL(tcf_hash_insert);
258 static struct tc_action_ops *act_base = NULL;
259 static DEFINE_RWLOCK(act_mod_lock);
261 int tcf_register_action(struct tc_action_ops *act)
263 struct tc_action_ops *a, **ap;
265 /* Must supply act, dump, cleanup and init */
266 if (!act->act || !act->dump || !act->cleanup || !act->init)
269 /* Supply defaults */
271 act->lookup = tcf_hash_search;
273 act->walk = tcf_generic_walker;
275 write_lock(&act_mod_lock);
276 for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) {
277 if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) {
278 write_unlock(&act_mod_lock);
284 write_unlock(&act_mod_lock);
287 EXPORT_SYMBOL(tcf_register_action);
289 int tcf_unregister_action(struct tc_action_ops *act)
291 struct tc_action_ops *a, **ap;
294 write_lock(&act_mod_lock);
295 for (ap = &act_base; (a = *ap) != NULL; ap = &a->next)
303 write_unlock(&act_mod_lock);
306 EXPORT_SYMBOL(tcf_unregister_action);
309 static struct tc_action_ops *tc_lookup_action_n(char *kind)
311 struct tc_action_ops *a = NULL;
314 read_lock(&act_mod_lock);
315 for (a = act_base; a; a = a->next) {
316 if (strcmp(kind, a->kind) == 0) {
317 if (!try_module_get(a->owner)) {
318 read_unlock(&act_mod_lock);
324 read_unlock(&act_mod_lock);
329 /* lookup by nlattr */
330 static struct tc_action_ops *tc_lookup_action(struct nlattr *kind)
332 struct tc_action_ops *a = NULL;
335 read_lock(&act_mod_lock);
336 for (a = act_base; a; a = a->next) {
337 if (nla_strcmp(kind, a->kind) == 0) {
338 if (!try_module_get(a->owner)) {
339 read_unlock(&act_mod_lock);
345 read_unlock(&act_mod_lock);
352 static struct tc_action_ops *tc_lookup_action_id(u32 type)
354 struct tc_action_ops *a = NULL;
357 read_lock(&act_mod_lock);
358 for (a = act_base; a; a = a->next) {
359 if (a->type == type) {
360 if (!try_module_get(a->owner)) {
361 read_unlock(&act_mod_lock);
367 read_unlock(&act_mod_lock);
373 int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
374 struct tcf_result *res)
376 const struct tc_action *a;
379 if (skb->tc_verd & TC_NCLS) {
380 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
384 list_for_each_entry(a, actions, list) {
387 ret = a->ops->act(skb, a, res);
388 if (TC_MUNGED & skb->tc_verd) {
389 /* copied already, allow trampling */
390 skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
391 skb->tc_verd = CLR_TC_MUNGED(skb->tc_verd);
393 if (ret == TC_ACT_REPEAT)
394 goto repeat; /* we need a ttl - JHS */
395 if (ret != TC_ACT_PIPE)
402 EXPORT_SYMBOL(tcf_action_exec);
404 void tcf_action_destroy(struct list_head *actions, int bind)
406 struct tc_action *a, *tmp;
408 list_for_each_entry_safe(a, tmp, actions, list) {
410 if (a->ops->cleanup(a, bind) == ACT_P_DELETED)
411 module_put(a->ops->owner);
415 /*FIXME: Remove later - catch insertion bugs*/
416 WARN(1, "tcf_action_destroy: BUG? destroying NULL ops\n");
424 tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
430 return a->ops->dump(skb, a, bind, ref);
434 tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
437 unsigned char *b = skb_tail_pointer(skb);
443 if (nla_put_string(skb, TCA_KIND, a->ops->kind))
444 goto nla_put_failure;
445 if (tcf_action_copy_stats(skb, a, 0))
446 goto nla_put_failure;
447 nest = nla_nest_start(skb, TCA_OPTIONS);
449 goto nla_put_failure;
450 err = tcf_action_dump_old(skb, a, bind, ref);
452 nla_nest_end(skb, nest);
460 EXPORT_SYMBOL(tcf_action_dump_1);
463 tcf_action_dump(struct sk_buff *skb, struct list_head *actions, int bind, int ref)
469 list_for_each_entry(a, actions, list) {
470 nest = nla_nest_start(skb, a->order);
472 goto nla_put_failure;
473 err = tcf_action_dump_1(skb, a, bind, ref);
476 nla_nest_end(skb, nest);
484 nla_nest_cancel(skb, nest);
488 struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
489 struct nlattr *est, char *name, int ovr,
493 struct tc_action_ops *a_o;
494 char act_name[IFNAMSIZ];
495 struct nlattr *tb[TCA_ACT_MAX + 1];
500 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
504 kind = tb[TCA_ACT_KIND];
507 if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
511 if (strlcpy(act_name, name, IFNAMSIZ) >= IFNAMSIZ)
515 a_o = tc_lookup_action_n(act_name);
517 #ifdef CONFIG_MODULES
519 request_module("act_%s", act_name);
522 a_o = tc_lookup_action_n(act_name);
524 /* We dropped the RTNL semaphore in order to
525 * perform the module load. So, even if we
526 * succeeded in loading the module we have to
527 * tell the caller to replay the request. We
528 * indicate this using -EAGAIN.
540 a = kzalloc(sizeof(*a), GFP_KERNEL);
544 INIT_LIST_HEAD(&a->list);
545 /* backward compatibility for policer */
547 err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, a, ovr, bind);
549 err = a_o->init(net, nla, est, a, ovr, bind);
553 /* module count goes up only when brand new policy is created
554 * if it exists and is only bound to in a_o->init() then
555 * ACT_P_CREATED is not returned (a zero is).
557 if (err != ACT_P_CREATED)
558 module_put(a_o->owner);
566 module_put(a_o->owner);
571 int tcf_action_init(struct net *net, struct nlattr *nla,
572 struct nlattr *est, char *name, int ovr,
573 int bind, struct list_head *actions)
575 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
576 struct tc_action *act;
580 err = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL);
584 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
585 act = tcf_action_init_1(net, tb[i], est, name, ovr, bind);
591 list_add_tail(&act->list, actions);
596 tcf_action_destroy(actions, bind);
600 int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
605 struct tcf_act_hdr *h = a->priv;
610 /* compat_mode being true specifies a call that is supposed
611 * to add additional backward compatibility statistic TLVs.
614 if (a->type == TCA_OLD_COMPAT)
615 err = gnet_stats_start_copy_compat(skb, 0,
616 TCA_STATS, TCA_XSTATS, &h->tcf_lock, &d);
620 err = gnet_stats_start_copy(skb, TCA_ACT_STATS,
626 if (gnet_stats_copy_basic(&d, &h->tcf_bstats) < 0 ||
627 gnet_stats_copy_rate_est(&d, &h->tcf_bstats,
628 &h->tcf_rate_est) < 0 ||
629 gnet_stats_copy_queue(&d, &h->tcf_qstats) < 0)
632 if (gnet_stats_finish_copy(&d) < 0)
642 tca_get_fill(struct sk_buff *skb, struct list_head *actions, u32 portid, u32 seq,
643 u16 flags, int event, int bind, int ref)
646 struct nlmsghdr *nlh;
647 unsigned char *b = skb_tail_pointer(skb);
650 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
654 t->tca_family = AF_UNSPEC;
658 nest = nla_nest_start(skb, TCA_ACT_TAB);
662 if (tcf_action_dump(skb, actions, bind, ref) < 0)
665 nla_nest_end(skb, nest);
667 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
676 act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
677 struct list_head *actions, int event)
681 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
684 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, event, 0, 0) <= 0) {
689 return rtnl_unicast(skb, net, portid);
692 static struct tc_action *
693 tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 portid)
695 struct nlattr *tb[TCA_ACT_MAX + 1];
700 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
705 if (tb[TCA_ACT_INDEX] == NULL ||
706 nla_len(tb[TCA_ACT_INDEX]) < sizeof(index))
708 index = nla_get_u32(tb[TCA_ACT_INDEX]);
711 a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
715 INIT_LIST_HEAD(&a->list);
717 a->ops = tc_lookup_action(tb[TCA_ACT_KIND]);
721 if (a->ops->lookup(a, index) == 0)
724 module_put(a->ops->owner);
728 module_put(a->ops->owner);
735 static void cleanup_a(struct list_head *actions)
737 struct tc_action *a, *tmp;
739 list_for_each_entry_safe(a, tmp, actions, list) {
745 static struct tc_action *create_a(int i)
747 struct tc_action *act;
749 act = kzalloc(sizeof(*act), GFP_KERNEL);
751 pr_debug("create_a: failed to alloc!\n");
755 INIT_LIST_HEAD(&act->list);
759 static int tca_action_flush(struct net *net, struct nlattr *nla,
760 struct nlmsghdr *n, u32 portid)
764 struct nlmsghdr *nlh;
766 struct netlink_callback dcb;
768 struct nlattr *tb[TCA_ACT_MAX + 1];
770 struct tc_action *a = create_a(0);
774 pr_debug("tca_action_flush: couldnt create tc_action\n");
778 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
780 pr_debug("tca_action_flush: failed skb alloc\n");
785 b = skb_tail_pointer(skb);
787 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
792 kind = tb[TCA_ACT_KIND];
793 a->ops = tc_lookup_action(kind);
797 nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t), 0);
801 t->tca_family = AF_UNSPEC;
805 nest = nla_nest_start(skb, TCA_ACT_TAB);
809 err = a->ops->walk(skb, &dcb, RTM_DELACTION, a);
815 nla_nest_end(skb, nest);
817 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
818 nlh->nlmsg_flags |= NLM_F_ROOT;
819 module_put(a->ops->owner);
821 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
822 n->nlmsg_flags & NLM_F_ECHO);
829 module_put(a->ops->owner);
838 tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
839 u32 portid, int event)
842 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
843 struct tc_action *act;
846 ret = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL);
850 if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
852 return tca_action_flush(net, tb[1], n, portid);
857 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
858 act = tcf_action_get_1(tb[i], n, portid);
864 list_add_tail(&act->list, &actions);
867 if (event == RTM_GETACTION)
868 ret = act_get_notify(net, portid, n, &actions, event);
872 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
878 if (tca_get_fill(skb, &actions, portid, n->nlmsg_seq, 0, event,
885 /* now do the delete */
886 tcf_action_destroy(&actions, 0);
887 ret = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
888 n->nlmsg_flags & NLM_F_ECHO);
898 static int tcf_add_notify(struct net *net, struct list_head *actions,
899 u32 portid, u32 seq, int event, u16 flags)
902 struct nlmsghdr *nlh;
908 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
912 b = skb_tail_pointer(skb);
914 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
918 t->tca_family = AF_UNSPEC;
922 nest = nla_nest_start(skb, TCA_ACT_TAB);
926 if (tcf_action_dump(skb, actions, 0, 0) < 0)
929 nla_nest_end(skb, nest);
931 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
932 NETLINK_CB(skb).dst_group = RTNLGRP_TC;
934 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, flags & NLM_F_ECHO);
946 tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
951 u32 seq = n->nlmsg_seq;
953 ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
957 /* dump then free all the actions after update; inserted policy
960 ret = tcf_add_notify(net, &actions, portid, seq, RTM_NEWACTION, n->nlmsg_flags);
966 static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)
968 struct net *net = sock_net(skb->sk);
969 struct nlattr *tca[TCA_ACT_MAX + 1];
970 u32 portid = skb ? NETLINK_CB(skb).portid : 0;
971 int ret = 0, ovr = 0;
973 if ((n->nlmsg_type != RTM_GETACTION) && !capable(CAP_NET_ADMIN))
976 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
980 if (tca[TCA_ACT_TAB] == NULL) {
981 pr_notice("tc_ctl_action: received NO action attribs\n");
985 /* n->nlmsg_flags & NLM_F_CREATE */
986 switch (n->nlmsg_type) {
988 /* we are going to assume all other flags
989 * imply create only if it doesn't exist
990 * Note that CREATE | EXCL implies that
991 * but since we want avoid ambiguity (eg when flags
992 * is zero) then just set this
994 if (n->nlmsg_flags & NLM_F_REPLACE)
997 ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
1002 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1003 portid, RTM_DELACTION);
1006 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1007 portid, RTM_GETACTION);
1016 static struct nlattr *
1017 find_dump_kind(const struct nlmsghdr *n)
1019 struct nlattr *tb1, *tb2[TCA_ACT_MAX + 1];
1020 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
1021 struct nlattr *nla[TCAA_MAX + 1];
1022 struct nlattr *kind;
1024 if (nlmsg_parse(n, sizeof(struct tcamsg), nla, TCAA_MAX, NULL) < 0)
1026 tb1 = nla[TCA_ACT_TAB];
1030 if (nla_parse(tb, TCA_ACT_MAX_PRIO, nla_data(tb1),
1031 NLMSG_ALIGN(nla_len(tb1)), NULL) < 0)
1036 if (nla_parse(tb2, TCA_ACT_MAX, nla_data(tb[1]),
1037 nla_len(tb[1]), NULL) < 0)
1039 kind = tb2[TCA_ACT_KIND];
1045 tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1047 struct nlmsghdr *nlh;
1048 unsigned char *b = skb_tail_pointer(skb);
1049 struct nlattr *nest;
1050 struct tc_action_ops *a_o;
1053 struct tcamsg *t = (struct tcamsg *) nlmsg_data(cb->nlh);
1054 struct nlattr *kind = find_dump_kind(cb->nlh);
1057 pr_info("tc_dump_action: action bad kind\n");
1061 a_o = tc_lookup_action(kind);
1065 memset(&a, 0, sizeof(struct tc_action));
1068 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
1069 cb->nlh->nlmsg_type, sizeof(*t), 0);
1071 goto out_module_put;
1072 t = nlmsg_data(nlh);
1073 t->tca_family = AF_UNSPEC;
1077 nest = nla_nest_start(skb, TCA_ACT_TAB);
1079 goto out_module_put;
1081 ret = a_o->walk(skb, cb, RTM_GETACTION, &a);
1083 goto out_module_put;
1086 nla_nest_end(skb, nest);
1089 nla_nest_cancel(skb, nest);
1091 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1092 if (NETLINK_CB(cb->skb).portid && ret)
1093 nlh->nlmsg_flags |= NLM_F_MULTI;
1094 module_put(a_o->owner);
1098 module_put(a_o->owner);
1103 static int __init tc_action_init(void)
1105 rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL);
1106 rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL);
1107 rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action,
1113 subsys_initcall(tc_action_init);