summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.h
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-04-09 01:29:31 +0000
committerdg <dg@FreeBSD.org>1995-04-09 01:29:31 +0000
commit919fdebd0e121a9cf0b773da1b2886e1d0b05b56 (patch)
treee79f945463f3979c08d227856c89070dadbf446b /sys/netinet/in_pcb.h
parentcc2a98d4eb3f7c92285a86b6d88ddd139e5e323e (diff)
downloadFreeBSD-src-919fdebd0e121a9cf0b773da1b2886e1d0b05b56.zip
FreeBSD-src-919fdebd0e121a9cf0b773da1b2886e1d0b05b56.tar.gz
Implemented PCB hashing. Includes new functions in_pcbinshash, in_pcbrehash,
and in_pcblookuphash.
Diffstat (limited to 'sys/netinet/in_pcb.h')
-rw-r--r--sys/netinet/in_pcb.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 9946f12..5112e6e 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.4 1994/08/21 05:27:28 paul Exp $
+ * $Id: in_pcb.h,v 1.5 1995/03/16 18:14:52 bde Exp $
*/
#ifndef _NETINET_IN_PCB_H_
@@ -44,11 +44,12 @@
* up (to a socket structure) and down (to a protocol-specific)
* control block.
*/
+LIST_HEAD(inpcbhead, inpcb);
+
struct inpcb {
- struct inpcb *inp_next,*inp_prev;
- /* pointers to other pcb's */
- struct inpcb *inp_head; /* pointer back to chain of inpcb's
- for this protocol */
+ LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
+ LIST_ENTRY(inpcb) inp_hash; /* hash list */
+ struct inpcbinfo *inp_pcbinfo;
struct in_addr inp_faddr; /* foreign host table entry */
u_short inp_fport; /* foreign port */
struct in_addr inp_laddr; /* local host table entry */
@@ -62,6 +63,13 @@ struct inpcb {
struct ip_moptions *inp_moptions; /* IP multicast options */
};
+struct inpcbinfo {
+ struct inpcbhead *listhead;
+ struct inpcbhead *hashbase;
+ unsigned long hashsize;
+ unsigned short lastport;
+};
+
/* flags in inp_flags: */
#define INP_RECVOPTS 0x01 /* receive incoming IP options */
#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */
@@ -70,24 +78,28 @@ struct inpcb {
#define INP_HDRINCL 0x08 /* user supplies entire IP header */
#define INPLOOKUP_WILDCARD 1
-#define INPLOOKUP_SETLOCAL 2
#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
#ifdef KERNEL
void in_losing __P((struct inpcb *));
-int in_pcballoc __P((struct socket *, struct inpcb *));
+int in_pcballoc __P((struct socket *, struct inpcbinfo *));
int in_pcbbind __P((struct inpcb *, struct mbuf *));
int in_pcbconnect __P((struct inpcb *, struct mbuf *));
void in_pcbdetach __P((struct inpcb *));
void in_pcbdisconnect __P((struct inpcb *));
+void in_pcbinshash __P((struct inpcb *));
int in_pcbladdr __P((struct inpcb *, struct mbuf *,
struct sockaddr_in **));
struct inpcb *
- in_pcblookup __P((struct inpcb *,
+ in_pcblookup __P((struct inpcbhead *,
struct in_addr, u_int, struct in_addr, u_int, int));
-void in_pcbnotify __P((struct inpcb *, struct sockaddr *,
+struct inpcb *
+ in_pcblookuphash __P((struct inpcbinfo *,
+ struct in_addr, u_int, struct in_addr, u_int));
+void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
+void in_pcbrehash __P((struct inpcb *));
void in_rtchange __P((struct inpcb *, int));
void in_setpeeraddr __P((struct inpcb *, struct mbuf *));
void in_setsockaddr __P((struct inpcb *, struct mbuf *));
OpenPOWER on IntegriCloud