diff options
author | Garrett Wollman <wollman@FreeBSD.org> | 1998-05-15 20:11:40 +0000 |
---|---|---|
committer | Garrett Wollman <wollman@FreeBSD.org> | 1998-05-15 20:11:40 +0000 |
commit | 98271db4d5d00999e63492d6550727afc907e54c (patch) | |
tree | bc0add632f758bedefe2376aa377106fc29c7c20 /sys/netinet/in_pcb.h | |
parent | eb92a3476660337bff6b68d001390e77d47b208b (diff) | |
download | src-98271db4d5d00999e63492d6550727afc907e54c.tar.gz src-98271db4d5d00999e63492d6550727afc907e54c.zip |
Convert socket structures to be type-stable and add a version number.
Define a parameter which indicates the maximum number of sockets in a
system, and use this to size the zone allocators used for sockets and
for certain PCBs.
Convert PF_LOCAL PCB structures to be type-stable and add a version number.
Define an external format for infomation about socket structures and use
it in several places.
Define a mechanism to get all PF_LOCAL and PF_INET PCB lists through
sysctl(3) without blocking network interrupts for an unreasonable
length of time. This probably still has some bugs and/or race
conditions, but it seems to work well enough on my machines.
It is now possible for `netstat' to get almost all of its information
via the sysctl(3) interface rather than reading kmem (changes to follow).
Notes
Notes:
svn path=/head/; revision=36079
Diffstat (limited to 'sys/netinet/in_pcb.h')
-rw-r--r-- | sys/netinet/in_pcb.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 467a5b2dd610..aa2d0bec301f 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: in_pcb.h,v 1.24 1998/03/24 18:06:11 wollman Exp $ + * $Id: in_pcb.h,v 1.25 1998/03/28 10:18:22 bde Exp $ */ #ifndef _NETINET_IN_PCB_H_ @@ -48,6 +48,7 @@ */ LIST_HEAD(inpcbhead, inpcb); LIST_HEAD(inpcbporthead, inpcbport); +typedef u_quad_t inp_gen_t; /* * NB: the zone allocator is type-stable EXCEPT FOR THE FIRST TWO LONGS @@ -75,7 +76,7 @@ struct inpcb { struct ip_moptions *inp_moptions; /* IP multicast options */ LIST_ENTRY(inpcb) inp_portlist; /* list for this PCB's local port */ struct inpcbport *inp_phd; /* head of this list */ - u_quad_t inp_gencnt; /* generation count of this instance */ + inp_gen_t inp_gencnt; /* generation count of this instance */ }; /* * The range of the generation count, as used in this implementation, @@ -84,6 +85,26 @@ struct inpcb { * unlikely that we simply don't concern ourselves with that possibility. */ +/* + * Interface exported to userland by various protocols which use + * inpcbs. Hack alert -- only define if struct xsocket is in scope. + */ +#ifdef _SYS_SOCKETVAR_H_ +struct xinpcb { + size_t xi_len; /* length of this structure */ + struct inpcb xi_inp; + struct xsocket xi_socket; + u_quad_t xi_alignment_hack; +}; + +struct xinpgen { + size_t xig_len; /* length of this structure */ + u_int xig_count; /* number of PCBs at this time */ + inp_gen_t xig_gen; /* generation count at this time */ + so_gen_t xig_sogen; /* socket generation count at this time */ +}; +#endif /* _SYS_SOCKETVAR_H_ */ + struct inpcbport { LIST_ENTRY(inpcbport) phd_hash; struct inpcbhead phd_pcblist; |