1 /* spp_var.h 6.1 85/05/30 */ 2 3 /* 4 * Sp control block, one per connection 5 */ 6 struct sppcb { 7 struct spidp_q s_q; /* queue for out-of-order receipt */ 8 struct nspcb *s_nspcb; /* backpointer to internet pcb */ 9 u_char s_state; 10 u_char s_flags; 11 #define SF_AK 0x01 /* Acknowledgement requested */ 12 #define SF_DELACK 0x02 /* Ak, waiting to see if we xmit*/ 13 #define SF_HI 0x04 /* Show headers on input */ 14 #define SF_HO 0x08 /* Show headers on output */ 15 #define SF_PI 0x10 /* Packet (datagram) interface */ 16 u_short s_mtu; /* Max packet size for this stream */ 17 /* use sequence fields in headers to store sequence numbers for this 18 connection */ 19 struct spidp s_shdr; /* prototype header to transmit */ 20 #define s_cc s_shdr.si_cc /* connection control (for EM bit) */ 21 #define s_dt s_shdr.si_dt /* datastream type */ 22 #define s_sid s_shdr.si_sid /* source connection identifier */ 23 #define s_did s_shdr.si_did /* destination connection identifier */ 24 #define s_seq s_shdr.si_seq /* sequence number */ 25 #define s_ack s_shdr.si_ack /* acknowledge number */ 26 #define s_alo s_shdr.si_alo /* allocation number */ 27 #define s_dport s_shdr.si_dna.x_port /* where we are sending */ 28 struct sphdr s_rhdr; /* last received header (in effect!)*/ 29 u_short s_rack; /* their acknowledge number */ 30 u_short s_ralo; /* their allocation number */ 31 u_short s_snt; /* highest packet # we have sent */ 32 33 /* timeout stuff */ 34 short s_idle; /* time idle */ 35 short s_timer[TCPT_NTIMERS]; /* timers */ 36 short s_rxtshift; /* log(2) of rexmt exp. backoff */ 37 u_short s_rtseq; /* packet being timed */ 38 short s_rtt; /* timer for round trips */ 39 short s_srtt; /* averaged timer */ 40 char s_force; /* which timer expired */ 41 42 /* out of band data */ 43 char s_oobflags; 44 #define SF_SOOB 0x08 /* sending out of band data */ 45 #define SF_IOOB 0x10 /* receiving out of band data */ 46 char s_iobc; /* input characters */ 47 /* debug stuff */ 48 u_short s_want; /* Last candidate for sending */ 49 }; 50 51 #define nstosppcb(np) ((struct sppcb *)(np)->nsp_pcb) 52 #define sotosppcb(so) (nstosppcb(sotonspcb(so))) 53 54 struct spp_istat { 55 short hdrops; 56 short badsum; 57 short badlen; 58 short slotim; 59 short fastim; 60 short nonucn; 61 short noconn; 62 short notme; 63 short wrncon; 64 short bdreas; 65 short gonawy; 66 }; 67 68 #ifdef KERNEL 69 struct spp_istat spp_istat; 70 u_short spp_iss; 71 extern struct sppcb *spp_close(), *spp_disconnect(), 72 *spp_usrclosed(), *spp_timers(), *spp_drop(); 73 #endif 74 75 #define SPP_ISSINCR 128 76 /* 77 * SPP sequence numbers are 16 bit integers operated 78 * on with modular arithmetic. These macros can be 79 * used to compare such integers. 80 */ 81 #define SSEQ_LT(a,b) (((short)((a)-(b))) < 0) 82 #define SSEQ_LEQ(a,b) (((short)((a)-(b))) <= 0) 83 #define SSEQ_GT(a,b) (((short)((a)-(b))) > 0) 84 #define SSEQ_GEQ(a,b) (((short)((a)-(b))) >= 0) 85