]> git.proxmox.com Git - mirror_iproute2.git/commit - ip/link_ip6tnl.c
ip/tunnel: Abstract tunnel encapsulation options printing
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 18 Jan 2018 14:04:32 +0000 (16:04 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 19 Jan 2018 00:34:40 +0000 (16:34 -0800)
commitbad76e6b1f4475caac9f529236c6dbce53e4a18e
tree8bbc6021e2869693baff16ae8ad164445f66bee8
parente97ad3d2483cf417a5ccf8b2e3b106b03bb5547d
ip/tunnel: Abstract tunnel encapsulation options printing

Get rid of code duplications and consolidate encapsulation
options printing in single function - tnl_print_encap().

Introduce and use tnl_encap_str() to format encapsulation
option string according to tempate and given values to avoid
code duplication and simplify it.

Use print_string() instead of fputs() and fprintf() to
print encapsulation for !is_json_context().

Print "unknown" parameter for "encap" type in PRINT_FP
context using "%s " format specifier and benefit from
complite time string merge.

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/link_gre.c
ip/link_gre6.c
ip/link_ip6tnl.c
ip/link_iptnl.c
ip/tunnel.c
ip/tunnel.h