View | Details | Raw Unified | Return to bug 215008 | Differences between
and this patch

Collapse All | Expand All

(-)b/usr.sbin/jls/jls.8 (-1 / +5 lines)
Lines 104-110 Extend the standard display with a multiple-line summary per jail, Link Here
104
containing the following parameters:
104
containing the following parameters:
105
jail identifier (jid), hostname (host.hostname), path (path),
105
jail identifier (jid), hostname (host.hostname), path (path),
106
jail name (name), jail state (dying), cpuset ID (cpuset),
106
jail name (name), jail state (dying), cpuset ID (cpuset),
107
IP address(es) (ip4.addr and ip6.addr).
107
IP address(es) (ip4.addr and ip6.addr, one address per line).
108
.Pp
109
For encoding-styled
110
.Sy --libxo
111
output, IPv4 and IPv6 addresses emitted as separate lists.
108
.It Fl j Ar jail
112
.It Fl j Ar jail
109
The jid or name of the
113
The jid or name of the
110
.Ar jail
114
.Ar jail
(-)b/usr.sbin/jls/jls.c (-9 / +16 lines)
Lines 51-57 __FBSDID("$FreeBSD$"); Link Here
51
#define	JP_USER		0x01000000
51
#define	JP_USER		0x01000000
52
#define	JP_OPT		0x02000000
52
#define	JP_OPT		0x02000000
53
53
54
#define JLS_XO_VERSION	"1"
54
#define JLS_XO_VERSION	"2"
55
55
56
#define	PRINT_DEFAULT	0x01
56
#define	PRINT_DEFAULT	0x01
57
#define	PRINT_HEADER	0x02
57
#define	PRINT_HEADER	0x02
Lines 401-429 print_jail(int pflags, int jflags) Link Here
401
		n = 6;
401
		n = 6;
402
#ifdef INET
402
#ifdef INET
403
		if (ip4_ok && !strcmp(params[n].jp_name, "ip4.addr")) {
403
		if (ip4_ok && !strcmp(params[n].jp_name, "ip4.addr")) {
404
			xo_open_list("ipv4_addrs");
404
			count = params[n].jp_valuelen / sizeof(struct in_addr);
405
			count = params[n].jp_valuelen / sizeof(struct in_addr);
405
			for (ai = 0; ai < count; ai++)
406
			for (ai = 0; ai < count; ai++) {
406
				if (inet_ntop(AF_INET,
407
				if (inet_ntop(AF_INET,
407
				    &((struct in_addr *)params[n].jp_value)[ai],
408
				    &((struct in_addr *)params[n].jp_value)[ai],
408
				    ipbuf, sizeof(ipbuf)) == NULL)
409
				    ipbuf, sizeof(ipbuf)) == NULL) {
409
					xo_err(1, "inet_ntop");
410
					xo_err(1, "inet_ntop");
410
				else {
411
				} else {
411
					xo_emit("{P:        }{l:ipv4_addrs}{P:\n}", ipbuf);
412
					xo_emit("{P:        }{ql:ipv4_addr}{P:\n}", ipbuf);
412
				}
413
				}
414
			}
415
			xo_close_list("ipv4_addrs");
413
			n++;
416
			n++;
414
		}
417
		}
415
#endif
418
#endif
416
#ifdef INET6
419
#ifdef INET6
417
		if (ip6_ok && !strcmp(params[n].jp_name, "ip6.addr")) {
420
		if (ip6_ok && !strcmp(params[n].jp_name, "ip6.addr")) {
418
			count = params[n].jp_valuelen / sizeof(struct in6_addr);
421
			count = params[n].jp_valuelen / sizeof(struct in6_addr);
419
			for (ai = 0; ai < count; ai++)
422
			xo_open_list("ipv6_addrs");
423
			for (ai = 0; ai < count; ai++) {
420
				if (inet_ntop(AF_INET6,
424
				if (inet_ntop(AF_INET6,
421
				    &((struct in6_addr *)
425
				    &((struct in6_addr *)
422
					params[n].jp_value)[ai],
426
					params[n].jp_value)[ai],
423
				    ipbuf, sizeof(ipbuf)) == NULL)
427
				    ipbuf, sizeof(ipbuf)) == NULL) {
424
					xo_err(1, "inet_ntop");
428
					xo_err(1, "inet_ntop");
425
				else
429
				} else {
426
					xo_emit("{P:        }{l:ipv6_addrs}{P:\n}", ipbuf);
430
					xo_emit("{P:        }{ql:ipv6_addr}{P:\n}", ipbuf);
431
				}
432
			}
433
			xo_close_list("ipv6_addrs");
427
			n++;
434
			n++;
428
		}
435
		}
429
#endif
436
#endif

Return to bug 215008