Re: Accessing tcp socket information from within a module

From: David S. Miller
Date: Sat Oct 04 2003 - 00:52:13 EST


On Fri, 03 Oct 2003 17:02:07 -0700
Vishwas Raman <vishwas@xxxxxxxxxxxxxxxxxxx> wrote:

> Is there some way of accessing the information of all open tcp sockets
> in the system, other than having to turn one of IPV6 or KHTTPD on?

You don't even need to write your kernel module, there is already
a special netlink socket provided to userspace exactly for this
purpose, to get info on all TCP sockets efficiently.

See net/ipv4/tcp_diag.c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/