[BusyBox] lsof applet
Mark Senior
mark.senior at sasktel.net
Mon Apr 19 23:45:53 UTC 2004
Hello
I'm writing a simple lsof applet for busybox. It's largely based on
Tony J. White's fuser applet, but a completely separate implementation.
I realize it's waaay too late to be in 1.00, and anyway it's a little
ways short of completion even now. The big thing missing (from my
point of view anyway) is the ability to nicely present socket info - to
put procfs's "socket:[9999]" as something like
"10.0.0.1:1234->10.0.0.2:22".
The logic for parsing /proc/net/(unix,tcp[6],udp[6],raw[6]) entries
into struct sockaddr_in's and such is already in netstat.c. Seems a
waste to be putting largely identical functionality in two different
places.
Might it be reasonable to put that into libbb? I guess the downside
would be that someone who wanted neither netstat nor lsof would still
be building those functions into libbb (or am I missing something?)
Anyway, any thoughts would be appreciated.
Oh, incidentally, lsof.o comes in at just over a kilobyte right now
without the network entry translation. Could probably be shaved down
somewhat with a little tweaking.
Thanks
Mark
More information about the busybox
mailing list