]>
git.proxmox.com Git - mirror_iproute2.git/blob - tc/tc_filter.c
2 * tc_filter.c "tc filter".
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 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
17 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <arpa/inet.h>
21 #include <linux/if_ether.h>
26 #include "tc_common.h"
28 static void usage(void)
31 "Usage: tc filter [ add | del | change | replace | show ] [ dev STRING ]\n"
32 " tc filter [ add | del | change | replace | show ] [ block BLOCK_INDEX ]\n"
33 " tc filter get dev STRING parent CLASSID protocol PROTO handle FILTERID pref PRIO FILTER_TYPE\n"
34 " tc filter get block BLOCK_INDEX protocol PROTO handle FILTERID pref PRIO FILTER_TYPE\n"
35 " [ pref PRIO ] protocol PROTO [ chain CHAIN_INDEX ]\n"
36 " [ estimator INTERVAL TIME_CONSTANT ]\n"
37 " [ root | ingress | egress | parent CLASSID ]\n"
38 " [ handle FILTERID ] [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n"
40 " tc filter show [ dev STRING ] [ root | ingress | egress | parent CLASSID ]\n"
41 " tc filter show [ block BLOCK_INDEX ]\n"
43 "FILTER_TYPE := { rsvp | u32 | bpf | fw | route | etc. }\n"
44 "FILTERID := ... format depends on classifier, see there\n"
45 "OPTIONS := ... try tc filter add <desired FILTER_KIND> help\n");
48 static void chain_usage(void)
51 "Usage: tc chain [ add | del | get | show ] [ dev STRING ]\n"
52 " tc chain [ add | del | get | show ] [ block BLOCK_INDEX ] ]\n");
55 struct tc_filter_req
{
61 static int tc_filter_modify(int cmd
, unsigned int flags
, int argc
, char **argv
)
68 .n
.nlmsg_len
= NLMSG_LENGTH(sizeof(struct tcmsg
)),
69 .n
.nlmsg_flags
= NLM_F_REQUEST
| flags
,
71 .t
.tcm_family
= AF_UNSPEC
,
73 struct filter_util
*q
= NULL
;
77 __u32 block_index
= 0;
79 int chain_index_set
= 0;
81 char d
[IFNAMSIZ
] = {};
82 char k
[FILTER_NAMESZ
] = {};
83 struct tc_estimator est
= {};
85 if (cmd
== RTM_NEWTFILTER
&& flags
& NLM_F_CREATE
)
86 protocol
= htons(ETH_P_ALL
);
89 if (strcmp(*argv
, "dev") == 0) {
94 fprintf(stderr
, "Error: \"dev\" and \"block\" are mutually exclusive\n");
97 strncpy(d
, *argv
, sizeof(d
)-1);
98 } else if (matches(*argv
, "block") == 0) {
101 duparg("block", *argv
);
103 fprintf(stderr
, "Error: \"dev\" and \"block\" are mutually exclusive\n");
106 if (get_u32(&block_index
, *argv
, 0) || !block_index
)
107 invarg("invalid block index value", *argv
);
108 } else if (strcmp(*argv
, "root") == 0) {
109 if (req
.t
.tcm_parent
) {
111 "Error: \"root\" is duplicate parent ID\n");
114 req
.t
.tcm_parent
= TC_H_ROOT
;
115 } else if (strcmp(*argv
, "ingress") == 0) {
116 if (req
.t
.tcm_parent
) {
118 "Error: \"ingress\" is duplicate parent ID\n");
121 req
.t
.tcm_parent
= TC_H_MAKE(TC_H_CLSACT
,
123 } else if (strcmp(*argv
, "egress") == 0) {
124 if (req
.t
.tcm_parent
) {
126 "Error: \"egress\" is duplicate parent ID\n");
129 req
.t
.tcm_parent
= TC_H_MAKE(TC_H_CLSACT
,
131 } else if (strcmp(*argv
, "parent") == 0) {
135 if (req
.t
.tcm_parent
)
136 duparg("parent", *argv
);
137 if (get_tc_classid(&handle
, *argv
))
138 invarg("Invalid parent ID", *argv
);
139 req
.t
.tcm_parent
= handle
;
140 } else if (strcmp(*argv
, "handle") == 0) {
143 duparg("handle", *argv
);
145 } else if (matches(*argv
, "preference") == 0 ||
146 matches(*argv
, "priority") == 0) {
149 duparg("priority", *argv
);
150 if (get_u32(&prio
, *argv
, 0) || prio
> 0xFFFF)
151 invarg("invalid priority value", *argv
);
152 } else if (matches(*argv
, "protocol") == 0) {
157 duparg("protocol", *argv
);
158 if (ll_proto_a2n(&id
, *argv
))
159 invarg("invalid protocol", *argv
);
162 } else if (matches(*argv
, "chain") == 0) {
165 duparg("chain", *argv
);
166 if (get_u32(&chain_index
, *argv
, 0))
167 invarg("invalid chain index value", *argv
);
169 } else if (matches(*argv
, "estimator") == 0) {
170 if (parse_estimator(&argc
, &argv
, &est
) < 0)
172 } else if (matches(*argv
, "help") == 0) {
176 strncpy(k
, *argv
, sizeof(k
)-1);
178 q
= get_filter_kind(k
);
186 req
.t
.tcm_info
= TC_H_MAKE(prio
<<16, protocol
);
189 addattr32(&req
.n
, sizeof(req
), TCA_CHAIN
, chain_index
);
192 addattr_l(&req
.n
, sizeof(req
), TCA_KIND
, k
, strlen(k
)+1);
197 req
.t
.tcm_ifindex
= ll_name_to_index(d
);
198 if (req
.t
.tcm_ifindex
== 0) {
199 fprintf(stderr
, "Cannot find device \"%s\"\n", d
);
202 } else if (block_index
) {
203 req
.t
.tcm_ifindex
= TCM_IFINDEX_MAGIC_BLOCK
;
204 req
.t
.tcm_block_index
= block_index
;
208 if (q
->parse_fopt(q
, fhandle
, argc
, argv
, &req
.n
))
213 "Must specify filter type when using \"handle\"\n");
217 if (matches(*argv
, "help") == 0)
220 "Garbage instead of arguments \"%s ...\". Try \"tc filter help\".\n",
227 addattr_l(&req
.n
, sizeof(req
), TCA_RATE
, &est
, sizeof(est
));
229 if (rtnl_talk(&rth
, &req
.n
, NULL
) < 0) {
230 fprintf(stderr
, "We have an error talking to the kernel\n");
237 static __u32 filter_parent
;
238 static int filter_ifindex
;
239 static __u32 filter_prio
;
240 static __u32 filter_protocol
;
241 static __u32 filter_chain_index
;
242 static int filter_chain_index_set
;
243 static __u32 filter_block_index
;
246 int print_filter(struct nlmsghdr
*n
, void *arg
)
248 FILE *fp
= (FILE *)arg
;
249 struct tcmsg
*t
= NLMSG_DATA(n
);
250 int len
= n
->nlmsg_len
;
251 struct rtattr
*tb
[TCA_MAX
+1];
252 struct filter_util
*q
;
255 if (n
->nlmsg_type
!= RTM_NEWTFILTER
&&
256 n
->nlmsg_type
!= RTM_GETTFILTER
&&
257 n
->nlmsg_type
!= RTM_DELTFILTER
&&
258 n
->nlmsg_type
!= RTM_NEWCHAIN
&&
259 n
->nlmsg_type
!= RTM_GETCHAIN
&&
260 n
->nlmsg_type
!= RTM_DELCHAIN
) {
261 fprintf(stderr
, "Not a filter(cmd %d)\n", n
->nlmsg_type
);
264 len
-= NLMSG_LENGTH(sizeof(*t
));
266 fprintf(stderr
, "Wrong len %d\n", len
);
270 parse_rtattr_flags(tb
, TCA_MAX
, TCA_RTA(t
), len
, NLA_F_NESTED
);
272 if (tb
[TCA_KIND
] == NULL
&& (n
->nlmsg_type
== RTM_NEWTFILTER
||
273 n
->nlmsg_type
== RTM_GETTFILTER
||
274 n
->nlmsg_type
== RTM_DELTFILTER
)) {
275 fprintf(stderr
, "print_filter: NULL kind\n");
279 open_json_object(NULL
);
281 if (n
->nlmsg_type
== RTM_DELTFILTER
|| n
->nlmsg_type
== RTM_DELCHAIN
)
282 print_bool(PRINT_ANY
, "deleted", "deleted ", true);
284 if ((n
->nlmsg_type
== RTM_NEWTFILTER
||
285 n
->nlmsg_type
== RTM_NEWCHAIN
) &&
286 (n
->nlmsg_flags
& NLM_F_CREATE
) &&
287 !(n
->nlmsg_flags
& NLM_F_EXCL
))
288 print_bool(PRINT_ANY
, "replaced", "replaced ", true);
290 if ((n
->nlmsg_type
== RTM_NEWTFILTER
||
291 n
->nlmsg_type
== RTM_NEWCHAIN
) &&
292 (n
->nlmsg_flags
& NLM_F_CREATE
) &&
293 (n
->nlmsg_flags
& NLM_F_EXCL
))
294 print_bool(PRINT_ANY
, "added", "added ", true);
296 if (n
->nlmsg_type
== RTM_NEWTFILTER
||
297 n
->nlmsg_type
== RTM_GETTFILTER
||
298 n
->nlmsg_type
== RTM_DELTFILTER
)
299 print_string(PRINT_FP
, NULL
, "filter ", NULL
);
301 print_string(PRINT_FP
, NULL
, "chain ", NULL
);
302 if (t
->tcm_ifindex
== TCM_IFINDEX_MAGIC_BLOCK
) {
303 if (!filter_block_index
||
304 filter_block_index
!= t
->tcm_block_index
)
305 print_uint(PRINT_ANY
, "block", "block %u ",
308 if (!filter_ifindex
|| filter_ifindex
!= t
->tcm_ifindex
)
309 print_devname(PRINT_ANY
, t
->tcm_ifindex
);
311 if (!filter_parent
|| filter_parent
!= t
->tcm_parent
) {
312 if (t
->tcm_parent
== TC_H_ROOT
)
313 print_bool(PRINT_ANY
, "root", "root ", true);
314 else if (t
->tcm_parent
== TC_H_MAKE(TC_H_CLSACT
, TC_H_MIN_INGRESS
))
315 print_bool(PRINT_ANY
, "ingress", "ingress ", true);
316 else if (t
->tcm_parent
== TC_H_MAKE(TC_H_CLSACT
, TC_H_MIN_EGRESS
))
317 print_bool(PRINT_ANY
, "egress", "egress ", true);
319 print_tc_classid(abuf
, sizeof(abuf
), t
->tcm_parent
);
320 print_string(PRINT_ANY
, "parent", "parent %s ", abuf
);
325 if (t
->tcm_info
&& (n
->nlmsg_type
== RTM_NEWTFILTER
||
326 n
->nlmsg_type
== RTM_DELTFILTER
||
327 n
->nlmsg_type
== RTM_GETTFILTER
)) {
328 f_proto
= TC_H_MIN(t
->tcm_info
);
329 __u32 prio
= TC_H_MAJ(t
->tcm_info
)>>16;
331 if (!filter_protocol
|| filter_protocol
!= f_proto
) {
334 print_string(PRINT_ANY
, "protocol",
336 ll_proto_n2a(f_proto
, b1
, sizeof(b1
)));
339 if (!filter_prio
|| filter_prio
!= prio
) {
341 print_uint(PRINT_ANY
, "pref", "pref %u ", prio
);
345 print_string(PRINT_ANY
, "kind", "%s ", rta_getattr_str(tb
[TCA_KIND
]));
348 __u32 chain_index
= rta_getattr_u32(tb
[TCA_CHAIN
]);
350 if (!filter_chain_index_set
||
351 filter_chain_index
!= chain_index
)
352 print_uint(PRINT_ANY
, "chain", "chain %u ",
357 q
= get_filter_kind(RTA_DATA(tb
[TCA_KIND
]));
358 if (tb
[TCA_OPTIONS
]) {
359 open_json_object("options");
361 q
->print_fopt(q
, fp
, tb
[TCA_OPTIONS
], t
->tcm_handle
);
363 fprintf(stderr
, "cannot parse option parameters\n");
369 if (show_stats
&& (tb
[TCA_STATS
] || tb
[TCA_STATS2
])) {
370 print_tcstats_attr(fp
, tb
, " ", NULL
);
379 static int tc_filter_get(int cmd
, unsigned int flags
, int argc
, char **argv
)
386 .n
.nlmsg_len
= NLMSG_LENGTH(sizeof(struct tcmsg
)),
387 /* NLM_F_ECHO is for backward compatibility. old kernels never
388 * respond without it and newer kernels will ignore it.
389 * In old kernels there is a side effect:
390 * In addition to a response to the GET you will receive an
391 * event (if you do tc mon).
393 .n
.nlmsg_flags
= NLM_F_REQUEST
| NLM_F_ECHO
| flags
,
395 .t
.tcm_parent
= TC_H_UNSPEC
,
396 .t
.tcm_family
= AF_UNSPEC
,
398 struct nlmsghdr
*answer
;
399 struct filter_util
*q
= NULL
;
402 int protocol_set
= 0;
404 int chain_index_set
= 0;
405 __u32 block_index
= 0;
406 __u32 parent_handle
= 0;
407 char *fhandle
= NULL
;
408 char d
[IFNAMSIZ
] = {};
409 char k
[FILTER_NAMESZ
] = {};
412 if (strcmp(*argv
, "dev") == 0) {
415 duparg("dev", *argv
);
417 fprintf(stderr
, "Error: \"dev\" and \"block\" are mutually exclusive\n");
420 strncpy(d
, *argv
, sizeof(d
)-1);
421 } else if (matches(*argv
, "block") == 0) {
424 duparg("block", *argv
);
426 fprintf(stderr
, "Error: \"dev\" and \"block\" are mutually exclusive\n");
429 if (get_u32(&block_index
, *argv
, 0) || !block_index
)
430 invarg("invalid block index value", *argv
);
431 } else if (strcmp(*argv
, "root") == 0) {
432 if (req
.t
.tcm_parent
) {
434 "Error: \"root\" is duplicate parent ID\n");
437 req
.t
.tcm_parent
= TC_H_ROOT
;
438 } else if (strcmp(*argv
, "ingress") == 0) {
439 if (req
.t
.tcm_parent
) {
441 "Error: \"ingress\" is duplicate parent ID\n");
444 req
.t
.tcm_parent
= TC_H_MAKE(TC_H_CLSACT
,
446 } else if (strcmp(*argv
, "egress") == 0) {
447 if (req
.t
.tcm_parent
) {
449 "Error: \"egress\" is duplicate parent ID\n");
452 req
.t
.tcm_parent
= TC_H_MAKE(TC_H_CLSACT
,
454 } else if (strcmp(*argv
, "parent") == 0) {
457 if (req
.t
.tcm_parent
)
458 duparg("parent", *argv
);
459 if (get_tc_classid(&parent_handle
, *argv
))
460 invarg("Invalid parent ID", *argv
);
461 req
.t
.tcm_parent
= parent_handle
;
462 } else if (strcmp(*argv
, "handle") == 0) {
465 duparg("handle", *argv
);
467 } else if (matches(*argv
, "preference") == 0 ||
468 matches(*argv
, "priority") == 0) {
471 duparg("priority", *argv
);
472 if (get_u32(&prio
, *argv
, 0) || prio
> 0xFFFF)
473 invarg("invalid priority value", *argv
);
474 } else if (matches(*argv
, "protocol") == 0) {
479 duparg("protocol", *argv
);
480 if (ll_proto_a2n(&id
, *argv
))
481 invarg("invalid protocol", *argv
);
484 } else if (matches(*argv
, "chain") == 0) {
487 duparg("chain", *argv
);
488 if (get_u32(&chain_index
, *argv
, 0))
489 invarg("invalid chain index value", *argv
);
491 } else if (matches(*argv
, "help") == 0) {
496 invarg("invalid filter name", *argv
);
498 strncpy(k
, *argv
, sizeof(k
)-1);
500 q
= get_filter_kind(k
);
508 if (cmd
== RTM_GETTFILTER
) {
510 fprintf(stderr
, "Must specify filter protocol\n");
515 fprintf(stderr
, "Must specify filter priority\n");
519 req
.t
.tcm_info
= TC_H_MAKE(prio
<<16, protocol
);
523 addattr32(&req
.n
, sizeof(req
), TCA_CHAIN
, chain_index
);
525 if (req
.t
.tcm_parent
== TC_H_UNSPEC
) {
526 fprintf(stderr
, "Must specify filter parent\n");
530 if (cmd
== RTM_GETTFILTER
) {
532 addattr_l(&req
.n
, sizeof(req
), TCA_KIND
, k
, strlen(k
)+1);
534 fprintf(stderr
, "Must specify filter type\n");
542 req
.t
.tcm_ifindex
= ll_name_to_index(d
);
543 if (!req
.t
.tcm_ifindex
)
545 filter_ifindex
= req
.t
.tcm_ifindex
;
546 } else if (block_index
) {
547 req
.t
.tcm_ifindex
= TCM_IFINDEX_MAGIC_BLOCK
;
548 req
.t
.tcm_block_index
= block_index
;
549 filter_block_index
= block_index
;
551 fprintf(stderr
, "Must specify netdevice \"dev\" or block index \"block\"\n");
555 if (cmd
== RTM_GETTFILTER
&&
556 q
->parse_fopt(q
, fhandle
, argc
, argv
, &req
.n
))
559 if (!fhandle
&& cmd
== RTM_GETTFILTER
) {
560 fprintf(stderr
, "Must specify filter \"handle\"\n");
565 if (matches(*argv
, "help") == 0)
568 "Garbage instead of arguments \"%s ...\". Try \"tc filter help\".\n",
573 if (rtnl_talk(&rth
, &req
.n
, &answer
) < 0) {
574 fprintf(stderr
, "We have an error talking to the kernel\n");
579 print_filter(answer
, (void *)stdout
);
586 static int tc_filter_list(int cmd
, int argc
, char **argv
)
593 .n
.nlmsg_len
= NLMSG_LENGTH(sizeof(struct tcmsg
)),
595 .t
.tcm_parent
= TC_H_UNSPEC
,
596 .t
.tcm_family
= AF_UNSPEC
,
598 char d
[IFNAMSIZ
] = {};
602 __u32 block_index
= 0;
603 char *fhandle
= NULL
;
606 if (strcmp(*argv
, "dev") == 0) {
609 duparg("dev", *argv
);
611 fprintf(stderr
, "Error: \"dev\" cannot be used in the same time as \"block\"\n");
614 strncpy(d
, *argv
, sizeof(d
)-1);
615 } else if (matches(*argv
, "block") == 0) {
618 duparg("block", *argv
);
620 fprintf(stderr
, "Error: \"block\" cannot be used in the same time as \"dev\"\n");
623 if (get_u32(&block_index
, *argv
, 0) || !block_index
)
624 invarg("invalid block index value", *argv
);
625 } else if (strcmp(*argv
, "root") == 0) {
626 if (req
.t
.tcm_parent
) {
628 "Error: \"root\" is duplicate parent ID\n");
631 filter_parent
= req
.t
.tcm_parent
= TC_H_ROOT
;
632 } else if (strcmp(*argv
, "ingress") == 0) {
633 if (req
.t
.tcm_parent
) {
635 "Error: \"ingress\" is duplicate parent ID\n");
638 filter_parent
= TC_H_MAKE(TC_H_CLSACT
,
640 req
.t
.tcm_parent
= filter_parent
;
641 } else if (strcmp(*argv
, "egress") == 0) {
642 if (req
.t
.tcm_parent
) {
644 "Error: \"egress\" is duplicate parent ID\n");
647 filter_parent
= TC_H_MAKE(TC_H_CLSACT
,
649 req
.t
.tcm_parent
= filter_parent
;
650 } else if (strcmp(*argv
, "parent") == 0) {
654 if (req
.t
.tcm_parent
)
655 duparg("parent", *argv
);
656 if (get_tc_classid(&handle
, *argv
))
657 invarg("invalid parent ID", *argv
);
658 filter_parent
= req
.t
.tcm_parent
= handle
;
659 } else if (strcmp(*argv
, "handle") == 0) {
662 duparg("handle", *argv
);
664 } else if (matches(*argv
, "preference") == 0 ||
665 matches(*argv
, "priority") == 0) {
668 duparg("priority", *argv
);
669 if (get_u32(&prio
, *argv
, 0))
670 invarg("invalid preference", *argv
);
672 } else if (matches(*argv
, "protocol") == 0) {
677 duparg("protocol", *argv
);
678 if (ll_proto_a2n(&res
, *argv
))
679 invarg("invalid protocol", *argv
);
681 filter_protocol
= protocol
;
682 } else if (matches(*argv
, "chain") == 0) {
684 if (filter_chain_index_set
)
685 duparg("chain", *argv
);
686 if (get_u32(&chain_index
, *argv
, 0))
687 invarg("invalid chain index value", *argv
);
688 filter_chain_index_set
= 1;
689 filter_chain_index
= chain_index
;
690 } else if (matches(*argv
, "help") == 0) {
694 " What is \"%s\"? Try \"tc filter help\"\n",
702 req
.t
.tcm_info
= TC_H_MAKE(prio
<<16, protocol
);
707 req
.t
.tcm_ifindex
= ll_name_to_index(d
);
708 if (!req
.t
.tcm_ifindex
)
710 filter_ifindex
= req
.t
.tcm_ifindex
;
711 } else if (block_index
) {
712 if (!tc_qdisc_block_exists(block_index
)) {
713 fprintf(stderr
, "Cannot find block \"%u\"\n", block_index
);
716 req
.t
.tcm_ifindex
= TCM_IFINDEX_MAGIC_BLOCK
;
717 req
.t
.tcm_block_index
= block_index
;
718 filter_block_index
= block_index
;
721 if (filter_chain_index_set
)
722 addattr32(&req
.n
, sizeof(req
), TCA_CHAIN
, chain_index
);
725 struct nla_bitfield32 flags
= {
726 .value
= TCA_DUMP_FLAGS_TERSE
,
727 .selector
= TCA_DUMP_FLAGS_TERSE
730 addattr_l(&req
.n
, MAX_MSG
, TCA_DUMP_FLAGS
, &flags
, sizeof(flags
));
733 if (rtnl_dump_request_n(&rth
, &req
.n
) < 0) {
734 perror("Cannot send dump request");
739 if (rtnl_dump_filter(&rth
, print_filter
, stdout
) < 0) {
740 fprintf(stderr
, "Dump terminated\n");
748 int do_filter(int argc
, char **argv
)
751 return tc_filter_list(RTM_GETTFILTER
, 0, NULL
);
752 if (matches(*argv
, "add") == 0)
753 return tc_filter_modify(RTM_NEWTFILTER
, NLM_F_EXCL
|NLM_F_CREATE
,
755 if (matches(*argv
, "change") == 0)
756 return tc_filter_modify(RTM_NEWTFILTER
, 0, argc
-1, argv
+1);
757 if (matches(*argv
, "replace") == 0)
758 return tc_filter_modify(RTM_NEWTFILTER
, NLM_F_CREATE
, argc
-1,
760 if (matches(*argv
, "delete") == 0)
761 return tc_filter_modify(RTM_DELTFILTER
, 0, argc
-1, argv
+1);
762 if (matches(*argv
, "get") == 0)
763 return tc_filter_get(RTM_GETTFILTER
, 0, argc
-1, argv
+1);
764 if (matches(*argv
, "list") == 0 || matches(*argv
, "show") == 0
765 || matches(*argv
, "lst") == 0)
766 return tc_filter_list(RTM_GETTFILTER
, argc
-1, argv
+1);
767 if (matches(*argv
, "help") == 0) {
771 fprintf(stderr
, "Command \"%s\" is unknown, try \"tc filter help\".\n",
776 int do_chain(int argc
, char **argv
)
779 return tc_filter_list(RTM_GETCHAIN
, 0, NULL
);
780 if (matches(*argv
, "add") == 0) {
781 return tc_filter_modify(RTM_NEWCHAIN
, NLM_F_EXCL
| NLM_F_CREATE
,
783 } else if (matches(*argv
, "delete") == 0) {
784 return tc_filter_modify(RTM_DELCHAIN
, 0,
786 } else if (matches(*argv
, "get") == 0) {
787 return tc_filter_get(RTM_GETCHAIN
, 0,
789 } else if (matches(*argv
, "list") == 0 || matches(*argv
, "show") == 0 ||
790 matches(*argv
, "lst") == 0) {
791 return tc_filter_list(RTM_GETCHAIN
, argc
- 1, argv
+ 1);
792 } else if (matches(*argv
, "help") == 0) {
796 fprintf(stderr
, "Command \"%s\" is unknown, try \"tc chain help\".\n",