1*4658Swnj /* socket.h 4.1 81/10/29 */ 2*4658Swnj 3*4658Swnj /* 4*4658Swnj * User connection block 5*4658Swnj */ 6*4658Swnj struct ucb { 7*4658Swnj struct host *uc_host; /* foreign host table entry */ 8*4658Swnj struct proc *uc_proc; /* user proc */ 9*4658Swnj union { /* protocol control block */ 10*4658Swnj char *unull; /* general */ 11*4658Swnj struct tcb *utcb; /* for tcp */ 12*4658Swnj } U_cp; 13*4658Swnj #define uc_tcb U_cp.utcb 14*4658Swnj struct mbuf *uc_sbuf; /* user send buffer */ 15*4658Swnj struct mbuf *uc_rbuf; /* user receive buffer */ 16*4658Swnj u_char uc_lolink; /* lowest link no. in range (raw) */ 17*4658Swnj u_char uc_hilink; /* highest link no. in range (raw) */ 18*4658Swnj u_char uc_snd; /* # send bufs allocated */ 19*4658Swnj u_char uc_ssize; /* # bufs on send buffer */ 20*4658Swnj #define uc_timeo uc_ssize /* user timeout parameter */ 21*4658Swnj short uc_rhiwat; 22*4658Swnj short uc_rcc; 23*4658Swnj u_char uc_state; /* state of this connection */ 24*4658Swnj u_short uc_flags; /* misc. flags (see below) */ 25*4658Swnj struct proc *uc_rsel; /* read selecting proc */ 26*4658Swnj struct th *uc_template; 27*4658Swnj }; 28*4658Swnj struct th *tcp_template(); 29*4658Swnj 30*4658Swnj /* uc_flags field definitions */ 31*4658Swnj #define UEOL 00001 /* EOL sent */ 32*4658Swnj #define UURG 00002 /* urgent data sent */ 33*4658Swnj #define UDEBUG 00004 /* turn on debugging info recording */ 34*4658Swnj #define UTCP 00020 /* this is a TCP connection */ 35*4658Swnj #define UIP 00040 /* this is a raw IP connection */ 36*4658Swnj #define URAW 00100 /* this is a raw 1822 connection */ 37*4658Swnj #define ULISTEN 00200 /* awaiting a connection */ 38*4658Swnj #define UCTL 00400 /* this is a control port only */ 39*4658Swnj #define URMSK 00560 40*4658Swnj #define URCOLL 01000 /* someone collided on read select */ 41*4658Swnj #define URLOCK 02000 /* for uc_rbuf */ 42*4658Swnj #define URWANT 04000 43*4658Swnj 44*4658Swnj /* connection state field */ 45*4658Swnj #define UCLOSED 0000 /* connection closed */ 46*4658Swnj #define UCLSERR 0001 /* error -- connection closing */ 47*4658Swnj #define UABORT 0002 /* connection aborted */ 48*4658Swnj #define UINTIMO 0004 /* open failed -- init timeout */ 49*4658Swnj #define URXTIMO 0010 /* retransmit too long timeout */ 50*4658Swnj #define URESET 0020 /* connection aborted due to reset */ 51*4658Swnj #define UOPERR 0040 /* open failed -- not enough buffers */ 52*4658Swnj #define UURGENT 0100 /* urgent data received */ 53*4658Swnj #define UNETDWN 0200 /* connection aborted due to net */ 54*4658Swnj 55*4658Swnj #ifdef KERNEL 56*4658Swnj struct ucb *contab, *conNCON; 57*4658Swnj int nnetcon; 58*4658Swnj #endif 59