From nobody Fri Sep 06 18:35:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK21Dywz5VSFg; Fri, 06 Sep 2024 18:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lK15zssz4VgT; Fri, 6 Sep 2024 18:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SOBHlEICIGX7ZBLm8jYs/Od6NLI5PrWwAXGW4o2lTas=; b=NknyjbkZ6iS85gDCXkeyRnzSg6VTJOFzEIvI1ze+ygvMCAPPowBtzK6aSxRAc8/YQgwE6F LniiQZ3L8ZiMHADDw1oCtFYV0WTVi2rrHd90SsKwCkDNKcpWW2um/aGB/f2urlGiRQkT6L d0m7Vpwk0Gw7xHrWNIaLcFKYbgY/Ss6vYZ6iYQwmVfiVv6aQaqRPoUna4F04vdnLfxyHbI zDWRx4LXOvb/IlhZtuHL5rup8HUSpyheLp9h1x0odl5IUpCBzlt5nb3s1614F+ouDh3Hqi TrWxEZskG5too0wtK8FOKuqngiG2A1rhpKsXQ7WTf93Xow5xdOE/ZESZJUDNgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647717; a=rsa-sha256; cv=none; b=maGWZ7mFawe2TjaIGQ2R1wi+GVJoZ+6eIBYBheTys4W1QnDc3vhHxbvDSh5InpLEMU9Q6M 6g93wYR7jBPHj5r7118uMKwifN1xdHMh0m+N5NHNRNqYiJKRXZF6BIsO2McYvoliZHDDLj Rgl+TrMsaMX9Y+eSkb9QMAXjIe68qLGSdRZlrSc6CY0W8tPv8g1jMibET6GJLo3uric6Hf kn4xb5ty/juu+eYfz8nf9/I8alUswnf6bCy0JMg9Txw+avVAJVhJS3V+B1aYQDYDrqzJbw WsyI3WjSQltOyhhc2YeeL1i4APwZaQSdk/HyQetbwSqg1lhUDj9e7vSSSUUm8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SOBHlEICIGX7ZBLm8jYs/Od6NLI5PrWwAXGW4o2lTas=; b=Hteai65kzM9Ca+NIiB7xids/i55iSOWvf4gxTGbDzwW5KhTJRLV1lnENAupbMuNXxdskPN ZOGt2HGZXAE4qgud1iUhlBHqCHloUQ3xhRZPkB3RH9rIlo7RPUwKUDuLJEJVJvoP1n9dt4 +oOao22bZN40jst07wvndqxydr7faEVaTKyfVxEuVRcnRFw1gXlhGSML693bsdr5DoBUd+ C4/SwtJMhAXvSSSeQsnD/Vq+ty0S5bKoiSrgo57iX1TmDioeRXdknfbs9BY32jzdqely4U gL4OfwUPcbO9apiMzdbDbG5CrvTmuzl8ljwQJ5nCH84jgametMsUrKiexkw65g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X0lK1527Tz12nQ; Fri, 6 Sep 2024 18:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 486IZHNb011031; Fri, 6 Sep 2024 18:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZHac011028; Fri, 6 Sep 2024 18:35:17 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:17 GMT Message-Id: <202409061835.486IZHac011028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5c4f64bded0e - main - netstat: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c4f64bded0eb9453dc84bcce9a74f64adf57739 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4f64bded0eb9453dc84bcce9a74f64adf57739 commit 5c4f64bded0eb9453dc84bcce9a74f64adf57739 Author: Bram AuthorDate: 2024-08-27 06:17:33 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 netstat: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/netstat/main.c | 7 +++++++ usr.bin/netstat/netstat.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 2ed6eca4626e..6d19851b61fc 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -510,6 +510,7 @@ main(int argc, char *argv[]) #endif if (iflag && !sflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); intpr(NULL, af); xo_close_container("statistics"); xo_finish(); @@ -517,6 +518,7 @@ main(int argc, char *argv[]) } if (rflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (sflag) { if (live) { kresolve_list(nl); @@ -530,6 +532,7 @@ main(int argc, char *argv[]) } if (oflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); nhops_print(fib, af); xo_close_container("statistics"); xo_finish(); @@ -537,6 +540,7 @@ main(int argc, char *argv[]) } if (Oflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); nhgrp_print(fib, af); xo_close_container("statistics"); xo_finish(); @@ -547,6 +551,7 @@ main(int argc, char *argv[]) if (gflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (sflag) { if (af == AF_INET || af == AF_UNSPEC) mrt_stats(); @@ -569,6 +574,7 @@ main(int argc, char *argv[]) if (tp) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); printproto(tp, tp->pr_name, &first); if (!first) xo_close_list("socket"); @@ -578,6 +584,7 @@ main(int argc, char *argv[]) } xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (af == AF_INET || af == AF_UNSPEC) for (tp = protox; tp->pr_name; tp++) printproto(tp, tp->pr_name, &first); diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index c41862d9fbdd..7ebfc5180f44 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -31,6 +31,8 @@ #include +#define NETSTAT_XO_VERSION "1" + #define satosin(sa) ((struct sockaddr_in *)(sa)) #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6))