Re: Static content in /proc/net/dev.
Hi,
Mats Erik Andersson <mats.andersson@gisladisker.se> writes:
> as I learned in another message [1] the fact that
> "/proc/net/dev" lists wrong interface names (eth0 and
> similar) might be easily mended. However, much worse
> is the fact that "/proc/net/dev" seems never to be
> updated, thus rendering many networking tools useless
afaik /proc/net/dev is just a compatibility wrapper originally created
for running non-free linux binaries of Netscape on freebsd ;-)
</troll>
The current implementation is indeed very simple:
/*
* Filler function for proc/net/dev
*/
static int
linprocfs_donetdev(PFS_FILL_ARGS)
{
char ifname[16]; /* XXX LINUX_IFNAMSIZ */
struct ifnet *ifp;
sbuf_printf(sb, "%6s|%58s|%s\n%6s|%58s|%58s\n",
"Inter-", " Receive", " Transmit", " face",
"bytes packets errs drop fifo frame compressed",
"bytes packets errs drop fifo frame compressed");
CURVNET_SET(TD_TO_VNET(curthread));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
linux_ifname(ifp, ifname, sizeof ifname);
sbuf_printf(sb, "%6.6s:", ifname);
sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ",
0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);
sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);
}
IFNET_RUNLOCK();
CURVNET_RESTORE();
return (0);
}
I think you need to discuss with upstream whether they want to extend
this compatibility wrapper or rather see us port the applications to
the native interface. Would
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
perhaps be the proper forum for this?
best regards,
Timo Lindfors
Reply to: