K 10
svn:author
V 5
jamie
K 8
svn:date
V 27
2016-12-24T23:51:27.365801Z
K 7
svn:log
V 2461
Improve IP address list representation in libxo output.
Extract decision-making about special-case printing of certain
jail parameters into a function.
Refactor emitting of IPv4 and IPv6 address lists into a function.
Resulting user-facing changes:
XO_VERSION is bumped to 2.
In verbose mode (-v), IPv4 and IPv6-Addresses are now properly emitted
as separate lists.
This only affects the output in encoding styles, i.e. xml and json.
{ {
"__version": "1", "__version": "2",
"jail-information": { "jail-information": {
"jail": [ "jail": [
{ {
"jid": 166, "jid": 166,
"hostname": "foo.com", "hostname": "foo.com",
"path": "/var/jail/foo", "path": "/var/jail/foo",
"name": "foo", "name": "foo",
"state": "ACTIVE", "state": "ACTIVE",
"cpusetid": 2, "cpusetid": 2,
"ipv4_addrs": [ "ipv4_addrs": [
"10.1.1.1", "10.1.1.1",
"10.1.1.2", "10.1.1.2",
"10.1.1.3", | "10.1.1.3"
> ],
> "ipv6_addrs": [
"fe80::1000:1", "fe80::1000:1",
"fe80::1000:2" "fe80::1000:2"
] ]
} }
] ]
} }
} }
In -n mode, ip4.addr and ip6.addr are formatted in the encoding styles'
native list types, e.g. instead of comma-separated lists, JSON arrays
are printed.
jls -n all --libxo json
...
"ip4.addr": [
"10.1.1.1",
"10.1.1.2",
"10.1.1.3"
],
"ip4.saddrsel": true,
"ip6.addr": [
"fe80::1000:1",
"fe80::1000:2"
],
...
jls -n all --libxo xml
...
10.1.1.1
10.1.1.2
10.1.1.3
true
fe80::1000:1
fe80::1000:2
...
PR: 215008
Submitted by: Christian Schwarz
Differential Revision: https://reviews.freebsd.org/D8766
END