BSD 4_3_Reno release
[unix-history] / usr / src / sys / sys / unpcb.h
index f3204aa..395d31d 100644 (file)
@@ -1,18 +1,32 @@
 /*
 /*
- * Copyright (c) 1982 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
+ * All rights reserved.
  *
  *
- *     @(#)unpcb.h     6.2 (Berkeley) %G%
+ * Redistribution is only permitted until one year after the first shipment
+ * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
+ * binary forms are permitted provided that: (1) source distributions retain
+ * this entire copyright notice and comment, and (2) distributions including
+ * binaries display the following acknowledgement:  This product includes
+ * software developed by the University of California, Berkeley and its
+ * contributors'' in the documentation or other materials provided with the
+ * distribution and in all advertising materials mentioning features or use
+ * of this software.  Neither the name of the University nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)unpcb.h     7.6 (Berkeley) 6/28/90
  */
 
 /*
  * Protocol control block for an active
  * instance of a UNIX internal protocol.
  *
  */
 
 /*
  * Protocol control block for an active
  * instance of a UNIX internal protocol.
  *
- * A socket may be associated with an inode in the
- * file system.  If so, the unp_inode pointer holds
- * a reference count to this inode, which should be irele'd
+ * A socket may be associated with an vnode in the
+ * file system.  If so, the unp_vnode pointer holds
+ * a reference count to this vnode, which should be irele'd
  * when the socket goes away.
  *
  * A socket may be connected to another socket, in which
  * when the socket goes away.
  *
  * A socket may be connected to another socket, in which
  * by a number of other sockets and may also reference a socket (not
  * necessarily one which is referencing it).  This generates
  * the need for unp_refs and unp_nextref to be separate fields.
  * by a number of other sockets and may also reference a socket (not
  * necessarily one which is referencing it).  This generates
  * the need for unp_refs and unp_nextref to be separate fields.
+ *
+ * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt
+ * so that changes in the sockbuf may be computed to modify
+ * back pressure on the sender accordingly.
  */
 struct unpcb {
        struct  socket *unp_socket;     /* pointer back to socket */
  */
 struct unpcb {
        struct  socket *unp_socket;     /* pointer back to socket */
-       struct  inode *unp_inode;       /* if associated with file */
+       struct  vnode *unp_vnode;       /* if associated with file */
+       ino_t   unp_ino;                /* fake inode number */
        struct  unpcb *unp_conn;        /* control block of connected socket */
        struct  unpcb *unp_refs;        /* referencing socket linked list */
        struct  unpcb *unp_nextref;     /* link in unp_refs list */
        struct  unpcb *unp_conn;        /* control block of connected socket */
        struct  unpcb *unp_refs;        /* referencing socket linked list */
        struct  unpcb *unp_nextref;     /* link in unp_refs list */
-       struct  mbuf *unp_remaddr;      /* address of connected socket */
+       struct  mbuf *unp_addr;         /* bound address of socket */
+       int     unp_cc;                 /* copy of rcv.sb_cc */
+       int     unp_mbcnt;              /* copy of rcv.sb_mbcnt */
 };
 
 #define        sotounpcb(so)   ((struct unpcb *)((so)->so_pcb))
 };
 
 #define        sotounpcb(so)   ((struct unpcb *)((so)->so_pcb))