[Bug 215008] [patch] jls(8) separate lists for IPv4 and IPv6 in verbose libxo output

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Dec 24 23:52:21 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215008

--- Comment #2 from commit-hook at freebsd.org ---
A commit references this bug:

Author: jamie
Date: Sat Dec 24 23:51:27 UTC 2016
New revision: 310530
URL: https://svnweb.freebsd.org/changeset/base/310530

Log:
  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
    ...
    <ip4.addr>10.1.1.1</ip4.addr>
    <ip4.addr>10.1.1.2</ip4.addr>
    <ip4.addr>10.1.1.3</ip4.addr>
    <ip4.saddrsel>true</ip4.saddrsel>
    <ip6.addr>fe80::1000:1</ip6.addr>
    <ip6.addr>fe80::1000:2</ip6.addr>
    ...

  PR:           215008
  Submitted by: Christian Schwarz <me at cschwarz.com>
  Differential Revision:        https://reviews.freebsd.org/D8766

Changes:
  head/usr.sbin/jls/jls.c

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-jail mailing list