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