1: /*
   2:  * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
   3:  * All rights reserved.
   4:  *
   5:  * Redistribution and use in source and binary forms are permitted
   6:  * provided that this notice is preserved and that due credit is given
   7:  * to the University of California at Berkeley. The name of the University
   8:  * may not be used to endorse or promote products derived from this
   9:  * software without specific prior written permission. This software
  10:  * is provided ``as is'' without express or implied warranty.
  11:  *
  12:  *      @(#)spp_var.h	7.4.1 (2.11BSD GTE) 12/31/93
  13:  */
  14: 
  15: /*
  16:  * Sp control block, one per connection
  17:  */
  18: struct sppcb {
  19:     struct  spidp_q s_q;        /* queue for out-of-order receipt */
  20:     struct  nspcb   *s_nspcb;   /* backpointer to internet pcb */
  21:     u_char  s_state;
  22:     u_char  s_flags;
  23: #define SF_ACKNOW   0x01        /* Ack peer immediately */
  24: #define SF_DELACK   0x02        /* Ack, but try to delay it */
  25: #define SF_HI   0x04            /* Show headers on input */
  26: #define SF_HO   0x08            /* Show headers on output */
  27: #define SF_PI   0x10            /* Packet (datagram) interface */
  28: #define SF_WIN  0x20            /* Window info changed */
  29: #define SF_RXT  0x40            /* Rxt info changed */
  30: #define SF_RVD  0x80            /* Calling from read usrreq routine */
  31:     u_short s_mtu;          /* Max packet size for this stream */
  32: /* use sequence fields in headers to store sequence numbers for this
  33:    connection */
  34:     struct  idp *s_idp;
  35:     struct  sphdr   s_shdr;     /* prototype header to transmit */
  36: #define s_cc s_shdr.sp_cc       /* connection control (for EM bit) */
  37: #define s_dt s_shdr.sp_dt       /* datastream type */
  38: #define s_sid s_shdr.sp_sid     /* source connection identifier */
  39: #define s_did s_shdr.sp_did     /* destination connection identifier */
  40: #define s_seq s_shdr.sp_seq     /* sequence number */
  41: #define s_ack s_shdr.sp_ack     /* acknowledge number */
  42: #define s_alo s_shdr.sp_alo     /* allocation number */
  43: #define s_dport s_idp->idp_dna.x_port   /* where we are sending */
  44:     struct sphdr s_rhdr;        /* last received header (in effect!)*/
  45:     u_short s_rack;         /* their acknowledge number */
  46:     u_short s_ralo;         /* their allocation number */
  47:     u_short s_smax;         /* highest packet # we have sent */
  48:     u_short s_snxt;         /* which packet to send next */
  49: 
  50: /* congestion control */
  51: #define CUNIT   1024            /* scaling for ... */
  52:     int s_cwnd;         /* Congestion-controlled window */
  53:                     /* in packets * CUNIT */
  54:     short   s_swnd;         /* == tcp snd_wnd, in packets */
  55:     short   s_smxw;         /* == tcp max_sndwnd */
  56:                     /* difference of two spp_seq's can be
  57: 					   no bigger than a short */
  58:     u_short s_swl1;         /* == tcp snd_wl1 */
  59:     u_short s_swl2;         /* == tcp snd_wl2 */
  60:     int s_cwmx;         /* max allowable cwnd */
  61:     int s_ssthresh;     /* s_cwnd size threshhold for
  62: 					 * slow start exponential-to-
  63: 					 * linear switch */
  64: /* transmit timing stuff
  65:  * srtt and rttvar are stored as fixed point, for convenience in smoothing.
  66:  * srtt has 3 bits to the right of the binary point, rttvar has 2.
  67:  */
  68:     short   s_idle;         /* time idle */
  69:     short   s_timer[SPPT_NTIMERS];  /* timers */
  70:     short   s_rxtshift;     /* log(2) of rexmt exp. backoff */
  71:     short   s_rxtcur;       /* current retransmit value */
  72:     u_short s_rtseq;        /* packet being timed */
  73:     short   s_rtt;          /* timer for round trips */
  74:     short   s_srtt;         /* averaged timer */
  75:     short   s_rttvar;       /* variance in round trip time */
  76:     char    s_force;        /* which timer expired */
  77:     char    s_dupacks;      /* counter to intuit xmt loss */
  78: 
  79: /* out of band data */
  80:     char    s_oobflags;
  81: #define SF_SOOB 0x08            /* sending out of band data */
  82: #define SF_IOOB 0x10            /* receiving out of band data */
  83:     char    s_iobc;         /* input characters */
  84: /* debug stuff */
  85:     u_short s_want;         /* Last candidate for sending */
  86:     char    s_outx;         /* exit taken from spp_output */
  87:     char    s_inx;          /* exit taken from spp_input */
  88: };
  89: 
  90: #define nstosppcb(np)   ((struct sppcb *)(np)->nsp_pcb)
  91: #define sotosppcb(so)   (nstosppcb(sotonspcb(so)))
  92: 
  93: struct  sppstat {
  94:     long    spps_connattempt;   /* connections initiated */
  95:     long    spps_accepts;       /* connections accepted */
  96:     long    spps_connects;      /* connections established */
  97:     long    spps_drops;     /* connections dropped */
  98:     long    spps_conndrops;     /* embryonic connections dropped */
  99:     long    spps_closed;        /* conn. closed (includes drops) */
 100:     long    spps_segstimed;     /* segs where we tried to get rtt */
 101:     long    spps_rttupdated;    /* times we succeeded */
 102:     long    spps_delack;        /* delayed acks sent */
 103:     long    spps_timeoutdrop;   /* conn. dropped in rxmt timeout */
 104:     long    spps_rexmttimeo;    /* retransmit timeouts */
 105:     long    spps_persisttimeo;  /* persist timeouts */
 106:     long    spps_keeptimeo;     /* keepalive timeouts */
 107:     long    spps_keepprobe;     /* keepalive probes sent */
 108:     long    spps_keepdrops;     /* connections dropped in keepalive */
 109: 
 110:     long    spps_sndtotal;      /* total packets sent */
 111:     long    spps_sndpack;       /* data packets sent */
 112:     long    spps_sndbyte;       /* data bytes sent */
 113:     long    spps_sndrexmitpack; /* data packets retransmitted */
 114:     long    spps_sndrexmitbyte; /* data bytes retransmitted */
 115:     long    spps_sndacks;       /* ack-only packets sent */
 116:     long    spps_sndprobe;      /* window probes sent */
 117:     long    spps_sndurg;        /* packets sent with URG only */
 118:     long    spps_sndwinup;      /* window update-only packets sent */
 119:     long    spps_sndctrl;       /* control (SYN|FIN|RST) packets sent */
 120:     long    spps_sndvoid;       /* couldn't find requested packet*/
 121: 
 122:     long    spps_rcvtotal;      /* total packets received */
 123:     long    spps_rcvpack;       /* packets received in sequence */
 124:     long    spps_rcvbyte;       /* bytes received in sequence */
 125:     long    spps_rcvbadsum;     /* packets received with ccksum errs */
 126:     long    spps_rcvbadoff;     /* packets received with bad offset */
 127:     long    spps_rcvshort;      /* packets received too short */
 128:     long    spps_rcvduppack;    /* duplicate-only packets received */
 129:     long    spps_rcvdupbyte;    /* duplicate-only bytes received */
 130:     long    spps_rcvpartduppack;    /* packets with some duplicate data */
 131:     long    spps_rcvpartdupbyte;    /* dup. bytes in part-dup. packets */
 132:     long    spps_rcvoopack;     /* out-of-order packets received */
 133:     long    spps_rcvoobyte;     /* out-of-order bytes received */
 134:     long    spps_rcvpackafterwin;   /* packets with data after window */
 135:     long    spps_rcvbyteafterwin;   /* bytes rcvd after window */
 136:     long    spps_rcvafterclose; /* packets rcvd after "close" */
 137:     long    spps_rcvwinprobe;   /* rcvd window probe packets */
 138:     long    spps_rcvdupack;     /* rcvd duplicate acks */
 139:     long    spps_rcvacktoomuch; /* rcvd acks for unsent data */
 140:     long    spps_rcvackpack;    /* rcvd ack packets */
 141:     long    spps_rcvackbyte;    /* bytes acked by rcvd acks */
 142:     long    spps_rcvwinupd;     /* rcvd window update packets */
 143: };
 144: struct  spp_istat {
 145:     short   hdrops;
 146:     short   badsum;
 147:     short   badlen;
 148:     short   slotim;
 149:     short   fastim;
 150:     short   nonucn;
 151:     short   noconn;
 152:     short   notme;
 153:     short   wrncon;
 154:     short   bdreas;
 155:     short   gonawy;
 156:     short   notyet;
 157:     short   lstdup;
 158:     struct sppstat newstats;
 159: };
 160: 
 161: #ifdef SUPERVISOR
 162: struct spp_istat spp_istat;
 163: 
 164: /* Following was struct sppstat sppstat; */
 165: #ifndef sppstat
 166: #define sppstat spp_istat.newstats
 167: #endif
 168: 
 169: u_short spp_iss;
 170: extern struct sppcb *spp_close(), *spp_disconnect(),
 171:     *spp_usrclosed(), *spp_timers(), *spp_drop();
 172: #endif
 173: 
 174: #define SPP_ISSINCR 128
 175: /*
 176:  * SPP sequence numbers are 16 bit integers operated
 177:  * on with modular arithmetic.  These macros can be
 178:  * used to compare such integers.
 179:  */
 180: #ifdef sun
 181: short xnsCbug;
 182: #define SSEQ_LT(a,b)    ((xnsCbug = (short)((a)-(b))) < 0)
 183: #define SSEQ_LEQ(a,b)   ((xnsCbug = (short)((a)-(b))) <= 0)
 184: #define SSEQ_GT(a,b)    ((xnsCbug = (short)((a)-(b))) > 0)
 185: #define SSEQ_GEQ(a,b)   ((xnsCbug = (short)((a)-(b))) >= 0)
 186: #else
 187: #define SSEQ_LT(a,b)    (((short)((a)-(b))) < 0)
 188: #define SSEQ_LEQ(a,b)   (((short)((a)-(b))) <= 0)
 189: #define SSEQ_GT(a,b)    (((short)((a)-(b))) > 0)
 190: #define SSEQ_GEQ(a,b)   (((short)((a)-(b))) >= 0)
 191: #endif

