HardenedBSD/usr.bin/netstat
Kyle Evans f3a097d031 netstat: switch to using the sysctl-exported stats for live stats
Now that we export the relevant stats via the net.route.stats sysctl,
switch to using that to avoid having to dig around in mem(4) for live
kernel statistics.  Based on callers of kresolve_list(), this is the
last live path using mem(4) that could be functional today.

Tested both with `netstat -rs` and `netstat -rs -M`.

Note that this will not be able to extract stats from a running kernel
that predates 3360a15898 / 1500026, but this can be worked around by
specifying `-M /dev/mem` explicitly in the interim to fallback to
libkvm against /dev/mem.

Reviewed by:	glebius, markj, zlei
Differential Revision:	https://reviews.freebsd.org/D47231
2024-10-24 11:54:21 -05:00
..
bpf.c
common.c
common.h
if.c
inet6.c
inet.c
ipsec.c
main.c
Makefile
Makefile.depend
Makefile.depend.options
mbuf.c
mroute6.c
mroute.c
netgraph.c
netisr.c
netstat.1
netstat.h
nhgrp.c
nhops.c
nlist_symbols
pfkey.c
route_netlink.c
route.c
sctp.c
unix.c