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 LIST_HEAD(act_base);
259 static DEFINE_RWLOCK(act_mod_lock);
261 int tcf_register_action(struct tc_action_ops *act)
263 struct tc_action_ops *a;
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 list_for_each_entry(a, &act_base, head) {
277 if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) {
278 write_unlock(&act_mod_lock);
282 list_add_tail(&act->head, &act_base);
283 write_unlock(&act_mod_lock);
286 EXPORT_SYMBOL(tcf_register_action);
288 int tcf_unregister_action(struct tc_action_ops *act)
290 struct tc_action_ops *a;
293 write_lock(&act_mod_lock);
294 list_for_each_entry(a, &act_base, head)
298 list_del(&act->head);
301 write_unlock(&act_mod_lock);
304 EXPORT_SYMBOL(tcf_unregister_action);
307 static struct tc_action_ops *tc_lookup_action_n(char *kind)
309 struct tc_action_ops *a = NULL;
312 read_lock(&act_mod_lock);
313 list_for_each_entry(a, &act_base, head) {
314 if (strcmp(kind, a->kind) == 0) {
315 if (!try_module_get(a->owner)) {
316 read_unlock(&act_mod_lock);
322 read_unlock(&act_mod_lock);
327 /* lookup by nlattr */
328 static struct tc_action_ops *tc_lookup_action(struct nlattr *kind)
330 struct tc_action_ops *a = NULL;
333 read_lock(&act_mod_lock);
334 list_for_each_entry(a, &act_base, head) {
335 if (nla_strcmp(kind, a->kind) == 0) {
336 if (!try_module_get(a->owner)) {
337 read_unlock(&act_mod_lock);
343 read_unlock(&act_mod_lock);
350 static struct tc_action_ops *tc_lookup_action_id(u32 type)
352 struct tc_action_ops *a = NULL;
355 read_lock(&act_mod_lock);
356 for (a = act_base; a; a = a->next) {
357 if (a->type == type) {
358 if (!try_module_get(a->owner)) {
359 read_unlock(&act_mod_lock);
365 read_unlock(&act_mod_lock);
371 int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
372 struct tcf_result *res)
374 const struct tc_action *a;
377 if (skb->tc_verd & TC_NCLS) {
378 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
382 list_for_each_entry(a, actions, list) {
385 ret = a->ops->act(skb, a, res);
386 if (TC_MUNGED & skb->tc_verd) {
387 /* copied already, allow trampling */
388 skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
389 skb->tc_verd = CLR_TC_MUNGED(skb->tc_verd);
391 if (ret == TC_ACT_REPEAT)
392 goto repeat; /* we need a ttl - JHS */
393 if (ret != TC_ACT_PIPE)
400 EXPORT_SYMBOL(tcf_action_exec);
402 void tcf_action_destroy(struct list_head *actions, int bind)
404 struct tc_action *a, *tmp;
406 list_for_each_entry_safe(a, tmp, actions, list) {
408 if (a->ops->cleanup(a, bind) == ACT_P_DELETED)
409 module_put(a->ops->owner);
413 /*FIXME: Remove later - catch insertion bugs*/
414 WARN(1, "tcf_action_destroy: BUG? destroying NULL ops\n");
422 tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
428 return a->ops->dump(skb, a, bind, ref);
432 tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
435 unsigned char *b = skb_tail_pointer(skb);
441 if (nla_put_string(skb, TCA_KIND, a->ops->kind))
442 goto nla_put_failure;
443 if (tcf_action_copy_stats(skb, a, 0))
444 goto nla_put_failure;
445 nest = nla_nest_start(skb, TCA_OPTIONS);
447 goto nla_put_failure;
448 err = tcf_action_dump_old(skb, a, bind, ref);
450 nla_nest_end(skb, nest);
458 EXPORT_SYMBOL(tcf_action_dump_1);
461 tcf_action_dump(struct sk_buff *skb, struct list_head *actions, int bind, int ref)
467 list_for_each_entry(a, actions, list) {
468 nest = nla_nest_start(skb, a->order);
470 goto nla_put_failure;
471 err = tcf_action_dump_1(skb, a, bind, ref);
474 nla_nest_end(skb, nest);
482 nla_nest_cancel(skb, nest);
486 struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
487 struct nlattr *est, char *name, int ovr,
491 struct tc_action_ops *a_o;
492 char act_name[IFNAMSIZ];
493 struct nlattr *tb[TCA_ACT_MAX + 1];
498 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
502 kind = tb[TCA_ACT_KIND];
505 if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
509 if (strlcpy(act_name, name, IFNAMSIZ) >= IFNAMSIZ)
513 a_o = tc_lookup_action_n(act_name);
515 #ifdef CONFIG_MODULES
517 request_module("act_%s", act_name);
520 a_o = tc_lookup_action_n(act_name);
522 /* We dropped the RTNL semaphore in order to
523 * perform the module load. So, even if we
524 * succeeded in loading the module we have to
525 * tell the caller to replay the request. We
526 * indicate this using -EAGAIN.
538 a = kzalloc(sizeof(*a), GFP_KERNEL);
542 INIT_LIST_HEAD(&a->list);
543 /* backward compatibility for policer */
545 err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, a, ovr, bind);
547 err = a_o->init(net, nla, est, a, ovr, bind);
551 /* module count goes up only when brand new policy is created
552 * if it exists and is only bound to in a_o->init() then
553 * ACT_P_CREATED is not returned (a zero is).
555 if (err != ACT_P_CREATED)
556 module_put(a_o->owner);
564 module_put(a_o->owner);
569 int tcf_action_init(struct net *net, struct nlattr *nla,
570 struct nlattr *est, char *name, int ovr,
571 int bind, struct list_head *actions)
573 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
574 struct tc_action *act;
578 err = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL);
582 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
583 act = tcf_action_init_1(net, tb[i], est, name, ovr, bind);
589 list_add_tail(&act->list, actions);
594 tcf_action_destroy(actions, bind);
598 int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
603 struct tcf_act_hdr *h = a->priv;
608 /* compat_mode being true specifies a call that is supposed
609 * to add additional backward compatibility statistic TLVs.
612 if (a->type == TCA_OLD_COMPAT)
613 err = gnet_stats_start_copy_compat(skb, 0,
614 TCA_STATS, TCA_XSTATS, &h->tcf_lock, &d);
618 err = gnet_stats_start_copy(skb, TCA_ACT_STATS,
624 if (gnet_stats_copy_basic(&d, &h->tcf_bstats) < 0 ||
625 gnet_stats_copy_rate_est(&d, &h->tcf_bstats,
626 &h->tcf_rate_est) < 0 ||
627 gnet_stats_copy_queue(&d, &h->tcf_qstats) < 0)
630 if (gnet_stats_finish_copy(&d) < 0)
640 tca_get_fill(struct sk_buff *skb, struct list_head *actions, u32 portid, u32 seq,
641 u16 flags, int event, int bind, int ref)
644 struct nlmsghdr *nlh;
645 unsigned char *b = skb_tail_pointer(skb);
648 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
652 t->tca_family = AF_UNSPEC;
656 nest = nla_nest_start(skb, TCA_ACT_TAB);
660 if (tcf_action_dump(skb, actions, bind, ref) < 0)
663 nla_nest_end(skb, nest);
665 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
674 act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
675 struct list_head *actions, int event)
679 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
682 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, event, 0, 0) <= 0) {
687 return rtnl_unicast(skb, net, portid);
690 static struct tc_action *
691 tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 portid)
693 struct nlattr *tb[TCA_ACT_MAX + 1];
698 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
703 if (tb[TCA_ACT_INDEX] == NULL ||
704 nla_len(tb[TCA_ACT_INDEX]) < sizeof(index))
706 index = nla_get_u32(tb[TCA_ACT_INDEX]);
709 a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
713 INIT_LIST_HEAD(&a->list);
715 a->ops = tc_lookup_action(tb[TCA_ACT_KIND]);
719 if (a->ops->lookup(a, index) == 0)
722 module_put(a->ops->owner);
726 module_put(a->ops->owner);
733 static void cleanup_a(struct list_head *actions)
735 struct tc_action *a, *tmp;
737 list_for_each_entry_safe(a, tmp, actions, list) {
743 static struct tc_action *create_a(int i)
745 struct tc_action *act;
747 act = kzalloc(sizeof(*act), GFP_KERNEL);
749 pr_debug("create_a: failed to alloc!\n");
753 INIT_LIST_HEAD(&act->list);
757 static int tca_action_flush(struct net *net, struct nlattr *nla,
758 struct nlmsghdr *n, u32 portid)
762 struct nlmsghdr *nlh;
764 struct netlink_callback dcb;
766 struct nlattr *tb[TCA_ACT_MAX + 1];
768 struct tc_action *a = create_a(0);
772 pr_debug("tca_action_flush: couldnt create tc_action\n");
776 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
778 pr_debug("tca_action_flush: failed skb alloc\n");
783 b = skb_tail_pointer(skb);
785 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
790 kind = tb[TCA_ACT_KIND];
791 a->ops = tc_lookup_action(kind);
795 nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t), 0);
799 t->tca_family = AF_UNSPEC;
803 nest = nla_nest_start(skb, TCA_ACT_TAB);
807 err = a->ops->walk(skb, &dcb, RTM_DELACTION, a);
813 nla_nest_end(skb, nest);
815 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
816 nlh->nlmsg_flags |= NLM_F_ROOT;
817 module_put(a->ops->owner);
819 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
820 n->nlmsg_flags & NLM_F_ECHO);
827 module_put(a->ops->owner);
836 tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
837 u32 portid, int event)
840 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
841 struct tc_action *act;
844 ret = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL);
848 if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
850 return tca_action_flush(net, tb[1], n, portid);
855 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
856 act = tcf_action_get_1(tb[i], n, portid);
862 list_add_tail(&act->list, &actions);
865 if (event == RTM_GETACTION)
866 ret = act_get_notify(net, portid, n, &actions, event);
870 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
876 if (tca_get_fill(skb, &actions, portid, n->nlmsg_seq, 0, event,
883 /* now do the delete */
884 tcf_action_destroy(&actions, 0);
885 ret = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
886 n->nlmsg_flags & NLM_F_ECHO);
896 static int tcf_add_notify(struct net *net, struct list_head *actions,
897 u32 portid, u32 seq, int event, u16 flags)
900 struct nlmsghdr *nlh;
906 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
910 b = skb_tail_pointer(skb);
912 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
916 t->tca_family = AF_UNSPEC;
920 nest = nla_nest_start(skb, TCA_ACT_TAB);
924 if (tcf_action_dump(skb, actions, 0, 0) < 0)
927 nla_nest_end(skb, nest);
929 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
930 NETLINK_CB(skb).dst_group = RTNLGRP_TC;
932 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, flags & NLM_F_ECHO);
944 tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
949 u32 seq = n->nlmsg_seq;
951 ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
955 /* dump then free all the actions after update; inserted policy
958 ret = tcf_add_notify(net, &actions, portid, seq, RTM_NEWACTION, n->nlmsg_flags);
964 static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)
966 struct net *net = sock_net(skb->sk);
967 struct nlattr *tca[TCA_ACT_MAX + 1];
968 u32 portid = skb ? NETLINK_CB(skb).portid : 0;
969 int ret = 0, ovr = 0;
971 if ((n->nlmsg_type != RTM_GETACTION) && !capable(CAP_NET_ADMIN))
974 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
978 if (tca[TCA_ACT_TAB] == NULL) {
979 pr_notice("tc_ctl_action: received NO action attribs\n");
983 /* n->nlmsg_flags & NLM_F_CREATE */
984 switch (n->nlmsg_type) {
986 /* we are going to assume all other flags
987 * imply create only if it doesn't exist
988 * Note that CREATE | EXCL implies that
989 * but since we want avoid ambiguity (eg when flags
990 * is zero) then just set this
992 if (n->nlmsg_flags & NLM_F_REPLACE)
995 ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
1000 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1001 portid, RTM_DELACTION);
1004 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1005 portid, RTM_GETACTION);
1014 static struct nlattr *
1015 find_dump_kind(const struct nlmsghdr *n)
1017 struct nlattr *tb1, *tb2[TCA_ACT_MAX + 1];
1018 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
1019 struct nlattr *nla[TCAA_MAX + 1];
1020 struct nlattr *kind;
1022 if (nlmsg_parse(n, sizeof(struct tcamsg), nla, TCAA_MAX, NULL) < 0)
1024 tb1 = nla[TCA_ACT_TAB];
1028 if (nla_parse(tb, TCA_ACT_MAX_PRIO, nla_data(tb1),
1029 NLMSG_ALIGN(nla_len(tb1)), NULL) < 0)
1034 if (nla_parse(tb2, TCA_ACT_MAX, nla_data(tb[1]),
1035 nla_len(tb[1]), NULL) < 0)
1037 kind = tb2[TCA_ACT_KIND];
1043 tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1045 struct nlmsghdr *nlh;
1046 unsigned char *b = skb_tail_pointer(skb);
1047 struct nlattr *nest;
1048 struct tc_action_ops *a_o;
1051 struct tcamsg *t = (struct tcamsg *) nlmsg_data(cb->nlh);
1052 struct nlattr *kind = find_dump_kind(cb->nlh);
1055 pr_info("tc_dump_action: action bad kind\n");
1059 a_o = tc_lookup_action(kind);
1063 memset(&a, 0, sizeof(struct tc_action));
1066 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
1067 cb->nlh->nlmsg_type, sizeof(*t), 0);
1069 goto out_module_put;
1070 t = nlmsg_data(nlh);
1071 t->tca_family = AF_UNSPEC;
1075 nest = nla_nest_start(skb, TCA_ACT_TAB);
1077 goto out_module_put;
1079 ret = a_o->walk(skb, cb, RTM_GETACTION, &a);
1081 goto out_module_put;
1084 nla_nest_end(skb, nest);
1087 nla_nest_cancel(skb, nest);
1089 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1090 if (NETLINK_CB(cb->skb).portid && ret)
1091 nlh->nlmsg_flags |= NLM_F_MULTI;
1092 module_put(a_o->owner);
1096 module_put(a_o->owner);
1101 static int __init tc_action_init(void)
1103 rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL);
1104 rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL);
1105 rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action,
1111 subsys_initcall(tc_action_init);