iproute2: update ctinfo support
[openwrt/staging/hauke.git] / package / network / utils / iproute2 / patches / 090-tc-add-support-for-action-act_ctinfo.patch
1 From dff8eadcab33209e040e77a5d56d5def04808144 Mon Sep 17 00:00:00 2001
2 From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 Date: Fri, 15 Mar 2019 09:35:37 +0000
4 Subject: [PATCH] tc: add support for action act_ctinfo
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 ctinfo is a tc action restoring data stored in conntrack marks to
10 various fields. At present it has two independent modes of operation,
11 restoration of DSCP into IPv4/v6 diffserv and restoration of conntrack
12 marks into packet skb marks.
13
14 It understands a number of parameters specific to this action in
15 additional to the usual action syntax. Each operating mode is
16 independent of the other so all options are optional, however not
17 specifying at least one mode is a bit pointless.
18
19 Usage: ... ctinfo [dscp mask [statemask]] [cpmark [mask]] [zone ZONE]
20 [CONTROL] [index <INDEX>]
21
22 DSCP mode
23
24 dscp enables copying of a DSCP stored in the conntrack mark into the
25 ipv4/v6 diffserv field. The mask is a 32bit field and specifies where
26 in the conntrack mark the DSCP value is located. It must be 6
27 contiguous bits long. eg. 0xfc000000 would restore the DSCP from the
28 upper 6 bits of the conntrack mark.
29
30 The DSCP copying may be optionally controlled by a statemask. The
31 statemask is a 32bit field, usually with a single bit set and must not
32 overlap the dscp mask. The DSCP restore operation will only take place
33 if the corresponding bit/s in conntrack mark ANDed with the statemask
34 yield a non zero result.
35
36 eg. dscp 0xfc000000 0x01000000 would retrieve the DSCP from the top 6
37 bits, whilst using bit 25 as a flag to do so. Bit 26 is unused in this
38 example.
39
40 CPMARK mode
41
42 cpmark enables copying of the conntrack mark to the packet skb mark. In
43 this mode it is completely equivalent to the existing act_connmark
44 action. Additional functionality is provided by the optional mask
45 parameter, whereby the stored conntrack mark is logically ANDed with the
46 cpmark mask before being stored into skb mark. This allows shared usage
47 of the conntrack mark between applications.
48
49 eg. cpmark 0x00ffffff would restore only the lower 24 bits of the
50 conntrack mark, thus may be useful in the event that the upper 8 bits
51 are used by the DSCP function.
52
53 Usage: ... ctinfo [dscp mask [statemask]] [cpmark [mask]] [zone ZONE]
54 [CONTROL] [index <INDEX>]
55 where :
56 dscp MASK is the bitmask to restore DSCP
57 STATEMASK is the bitmask to determine conditional restoring
58 cpmark MASK mask applied to restored packet mark
59 ZONE is the conntrack zone
60 CONTROL := reclassify | pipe | drop | continue | ok |
61 goto chain <CHAIN_INDEX>
62
63 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
64 Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
65 ---
66 include/uapi/linux/pkt_cls.h | 3 +-
67 include/uapi/linux/tc_act/tc_ctinfo.h | 29 +++
68 man/man8/tc-ctinfo.8 | 170 ++++++++++++++++
69 tc/Makefile | 1 +
70 tc/m_ctinfo.c | 268 ++++++++++++++++++++++++++
71 5 files changed, 470 insertions(+), 1 deletion(-)
72 create mode 100644 include/uapi/linux/tc_act/tc_ctinfo.h
73 create mode 100644 man/man8/tc-ctinfo.8
74 create mode 100644 tc/m_ctinfo.c
75
76 diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
77 index 95d0db2a..a6e7e176 100644
78 --- a/include/uapi/linux/pkt_cls.h
79 +++ b/include/uapi/linux/pkt_cls.h
80 @@ -68,7 +68,8 @@ enum {
81 TCA_ID_UNSPEC=0,
82 TCA_ID_POLICE=1,
83 /* other actions go here */
84 - __TCA_ID_MAX=255
85 + TCA_ID_CTINFO=27,
86 + __TCA_ID_MAX = 255
87 };
88
89 #define TCA_ID_MAX __TCA_ID_MAX
90 diff --git a/include/uapi/linux/tc_act/tc_ctinfo.h b/include/uapi/linux/tc_act/tc_ctinfo.h
91 new file mode 100644
92 index 00000000..f5f26d95
93 --- /dev/null
94 +++ b/include/uapi/linux/tc_act/tc_ctinfo.h
95 @@ -0,0 +1,29 @@
96 +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
97 +#ifndef __UAPI_TC_CTINFO_H
98 +#define __UAPI_TC_CTINFO_H
99 +
100 +#include <linux/types.h>
101 +#include <linux/pkt_cls.h>
102 +
103 +struct tc_ctinfo {
104 + tc_gen;
105 +};
106 +
107 +enum {
108 + TCA_CTINFO_UNSPEC,
109 + TCA_CTINFO_PAD,
110 + TCA_CTINFO_TM,
111 + TCA_CTINFO_ACT,
112 + TCA_CTINFO_ZONE,
113 + TCA_CTINFO_PARMS_DSCP_MASK,
114 + TCA_CTINFO_PARMS_DSCP_STATEMASK,
115 + TCA_CTINFO_PARMS_CPMARK_MASK,
116 + TCA_CTINFO_STATS_DSCP_SET,
117 + TCA_CTINFO_STATS_DSCP_ERROR,
118 + TCA_CTINFO_STATS_CPMARK_SET,
119 + __TCA_CTINFO_MAX
120 +};
121 +
122 +#define TCA_CTINFO_MAX (__TCA_CTINFO_MAX - 1)
123 +
124 +#endif
125 diff --git a/man/man8/tc-ctinfo.8 b/man/man8/tc-ctinfo.8
126 new file mode 100644
127 index 00000000..096590d1
128 --- /dev/null
129 +++ b/man/man8/tc-ctinfo.8
130 @@ -0,0 +1,170 @@
131 +.TH "ctinfo action in tc" 8 "4 Jun 2019" "iproute2" "Linux"
132 +.SH NAME
133 +ctinfo \- tc connmark processing action
134 +.SH SYNOPSIS
135 +.B tc ... action ctinfo
136 +[
137 +.B dscp
138 +MASK [STATEMASK] ] [
139 +.B cpmark
140 +[MASK] ] [
141 +.B zone
142 +ZONE ] [
143 +.B CONTROL
144 +] [
145 +.B index
146 +<INDEX>
147 +]
148 +
149 +.SH DESCRIPTION
150 +CTINFO (Conntrack Information) is a tc action for retrieving data from
151 +conntrack marks into various fields. At present it has two independent
152 +processing modes which may be viewed as sub-functions.
153 +
154 +DSCP mode copies a DSCP stored in conntrack's connmark into the IPv4/v6 diffserv
155 +field. The copying may conditionally occur based on a flag also stored in the
156 +connmark. DSCP mode was designed to assist in restoring packet classifications on
157 +ingress, classifications which may then be used by qdiscs such as CAKE. It may be
158 +used in any circumstance where ingress classification needs to be maintained across
159 +links that otherwise bleach or remap according to their own policies.
160 +
161 +CPMARK (copymark) mode copies the conntrack connmark into the packet's mark field. Without
162 +additional parameters it is functionally completely equivalent to the existing
163 +connmark action. An optional mask may be specified to mask which bits of the
164 +connmark are restored. This may be useful when DSCP and CPMARK modes are combined.
165 +
166 +Simple statistics (tc -s) on DSCP restores and CPMARK copies are maintained where values for
167 +set indicate a count of packets altered for that mode. DSCP includes an error count
168 +where the destination packet's diffserv field was unwriteable.
169 +.SH PARAMETERS
170 +.SS DSCP mode parameters:
171 +.IP mask
172 +A mask of 6 contiguous bits indicating where the DSCP value is located in the 32 bit
173 +conntrack mark field. A mask must be provided for this mode. mask is a 32 bit
174 +unsigned value.
175 +.IP statemask
176 +A mask of at least 1 bit indicating where a conditional restore flag is located in the
177 +32 bit conntrack mark field. The statemask bit/s must NOT overlap the mask bits. The
178 +DSCP will be restored if the conntrack mark logically ANDed with the statemask yields
179 +a non-zero result. statemask is an optional unsigned 32 bit value.
180 +.SS CPMARK mode parameters:
181 +.IP mask
182 +Store the logically ANDed result of conntrack mark and mask into the packet's mark
183 +field. Default is 0xffffffff i.e. the whole mark field. mask is an optional unsigned 32 bit
184 +value
185 +.SS Overall action parameters:
186 +.IP zone
187 +Specify the conntrack zone when doing conntrack lookups for packets.
188 +zone is a 16bit unsigned decimal value.
189 +Default is 0.
190 +.IP CONTROL
191 +The following keywords allow to control how the tree of qdisc, classes,
192 +filters and actions is further traversed after this action.
193 +.RS
194 +.TP
195 +.B reclassify
196 +Restart with the first filter in the current list.
197 +.TP
198 +.B pipe
199 +Continue with the next action attached to the same filter.
200 +.TP
201 +.B drop
202 +Drop the packet.
203 +.TP
204 +.B shot
205 +synonym for
206 +.B drop
207 +.TP
208 +.B continue
209 +Continue classification with the next filter in line.
210 +.TP
211 +.B pass
212 +Finish classification process and return to calling qdisc for further packet
213 +processing. This is the default.
214 +.RE
215 +.IP index
216 +Specify an index for this action in order to being able to identify it in later
217 +commands. index is a 32bit unsigned decimal value.
218 +.SH EXAMPLES
219 +Example showing conditional restoration of DSCP on ingress via an IFB
220 +.RS
221 +.EX
222 +
223 +#Set up the IFB interface
224 +.br
225 +tc qdisc add dev ifb4eth0 handle ffff: ingress
226 +
227 +#Put CAKE qdisc on it
228 +.br
229 +tc qdisc add dev ifb4eth0 root cake bandwidth 40mbit
230 +
231 +#Set interface UP
232 +.br
233 +ip link set dev ifb4eth0 up
234 +
235 +#Add 2 actions, ctinfo to restore dscp & mirred to redirect the packets to IFB
236 +.br
237 +tc filter add dev eth0 parent ffff: protocol all prio 10 u32 \\
238 + match u32 0 0 flowid 1:1 action \\
239 + ctinfo dscp 0xfc000000 0x01000000 \\
240 + mirred egress redirect dev ifb4eth0
241 +
242 +tc -s qdisc show dev eth0 ingress
243 +
244 + filter parent ffff: protocol all pref 10 u32 chain 0
245 + filter parent ffff: protocol all pref 10 u32 chain 0 fh 800: ht divisor 1
246 + filter parent ffff: protocol all pref 10 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1 not_in_hw
247 + match 00000000/00000000 at 0
248 + action order 1: ctinfo zone 0 pipe
249 + index 2 ref 1 bind 1 dscp 0xfc000000 0x01000000 installed 72 sec used 0 sec DSCP set 1333 error 0 CPMARK set 0
250 + Action statistics:
251 + Sent 658484 bytes 1833 pkt (dropped 0, overlimits 0 requeues 0)
252 + backlog 0b 0p requeues 0
253 +
254 + action order 2: mirred (Egress Redirect to device ifb4eth0) stolen
255 + index 1 ref 1 bind 1 installed 72 sec used 0 sec
256 + Action statistics:
257 + Sent 658484 bytes 1833 pkt (dropped 0, overlimits 0 requeues 0)
258 + backlog 0b 0p requeues 0
259 +.EE
260 +.RE
261 +
262 +Example showing conditional restoration of DSCP on egress
263 +
264 +This may appear nonsensical since iptables marking of egress packets is easy
265 +to achieve, however the iptables flow classification rules may be extensive
266 +and so some sort of set once and forget may be useful especially on cpu
267 +constrained devices.
268 +.RS
269 +.EX
270 +
271 +# Send unmarked connections to a marking chain which needs to store a DSCP
272 +and set statemask bit in the connmark
273 +.br
274 +iptables -t mangle -A POSTROUTING -o eth0 -m connmark \\
275 + --mark 0x00000000/0x01000000 -g CLASS_MARKING_CHAIN
276 +
277 +# Apply marked DSCP to the packets
278 +.br
279 +tc filter add dev eth0 protocol all prio 10 u32 \\
280 + match u32 0 0 flowid 1:1 action \\
281 + ctinfo dscp 0xfc000000 0x01000000
282 +
283 +tc -s filter show dev eth0
284 + filter parent 800e: protocol all pref 10 u32 chain 0
285 + filter parent 800e: protocol all pref 10 u32 chain 0 fh 800: ht divisor 1
286 + filter parent 800e: protocol all pref 10 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1 not_in_hw
287 + match 00000000/00000000 at 0
288 + action order 1: ctinfo zone 0 pipe
289 + index 1 ref 1 bind 1 dscp 0xfc000000 0x01000000 installed 7414 sec used 0 sec DSCP set 53404 error 0 CPMARK set 0
290 + Action statistics:
291 + Sent 32890260 bytes 120441 pkt (dropped 0, overlimits 0 requeues 0)
292 + backlog 0b 0p requeues 0
293 +.br
294 +.SH SEE ALSO
295 +.BR tc (8),
296 +.BR tc-cake (8)
297 +.BR tc-connmark (8)
298 +.BR tc-mirred (8)
299 +.SH AUTHORS
300 +ctinfo was written by Kevin Darbyshire-Bryant.
301 diff --git a/tc/Makefile b/tc/Makefile
302 index 2edaf2c8..ec93a9a1 100644
303 --- a/tc/Makefile
304 +++ b/tc/Makefile
305 @@ -48,6 +48,7 @@ TCMODULES += m_csum.o
306 TCMODULES += m_simple.o
307 TCMODULES += m_vlan.o
308 TCMODULES += m_connmark.o
309 +TCMODULES += m_ctinfo.o
310 TCMODULES += m_bpf.o
311 TCMODULES += m_tunnel_key.o
312 TCMODULES += m_sample.o
313 diff --git a/tc/m_ctinfo.c b/tc/m_ctinfo.c
314 new file mode 100644
315 index 00000000..5e451f87
316 --- /dev/null
317 +++ b/tc/m_ctinfo.c
318 @@ -0,0 +1,268 @@
319 +/* SPDX-License-Identifier: GPL-2.0 */
320 +/*
321 + * m_ctinfo.c netfilter ctinfo mark action
322 + *
323 + * Copyright (c) 2019 Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
324 + */
325 +
326 +#include <stdio.h>
327 +#include <stdlib.h>
328 +#include <unistd.h>
329 +#include <string.h>
330 +#include "utils.h"
331 +#include "tc_util.h"
332 +#include <linux/tc_act/tc_ctinfo.h>
333 +
334 +static void
335 +explain(void)
336 +{
337 + fprintf(stderr,
338 + "Usage: ... ctinfo [dscp mask [statemask]] [cpmark [mask]] [zone ZONE] [CONTROL] [index <INDEX>]\n"
339 + "where :\n"
340 + "\tdscp MASK bitmask location of stored DSCP\n"
341 + "\t STATEMASK bitmask to determine conditional restoring\n"
342 + "\tcpmark MASK mask applied to mark on restoration\n"
343 + "\tZONE is the conntrack zone\n"
344 + "\tCONTROL := reclassify | pipe | drop | continue | ok |\n"
345 + "\t goto chain <CHAIN_INDEX>\n");
346 +}
347 +
348 +static void
349 +usage(void)
350 +{
351 + explain();
352 + exit(-1);
353 +}
354 +
355 +static int
356 +parse_ctinfo(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
357 + struct nlmsghdr *n)
358 +{
359 + unsigned int cpmarkmask = 0, dscpmask = 0, dscpstatemask = 0;
360 + struct tc_ctinfo sel = {};
361 + unsigned short zone = 0;
362 + char **argv = *argv_p;
363 + struct rtattr *tail;
364 + int argc = *argc_p;
365 + int ok = 0;
366 + __u8 i;
367 +
368 + while (argc > 0) {
369 + if (matches(*argv, "ctinfo") == 0) {
370 + ok = 1;
371 + NEXT_ARG_FWD();
372 + } else if (matches(*argv, "help") == 0) {
373 + usage();
374 + } else {
375 + break;
376 + }
377 +
378 + }
379 +
380 + if (!ok) {
381 + explain();
382 + return -1;
383 + }
384 +
385 + if (argc) {
386 + if (matches(*argv, "dscp") == 0) {
387 + NEXT_ARG();
388 + if (get_u32(&dscpmask, *argv, 0)) {
389 + fprintf(stderr,
390 + "ctinfo: Illegal dscp \"mask\"\n");
391 + return -1;
392 + }
393 + if (NEXT_ARG_OK()) {
394 + NEXT_ARG_FWD();
395 + if (!get_u32(&dscpstatemask, *argv, 0))
396 + NEXT_ARG_FWD(); /* was a statemask */
397 + } else {
398 + NEXT_ARG_FWD();
399 + }
400 + }
401 + }
402 +
403 + /* cpmark has optional mask parameter, so the next arg might not */
404 + /* exist, or it might be the next option, or it may actually be a */
405 + /* 32bit mask */
406 + if (argc) {
407 + if (matches(*argv, "cpmark") == 0) {
408 + cpmarkmask = ~0;
409 + if (NEXT_ARG_OK()) {
410 + NEXT_ARG_FWD();
411 + if (!get_u32(&cpmarkmask, *argv, 0))
412 + NEXT_ARG_FWD(); /* was a mask */
413 + } else {
414 + NEXT_ARG_FWD();
415 + }
416 + }
417 + }
418 +
419 + if (argc) {
420 + if (matches(*argv, "zone") == 0) {
421 + NEXT_ARG();
422 + if (get_u16(&zone, *argv, 10)) {
423 + fprintf(stderr, "ctinfo: Illegal \"zone\"\n");
424 + return -1;
425 + }
426 + NEXT_ARG_FWD();
427 + }
428 + }
429 +
430 + parse_action_control_dflt(&argc, &argv, &sel.action,
431 + false, TC_ACT_PIPE);
432 +
433 + if (argc) {
434 + if (matches(*argv, "index") == 0) {
435 + NEXT_ARG();
436 + if (get_u32(&sel.index, *argv, 10)) {
437 + fprintf(stderr, "ctinfo: Illegal \"index\"\n");
438 + return -1;
439 + }
440 + NEXT_ARG_FWD();
441 + }
442 + }
443 +
444 + if (dscpmask & dscpstatemask) {
445 + fprintf(stderr,
446 + "ctinfo: dscp mask & statemask must NOT overlap\n");
447 + return -1;
448 + }
449 +
450 + i = ffs(dscpmask);
451 + if (i && ((~0 & (dscpmask >> (i - 1))) != 0x3f)) {
452 + fprintf(stderr,
453 + "ctinfo: dscp mask must be 6 contiguous bits long\n");
454 + return -1;
455 + }
456 +
457 + tail = addattr_nest(n, MAX_MSG, tca_id);
458 + addattr_l(n, MAX_MSG, TCA_CTINFO_ACT, &sel, sizeof(sel));
459 + addattr16(n, MAX_MSG, TCA_CTINFO_ZONE, zone);
460 +
461 + if (dscpmask)
462 + addattr32(n, MAX_MSG,
463 + TCA_CTINFO_PARMS_DSCP_MASK, dscpmask);
464 +
465 + if (dscpstatemask)
466 + addattr32(n, MAX_MSG,
467 + TCA_CTINFO_PARMS_DSCP_STATEMASK, dscpstatemask);
468 +
469 + if (cpmarkmask)
470 + addattr32(n, MAX_MSG,
471 + TCA_CTINFO_PARMS_CPMARK_MASK, cpmarkmask);
472 +
473 + addattr_nest_end(n, tail);
474 +
475 + *argc_p = argc;
476 + *argv_p = argv;
477 + return 0;
478 +}
479 +
480 +static void print_ctinfo_stats(FILE *f, struct rtattr *tb[TCA_CTINFO_MAX + 1])
481 +{
482 + struct tcf_t *tm;
483 +
484 + if (tb[TCA_CTINFO_TM]) {
485 + tm = RTA_DATA(tb[TCA_CTINFO_TM]);
486 +
487 + print_tm(f, tm);
488 + }
489 +
490 + if (tb[TCA_CTINFO_STATS_DSCP_SET])
491 + print_lluint(PRINT_ANY, "dscpset", " DSCP set %llu",
492 + rta_getattr_u64(tb[TCA_CTINFO_STATS_DSCP_SET]));
493 + if (tb[TCA_CTINFO_STATS_DSCP_ERROR])
494 + print_lluint(PRINT_ANY, "dscperror", " error %llu",
495 + rta_getattr_u64(tb[TCA_CTINFO_STATS_DSCP_ERROR]));
496 +
497 + if (tb[TCA_CTINFO_STATS_CPMARK_SET])
498 + print_lluint(PRINT_ANY, "cpmarkset", " CPMARK set %llu",
499 + rta_getattr_u64(tb[TCA_CTINFO_STATS_CPMARK_SET]));
500 +}
501 +
502 +static int print_ctinfo(struct action_util *au, FILE *f, struct rtattr *arg)
503 +{
504 + unsigned int cpmarkmask = ~0, dscpmask = 0, dscpstatemask = 0;
505 + struct rtattr *tb[TCA_CTINFO_MAX + 1];
506 + unsigned short zone = 0;
507 + struct tc_ctinfo *ci;
508 +
509 + if (arg == NULL)
510 + return -1;
511 +
512 + parse_rtattr_nested(tb, TCA_CTINFO_MAX, arg);
513 + if (!tb[TCA_CTINFO_ACT]) {
514 + print_string(PRINT_FP, NULL, "%s",
515 + "[NULL ctinfo action parameters]");
516 + return -1;
517 + }
518 +
519 + ci = RTA_DATA(tb[TCA_CTINFO_ACT]);
520 +
521 + if (tb[TCA_CTINFO_PARMS_DSCP_MASK]) {
522 + if (RTA_PAYLOAD(tb[TCA_CTINFO_PARMS_DSCP_MASK]) >=
523 + sizeof(__u32))
524 + dscpmask = rta_getattr_u32(
525 + tb[TCA_CTINFO_PARMS_DSCP_MASK]);
526 + else
527 + print_string(PRINT_FP, NULL, "%s",
528 + "[invalid dscp mask parameter]");
529 + }
530 +
531 + if (tb[TCA_CTINFO_PARMS_DSCP_STATEMASK]) {
532 + if (RTA_PAYLOAD(tb[TCA_CTINFO_PARMS_DSCP_STATEMASK]) >=
533 + sizeof(__u32))
534 + dscpstatemask = rta_getattr_u32(
535 + tb[TCA_CTINFO_PARMS_DSCP_STATEMASK]);
536 + else
537 + print_string(PRINT_FP, NULL, "%s",
538 + "[invalid dscp statemask parameter]");
539 + }
540 +
541 + if (tb[TCA_CTINFO_PARMS_CPMARK_MASK]) {
542 + if (RTA_PAYLOAD(tb[TCA_CTINFO_PARMS_CPMARK_MASK]) >=
543 + sizeof(__u32))
544 + cpmarkmask = rta_getattr_u32(
545 + tb[TCA_CTINFO_PARMS_CPMARK_MASK]);
546 + else
547 + print_string(PRINT_FP, NULL, "%s",
548 + "[invalid cpmark mask parameter]");
549 + }
550 +
551 + if (tb[TCA_CTINFO_ZONE] && RTA_PAYLOAD(tb[TCA_CTINFO_ZONE]) >=
552 + sizeof(__u16))
553 + zone = rta_getattr_u16(tb[TCA_CTINFO_ZONE]);
554 +
555 + print_string(PRINT_ANY, "kind", "%s ", "ctinfo");
556 + print_hu(PRINT_ANY, "zone", "zone %u", zone);
557 + print_action_control(f, " ", ci->action, "");
558 +
559 + print_string(PRINT_FP, NULL, "%s", _SL_);
560 + print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
561 + print_int(PRINT_ANY, "ref", " ref %d", ci->refcnt);
562 + print_int(PRINT_ANY, "bind", " bind %d", ci->bindcnt);
563 +
564 + if (tb[TCA_CTINFO_PARMS_DSCP_MASK]) {
565 + print_0xhex(PRINT_ANY, "dscpmask", " dscp %#010llx", dscpmask);
566 + print_0xhex(PRINT_ANY, "dscpstatemask", " %#010llx",
567 + dscpstatemask);
568 + }
569 +
570 + if (tb[TCA_CTINFO_PARMS_CPMARK_MASK])
571 + print_0xhex(PRINT_ANY, "cpmark", " cpmark %#010llx",
572 + cpmarkmask);
573 +
574 + if (show_stats)
575 + print_ctinfo_stats(f, tb);
576 +
577 + print_string(PRINT_FP, NULL, "%s", _SL_);
578 +
579 + return 0;
580 +}
581 +
582 +struct action_util ctinfo_action_util = {
583 + .id = "ctinfo",
584 + .parse_aopt = parse_ctinfo,
585 + .print_aopt = print_ctinfo,
586 +};
587 --
588 2.20.1 (Apple Git-117)
589