mirror_iproute2/tc
Serhey Popovych 5433656705 ip: Use single variable to represent -pretty
After commit a233caa0aa ("json: make pretty printing optional") I get
following build failure:

    LINK     rtmon
    ../lib/libutil.a(json_print.o): In function `new_json_obj':
    json_print.c:(.text+0x35): undefined reference to `show_pretty'
    collect2: error: ld returned 1 exit status
    make[1]: *** [rtmon] Error 1
    make: *** [all] Error 2

It is caused by missing show_pretty variable in rtmon.

On the other hand tc/tc.c there are two distinct variables and single
matches() call that handles -pretty option thus setting show_pretty
will never happen. Note that since commit 44dcfe8201 ("Change
formatting of u32 back to default") show_pretty is used in tc/f_u32.c
so this is first place where -pretty introduced.

Furthermore other utilities like misc/ifstat.c and misc/nstat.c define
pretty variable, however only for their own purposes. They both support
JSON output and thus depend show_pretty in new_json_obj().

Assuming above use common variable to represent -pretty option, define
it in utils.c and declare in utils.h that is commonly used. Replace
show_pretty with pretty.

Fixes: a233caa0aa ("json: make pretty printing optional")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
2018-02-16 08:13:36 -08:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
e_bpf.c bpf: make tc's bpf loader generic and move into lib 2016-11-29 12:35:32 -08: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 Convert the obvious cases to strlcpy() 2017-09-01 12:10:54 -07:00
em_meta.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -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: remove extra whitespace 2015-10-23 15:43:28 -07:00
f_basic.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
f_bpf.c f_bpf: communicate ifindex for eBPF offload 2017-11-26 11:57:57 -08:00
f_cgroup.c tc actions: Improved batching and time filtered dumping 2017-08-04 13:16:51 -07:00
f_flow.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_flower.c tc: jsonify flower filter 2017-11-26 12:20:51 -08:00
f_fw.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_matchall.c tc: jsonify matchall filter 2017-11-26 12:20:51 -08:00
f_route.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_rsvp.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_tcindex.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_u32.c ip: Use single variable to represent -pretty 2018-02-16 08:13:36 -08:00
m_action.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_bpf.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_connmark.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_csum.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_ematch.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_ematch.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
m_estimator.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
m_gact.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_ife.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_ipt.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_mirred.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_nat.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_pedit.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_pedit.h drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
m_police.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_sample.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_simple.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_skbedit.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_skbmod.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_tunnel_key.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_vlan.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_xt_old.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_xt.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
Makefile SPDX license identifiers 2017-11-24 12:21:35 -08:00
p_eth.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
p_icmp.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
p_ip6.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
p_ip.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
p_tcp.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
p_udp.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
q_atm.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_cbq.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_cbs.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_choke.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_clsact.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
q_codel.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08: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_fifo.c tc: break long lines 2017-11-24 11:31:36 -08:00
q_fq_codel.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_fq.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_gred.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08: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: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_htb.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_ingress.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_mqprio.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_multiq.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_netem.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_pie.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08: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: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08: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 tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_tbf.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
static-syms.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_cbq.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_cbq.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_class.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
tc_common.h tc: Add batchsize feature for filter and actions 2018-01-14 09:03:35 -08:00
tc_core.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_core.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_estimator.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_exec.c tc: replace magic constant 16 with #define 2017-11-24 11:19:18 -08:00
tc_filter.c tc: introduce support for block-handle for filter operations 2018-01-21 10:42:53 -08:00
tc_monitor.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_qdisc.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
tc_red.c tc: red: allow setting th_min and th_max to the same value 2018-01-19 12:35:23 -08:00
tc_red.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_stab.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_util.c tc: fix second printing of requeues 2018-01-27 16:06:54 -08:00
tc_util.h tc: introduce tc_qdisc_block_exists helper 2018-01-21 10:42:35 -08:00
tc.c ip: Use single variable to represent -pretty 2018-02-16 08:13:36 -08:00