Skip to content

Commit 05ae65b

Browse files
net/tcpstats-reader: new port for TCP socket statistics reader
Command-line tool for reading TCP socket statistics from the tcpstats kernel module on FreeBSD. Reads fixed-size 320-byte records from /dev/tcpstats and outputs JSON Lines, pretty-printed JSON, or protobuf. Requires the tcpstats-kmod port to be installed and loaded. BUILD_DEPENDS: protobuf (protoc for prost code generation) USES: cargo (112 crate dependencies) Tested on FreeBSD 15.0-RELEASE, 14.4-RELEASE, and 14.3-RELEASE via automated port-test infrastructure (stage, stage-qa, check-plist, install, --help, package, deinstall). Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 00d5a88 commit 05ae65b

4 files changed

Lines changed: 378 additions & 0 deletions

File tree

net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,7 @@
15931593
SUBDIR += tcpsplit
15941594
SUBDIR += tcpstat
15951595
SUBDIR += tcpstats-kmod
1596+
SUBDIR += tcpstats-reader
15961597
SUBDIR += tcptestsuite
15971598
SUBDIR += tcptrace
15981599
SUBDIR += tcptraceroute

net/tcpstats-reader/Makefile

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
PORTNAME= tcpstats-reader
2+
DISTVERSIONPREFIX= v
3+
DISTVERSION= 1.0.2
4+
CATEGORIES= net
5+
6+
MAINTAINER= [email protected]
7+
COMMENT= TCP socket statistics reader for FreeBSD tcpstats kernel module
8+
WWW= https://github.com/randomizedcoder/bsd-xtcp
9+
10+
LICENSE= MIT
11+
LICENSE_FILE= ${WRKSRC}/LICENSE
12+
13+
BUILD_DEPENDS= protobuf>=3.0:devel/protobuf
14+
15+
USES= cargo
16+
USE_GITHUB= yes
17+
CARGO_ENV+= GIT_CEILING_DIRECTORIES=${WRKDIR}
18+
19+
post-extract:
20+
@${MKDIR} ${WRKSRC}/.git/refs ${WRKSRC}/.git/objects
21+
@echo "ref: refs/heads/main" > ${WRKSRC}/.git/HEAD
22+
GH_ACCOUNT= randomizedcoder
23+
GH_PROJECT= bsd-xtcp
24+
25+
CARGO_CRATES= aho-corasick-1.1.4 \
26+
android_system_properties-0.1.5 \
27+
anstream-0.6.21 \
28+
anstyle-1.0.13 \
29+
anstyle-parse-0.2.7 \
30+
anstyle-query-1.1.5 \
31+
anstyle-wincon-3.0.11 \
32+
anyhow-1.0.102 \
33+
ascii-1.1.0 \
34+
autocfg-1.5.0 \
35+
base64-0.21.7 \
36+
bitflags-2.11.0 \
37+
bumpalo-3.20.2 \
38+
bytes-1.11.1 \
39+
cc-1.2.56 \
40+
cfg-if-1.0.4 \
41+
chrono-0.4.44 \
42+
chunked_transfer-1.5.0 \
43+
clap-4.5.60 \
44+
clap_builder-4.5.60 \
45+
clap_derive-4.5.55 \
46+
clap_lex-1.0.0 \
47+
colorchoice-1.0.4 \
48+
core-foundation-sys-0.8.7 \
49+
either-1.15.0 \
50+
equivalent-1.0.2 \
51+
errno-0.3.14 \
52+
escape8259-0.5.3 \
53+
fastrand-2.3.0 \
54+
find-msvc-tools-0.1.9 \
55+
fixedbitset-0.5.7 \
56+
foldhash-0.1.5 \
57+
getrandom-0.4.2 \
58+
hashbrown-0.15.5 \
59+
hashbrown-0.16.1 \
60+
heck-0.5.0 \
61+
hostname-0.4.2 \
62+
httpdate-1.0.3 \
63+
iana-time-zone-0.1.65 \
64+
iana-time-zone-haiku-0.1.2 \
65+
id-arena-2.3.0 \
66+
indexmap-2.13.0 \
67+
is_terminal_polyfill-1.70.2 \
68+
itertools-0.13.0 \
69+
itertools-0.14.0 \
70+
itoa-1.0.17 \
71+
js-sys-0.3.91 \
72+
leb128fmt-0.1.0 \
73+
libc-0.2.182 \
74+
libtest-mimic-0.8.1 \
75+
linux-raw-sys-0.12.1 \
76+
log-0.4.29 \
77+
memchr-2.8.0 \
78+
multimap-0.10.1 \
79+
num-traits-0.2.19 \
80+
once_cell-1.21.3 \
81+
once_cell_polyfill-1.70.2 \
82+
pbjson-0.7.0 \
83+
pbjson-build-0.7.0 \
84+
pbjson-types-0.7.0 \
85+
petgraph-0.7.1 \
86+
prettyplease-0.2.37 \
87+
proc-macro2-1.0.106 \
88+
prost-0.13.5 \
89+
prost-build-0.13.5 \
90+
prost-derive-0.13.5 \
91+
prost-types-0.13.5 \
92+
quote-1.0.45 \
93+
r-efi-6.0.0 \
94+
regex-1.12.3 \
95+
regex-automata-0.4.14 \
96+
regex-syntax-0.8.10 \
97+
rustix-1.1.4 \
98+
rustversion-1.0.22 \
99+
semver-1.0.27 \
100+
serde-1.0.228 \
101+
serde_core-1.0.228 \
102+
serde_derive-1.0.228 \
103+
serde_json-1.0.149 \
104+
shlex-1.3.0 \
105+
strsim-0.11.1 \
106+
syn-2.0.117 \
107+
tempfile-3.26.0 \
108+
thiserror-2.0.18 \
109+
thiserror-impl-2.0.18 \
110+
tiny_http-0.12.0 \
111+
unicode-ident-1.0.24 \
112+
unicode-xid-0.2.6 \
113+
utf8parse-0.2.2 \
114+
wasip2-1.0.2+wasi-0.2.9 \
115+
wasip3-0.4.0+wasi-0.3.0-rc-2026-01-06 \
116+
wasm-bindgen-0.2.114 \
117+
wasm-bindgen-macro-0.2.114 \
118+
wasm-bindgen-macro-support-0.2.114 \
119+
wasm-bindgen-shared-0.2.114 \
120+
wasm-encoder-0.244.0 \
121+
wasm-metadata-0.244.0 \
122+
wasmparser-0.244.0 \
123+
windows-core-0.62.2 \
124+
windows-implement-0.60.2 \
125+
windows-interface-0.59.3 \
126+
windows-link-0.2.1 \
127+
windows-result-0.4.1 \
128+
windows-strings-0.5.1 \
129+
windows-sys-0.61.2 \
130+
wit-bindgen-0.51.0 \
131+
wit-bindgen-core-0.51.0 \
132+
wit-bindgen-rust-0.51.0 \
133+
wit-bindgen-rust-macro-0.51.0 \
134+
wit-component-0.244.0 \
135+
wit-parser-0.244.0 \
136+
zmij-1.0.21
137+
138+
PLIST_FILES= bin/${PORTNAME}
139+
140+
.include <bsd.port.mk>

0 commit comments

Comments
 (0)