From nobody Tue Sep 16 11:28:18 2025 X-Original-To: dev-commits-doc-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 4cR05G46Wlz68pCX for ; Tue, 16 Sep 2025 11:28: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cR05G2Tlwz47YW; Tue, 16 Sep 2025 11:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758022098; 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=vH+ZRvnc6oT6+KbCWjjNkYGSRjZaI43M+ag1cSSzwvQ=; b=qssB+ghQAtRJshu1T3yIDf3AmOSMhhqGxZYL8Sp3ALkvab5k3DDuen+Kew8jVDXBjW4hRb XluV8oBldVJaP3R2blz6Fr5bTMWxz6kVOE+W1beiSXumPyvpE9kYSDvW11D/waCbPJcXBY 2Y0T8nImf1N3lwdK3SKim8+tBuqgNmBsZBY2ygnoymdlvkaZzgb/LK+jwcWf8pjIFuwH6x Kq3gn4dij2AGu1HNaJo7W9DAcXD/bMDzbTpXS9oFm2Z5GyF7+BAPX2wAtOFrge8sCadnmS rzu/vZvgYwjYwr5EcDp8wxgO3r06JWj+ZTVNAIo73qfofiiXYHZOTXY5J7+A8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758022098; 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=vH+ZRvnc6oT6+KbCWjjNkYGSRjZaI43M+ag1cSSzwvQ=; b=w1Ay168Dz4/74BNmp0tlQ0sdZsVVZFK0CiV9/S2YiCryY6O2a+h0qMsFHC463CjjBTCUNf 00h/yszbXC/ZdPOwaBqL3OAUBuWhIT5uQziNmMpVD2ms0pCyjyNzEnphOVex4SY7J/ExCe aRzmh2eRgLqaflgOodHgspBYDdlqrZQXuL+MfTm11vR0MNePjMgRUzRV49qxOq6f3sBscj LOcwKtkxs//NBVfX9nFZIRE5Owbm1xvXTdZ15DoQjFbuzbTJ+xtg1Ngj9BV6Ib+uAiaDy2 D4DsWbtTqgJeyiKxLI4zwuI0WXhIB6pCEryB9ri5zl3B8NS1qpQaqoYyZ7m1wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758022098; a=rsa-sha256; cv=none; b=eO9nlfvB7j2u0dGziCEX1U+0er8PMPJNJQUoVo2dTlUn2rkxcW9EngOSV8VRW99V4R4UWR hxlaGOMhTfQCSPW3hfDkn5ic/mi9BpzxQ85mhsWDzFBhheAjcHuaUkSMyFlNrwjaJsU6Wf GnV9PaciWwDCZqruNAcu08i035chrRMGXfVHb2Uc1vqYt4hXQqEOfF/zPTNgZKFJ1LA/88 xVG2ZdT/b1UaQ6X/4p+NsWFIkEkOizkj6CL1QGUIbBHbu6YcMtHbu0Tk61yTOXlm4h5gsP 6x+lgEhATlH412fbIvLFTzHMOMk17n14R8iAJZN4nfxnbLEIPWoqcODyYdbMVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cR05G203Bzflb; Tue, 16 Sep 2025 11:28:18 +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 58GBSIoo081158; Tue, 16 Sep 2025 11:28:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58GBSI3t081155; Tue, 16 Sep 2025 11:28:18 GMT (envelope-from git) Date: Tue, 16 Sep 2025 11:28:18 GMT Message-Id: <202509161128.58GBSI3t081155@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Lorenzo Salvadore Subject: git: 78d3055bdb - main - Status/2025Q3/sockstat.adoc: Add report List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78d3055bdb14102a9322a17348f36882052839f1 Auto-Submitted: auto-generated The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/doc/commit/?id=78d3055bdb14102a9322a17348f36882052839f1 commit 78d3055bdb14102a9322a17348f36882052839f1 Author: Damin Rido AuthorDate: 2025-08-22 16:24:20 +0000 Commit: Lorenzo Salvadore CommitDate: 2025-09-16 11:27:45 +0000 Status/2025Q3/sockstat.adoc: Add report Co-authored-by: Alan Somers Pull Request: https://github.com/freebsd/freebsd-doc/pull/540 --- .../en/status/report-2025-07-2025-09/sockstat.adoc | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/website/content/en/status/report-2025-07-2025-09/sockstat.adoc b/website/content/en/status/report-2025-07-2025-09/sockstat.adoc new file mode 100644 index 0000000000..88c583e14f --- /dev/null +++ b/website/content/en/status/report-2025-07-2025-09/sockstat.adoc @@ -0,0 +1,35 @@ +=== Sockstat UI Improvements + +Links: + +link:https://wiki.freebsd.org/SummerOfCode2025Projects/SockstatUIImprovements[Sockstat UI Improvements wiki] URL: https://wiki.freebsd.org/SummerOfCode2025Projects/SockstatUIImprovements[] + +link:https://github.com/freebsd/freebsd-src/pull/1720[Automatic column sizing PR] URL: https://github.com/freebsd/freebsd-src/pull/1720[] + +link:https://github.com/freebsd/freebsd-src/pull/1746[Reintroduced -w flag PR] URL: https://github.com/freebsd/freebsd-src/pull/1746[] + +link:https://github.com/freebsd/freebsd-src/pull/1753[Microoptimize cap-getnameinfo PR] URL: https://github.com/freebsd/freebsd-src/pull/1753[] + +link:https://github.com/freebsd/freebsd-src/pull/1770[Libxo support PR] URL: https://github.com/freebsd/freebsd-src/pull/1770[] + +link:https://github.com/freebsd/freebsd-src/pull/1799[Revert incorrect use of path-state for SCTP connections PR] URL: https://github.com/freebsd/freebsd-src/pull/1799[] + +link:https://github.com/freebsd/freebsd-src/pull/1806[Complete libxo integration PR] URL: https://github.com/freebsd/freebsd-src/pull/1806[] + +link:https://github.com/freebsd/freebsd-src/pull/1807[Fix port parsing after libxo integration PR] URL: https://github.com/freebsd/freebsd-src/pull/1807[] + + +Contact: Damin Rido + +Sockstat is a command-line tool in FreeBSD that displays detailed information about open network sockets. +However, its traditional fixed-width formatting made the output hard to read, especially when handling long addresses. +This project improves sockstat by introducing dynamically sized columns and structured output support via libxo. +With these enhancements, users can more easily read output on the terminal or export the data in formats such as JSON, XML, or HTML for scripting and integration with external tools. + +The sockstat utility underwent improvements in two phases. +First, the fixed-width layout was replaced with dynamic column sizing using a two-pass algorithm to ensure proper alignment and readability, including cases with long socket addresses. +The `-w` option was redefined to enable wide, auto-sized output while maintaining compatibility with default terminal displays. +In the second phase, libxo support was integrated by replacing `printf()` calls with `xo_emit()`, applying appropriate field tagging, and validating the output using libxo's tools. +The manual pages were updated to document the libxo integration. +These changes provide machine-readable structured output while preserving traditional human-readable formatting. + +Following the sockstat conversion, the `parse_ports` function was identified as broken. +Due to its complexity, the function warranted the addition of unit tests to ensure correct behavior. +The issue was addressed by fixing the function and introducing a set of unit tests. +The codebase was refactored by renaming `sockstat.c` to `main.c` . + +This project was part of Google Summer of Code 2025. +It has modernized sockstat and made it both more user-friendly and better suited for integration into automated workflows. + +Sponsor: Google Summer of Code 2025 \ No newline at end of file