]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Switch netstat -rn to use standard API for retrieving list of routes
authormelifaro <melifaro@FreeBSD.org>
Wed, 18 Dec 2013 18:25:27 +0000 (18:25 +0000)
committermelifaro <melifaro@FreeBSD.org>
Wed, 18 Dec 2013 18:25:27 +0000 (18:25 +0000)
commit7173e205105313324cbd901162f9ba86be7953e2
treed98eb913a4cc494a85d3719d221fad093be38e95
parent566238caa7ea8d8f087bfebc41b84642cb0afecc
Switch netstat -rn to use standard API for retrieving list of routes
instead of peeking inside in-kernel radix via kget.
This permits us to change kernel structures without breaking userland.
Additionally, this change provide more reliable and faster output.

`Refs` and `Use` fields available in IPv4 by default (and via -W
for other families) were removed. `Refs` is radix-specific thing
which is not informative for users. `Use` field value is handy sometimes,
but a) current API does not support it and b) I'm not sure we will
support per-rte pcpu counters in near future.

Old method of retrieving data is still supported (either by defining
NewTree=0 or running netstat with -A). However, Refs/Use fields are
hidden.

Sponsored by: Yandex LLC
MFC after: 4 weeks
PR: kern/167204
usr.bin/netstat/route.c