iproute2/tc
Eli Britstein bb3ee8b313 tc_util: fix JSON prints for ct-mark and ct-zone
Fix the output of ct-mark and ct-zone (both for matches and actions) to
be different in JSON/non-JSON mode.

Example:
$ tc qdisc add dev eth0 ingress
$ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \
      ct_zone 5 ct_mark 6/0xf action ct commit zone 7 mark 8/0xf drop

Non JSON format remains the same:
$ tc filter show dev eth0 parent ffff:
$ tc -s filter show dev ens1f0_0 parent ffff:
filter protocol ip pref 1 flower chain 0
filter protocol ip pref 1 flower chain 0 handle 0x1
  eth_type ipv4
  ct_zone 5
  ct_mark 6/0xf
  skip_hw
  not_in_hw
        action order 1: ct commit mark 8/0xf zone 7 drop
         index 1 ref 1 bind 1 installed 108 sec used 108 sec
        Action statistics:
        Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0

JSON format is changed (partial output):
$ tc -p -j filter show dev eth0 parent ffff:
Before:
        "options": {
            "keys": {
                "ct_zone": "5",
                "ct_mark": "6/0xf"
                ...
        "actions": [ {
                "order": 1,
                "kind": "ct",
                "action": "commit",
                "mark": "8/0xf",
                "zone": "7",
                ...
After:
        "options": {
            "keys": {
                "ct_zone": 5,
                "ct_mark": 6,
                "ct_mark_mask": 15
                ...
        "actions": [ {
                "order": 1,
                "kind": "ct",
                "action": "commit",
                "mark": 8,
                "mark_mask": 15,
                "zone": 7,
                ...

Fixes: c8a494314c ("tc: Introduce tc ct action")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-11-19 11:36:05 -08:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
Makefile tc: Introduce tc ct action 2019-07-18 15:41:02 -07:00
e_bpf.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
em_canid.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
em_cmp.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
em_ipset.c Include bsd/string.h only in include/utils.h 2018-11-05 08:38:32 -08:00
em_ipt.c tc: fix spelling errors 2019-08-12 18:18:51 -07:00
em_meta.c tc/meta: make meta_table static and const 2018-11-19 11:42:44 -08:00
em_nbyte.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
em_u32.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
emp_ematch.l tc/lexer: let quotes actually start strings 2018-01-24 08:49:10 -08:00
emp_ematch.y tc/ematch: fix deprecated yacc warning 2019-04-24 15:10:22 -07:00
f_basic.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_bpf.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_cgroup.c tc actions: Improved batching and time filtered dumping 2017-08-04 13:16:51 -07:00
f_flow.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_flower.c tc: flower: fix newline prints for ct-mark and ct-zone 2019-11-19 11:36:05 -08:00
f_fw.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_matchall.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_route.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_rsvp.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_tcindex.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
f_u32.c tc: f_u32: allow skip_hw and skip_sw flags to be last 2018-11-09 08:12:29 -08:00
m_action.c Merge branch 'master' into next 2019-08-07 11:59:19 -07:00
m_bpf.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_connmark.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_csum.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_ct.c tc_util: add an option to print masked numbers with/without a newline 2019-11-19 11:36:05 -08:00
m_ctinfo.c tc: add support for action act_ctinfo 2019-06-10 10:24:38 -07:00
m_ematch.c tc/ematch: make local functions static 2018-11-19 11:42:44 -08:00
m_ematch.h tc/ematch: make local functions static 2018-11-19 11:42:44 -08:00
m_estimator.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
m_gact.c tc: fix segmentation fault on gact action 2019-10-08 20:18:51 -07:00
m_ife.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_ipt.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_mirred.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_mpls.c tc: add mpls actions 2019-07-10 14:06:32 -07:00
m_nat.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_pedit.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_pedit.h tc/pedit: make functions static 2018-11-19 11:42:44 -08:00
m_police.c iproute2-next: police: support 64bit rate and peakrate in tc utility 2019-09-15 10:39:19 -07:00
m_sample.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_simple.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_skbedit.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_skbmod.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_tunnel_key.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_vlan.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_xt.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
m_xt_old.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
p_eth.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_icmp.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_ip.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_ip6.c tc/pedit: Fix wrong pedit ipv6 structure id 2019-03-01 11:05:00 -08:00
p_tcp.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_udp.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
q_atm.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_cake.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_cbq.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_cbs.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_choke.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_clsact.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
q_codel.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_drr.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_dsmark.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_etf.c etf: Add skip_sock_check 2019-07-18 15:44:21 -07:00
q_fifo.c tc: jsonify output of q_fifo 2018-10-08 09:22:22 -07:00
q_fq.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_fq_codel.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_gred.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_hfsc.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_hhf.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_htb.c fix print_0xhex on 32 bit 2018-12-10 14:20:32 -08:00
q_ingress.c ingress: Don't break JSON output 2018-04-25 11:08:39 -07:00
q_mqprio.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_multiq.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_netem.c tc: fix spelling errors 2019-08-12 18:18:51 -07:00
q_pie.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_plug.c tc: add support for plug qdisc 2019-05-04 09:22:14 -07:00
q_prio.c tc: prio: JSON-ify prio output 2018-01-26 13:00:18 -08:00
q_qfq.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_red.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_rr.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_sfb.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_sfq.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
q_skbprio.c Add SKB Priority qdisc support in tc(8) 2018-08-14 07:06:43 -07:00
q_taprio.c taprio: add support for setting txtime_delay. 2019-07-18 15:46:36 -07:00
q_tbf.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
static-syms.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc.c tc: fflush after each command in batch mode 2019-08-02 09:34:55 -07:00
tc_cbq.c tc: fix spelling errors 2019-08-12 18:18:51 -07:00
tc_cbq.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_class.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
tc_common.h Revert "tc: Add batchsize feature for filter and actions" 2019-08-02 09:34:51 -07:00
tc_core.c iproute2-next: police: support 64bit rate and peakrate in tc utility 2019-09-15 10:39:19 -07:00
tc_core.h iproute2-next: police: support 64bit rate and peakrate in tc utility 2019-09-15 10:39:19 -07:00
tc_estimator.c tc: support conversions to or from 64 bit nanosecond-based time 2018-08-30 11:04:38 -07:00
tc_exec.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
tc_filter.c tc: fix spelling errors 2019-08-12 18:18:51 -07:00
tc_monitor.c Tree wide: Drop sockaddr_nl arg 2018-10-22 09:43:48 -07:00
tc_qdisc.c tc: print all error messages to stderr 2019-07-11 15:35:07 -07:00
tc_red.c tc: fix spelling errors 2019-08-12 18:18:51 -07:00
tc_red.h tc: move RED flag printing to helper 2018-11-24 07:10:58 -08:00
tc_stab.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_util.c tc_util: fix JSON prints for ct-mark and ct-zone 2019-11-19 11:36:05 -08:00
tc_util.h tc_util: add an option to print masked numbers with/without a newline 2019-11-19 11:36:05 -08:00