tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Obtaining list of created sockets



On Mon, Jun 30, 2014 at 09:39:37AM -0700, Will Dignazio wrote:
> That would be an excellent start; I had considered it before, however I
> thought that netstat only listed listening connections. With lsof, you
> would only get sockets created with fsocket (those having file descriptors).
> 
> I suppose combining the way the two get their information would yield a
> majority of the sockets created, however I would like to get all internal
> sockets that may not be listening yet, or never get a file descriptor.

Some years back, I modified gre(4) to use an actual socket instead of
rolling its own GRE or UDP packets.  IIRC, I made gre(4) *always* create
a file descriptor so that fstat(1) provided a comprehensive view of the
sockets in the system.

Having sockets in the system that appear neither in fstat(1) nor nor
netstat(8) output seems like an unnecessary mystery/complication to me.

Dave

-- 
David Young
dyoung%pobox.com@localhost    Urbana, IL    (217) 721-9981


Home | Main Index | Thread Index | Old Index