[RFC] Changes in stat structures

Gabor PALI pgj at FreeBSD.org
Sun Jun 20 21:26:45 UTC 2010


I would like to integrate my Google Summer of Code project from the
last year [1].  In brief, it was about converting netstat(1) into a
library and providing a relatively clean API to access various
networking statistics available in the kernel.  The project is far
from being complete, and it needs review but I decided to split my
large patch into smaller pieces and add the results continuously to
the FreeBSD src/ repository, otherwise it might vanish.  I do not have
a src/ commit bit, thus I am also looking for a sponsor for my changes
who approves or commits them.

My plan of integration is simple: apply the necessary modifications to
the kernel, add the sysctl export routines and data structures, add
the library (called libnetstat(3)), then adapt and add applications
(netstat(1), bsnmpd(1), nettop(1), etc.) to use it.  This way I could
get some review and continue the development of this library in an
interactive style.  The first piece of this set is available on my
FreeBSD homepage as a separate patch [2], which technically proposes
to a "standardization" for the counter values so they could be
accessed from both 32-bit and 64-bit environments without problems
(via kvm(3) or sysctl(3)).  However, I do not know too much about the
potential consequences or how such a change should be handled in the

For more information (and the complete patch), see the project's wiki
page [3].  Any feedback is appreciated.  Nothing is carved into stone,
I am very open to comments :)

Thank you!


[1] http://wiki.freebsd.org/PGJSoC2009
[2] http://people.freebsd.org/~pgj/libnetstat/libnetstat-sys.latest.diff
[3] http://wiki.freebsd.org/LibNetstat

More information about the freebsd-current mailing list