Defined variables

spp_istat defined in line 162; used 21 times
xnsCbug defined in line 181; used 4 times

Defined struct's

spp_istat defined in line 144; used 4 times
sppcb defined in line 18; used 68 times
sppstat defined in line 93; used 2 times
  • in line 158(2)

Defined macros

CUNIT defined in line 51; used 12 times
SF_ACKNOW defined in line 23; used 9 times
SF_DELACK defined in line 24; used 4 times
SF_HI defined in line 25; used 4 times
SF_HO defined in line 26; used 5 times
SF_IOOB defined in line 82; used 3 times
SF_PI defined in line 27; used 4 times
SF_RVD defined in line 30; used 2 times
SF_RXT defined in line 29; used 3 times
SF_SOOB defined in line 81; used 4 times
SF_WIN defined in line 28; used 4 times
SPP_ISSINCR defined in line 174; used 2 times
SSEQ_GEQ defined in line 190; never used
SSEQ_GT defined in line 189; used 7 times
SSEQ_LEQ defined in line 188; used 2 times
SSEQ_LT defined in line 187; used 12 times
nstosppcb defined in line 90; used 7 times
s_ack defined in line 41; used 7 times
s_alo defined in line 42; used 8 times
s_cc defined in line 36; used 5 times
s_did defined in line 39; used 3 times
s_dport defined in line 43; used 1 times
s_dt defined in line 37; used 1 times
s_seq defined in line 40; used 2 times
s_sid defined in line 38; used 3 times
sotosppcb defined in line 91; never used
sppstat defined in line 166; used 85 times

Usage of this include

Last modified: 1994-01-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 925
Valid CSS Valid XHTML 1.0 Strict