consider machine dependent now, so purge sun crud
[unix-history] / usr / src / sys / netinet / tcp_var.h
CommitLineData
2f9fe2d6 1/* tcp_var.h 4.17 82/12/20 */
ad6d0022
BJ
2
3/*
4 * Kernel variables for tcp.
5 */
6
7/*
405c9168 8 * Tcp control block, one per tcp; fields:
ad6d0022 9 */
53a5409e 10struct tcpcb {
a6503abf
BJ
11 struct tcpiphdr *seg_next; /* sequencing queue */
12 struct tcpiphdr *seg_prev;
4aed14e3 13 short t_state; /* state of this connection */
a41e26c7 14 short t_timer[TCPT_NTIMERS]; /* tcp timers */
405c9168 15 short t_rxtshift; /* log(2) of rexmt exp. backoff */
a41e26c7
BJ
16 struct mbuf *t_tcpopt; /* tcp options */
17 struct mbuf *t_ipopt; /* ip options */
18 short t_maxseg; /* maximum segment size */
4aed14e3 19 char t_force; /* 1 if forcing out a byte */
2ff61f9d 20 u_char t_flags;
a41e26c7
BJ
21#define TF_ACKNOW 0x01 /* ack peer immediately */
22#define TF_DELACK 0x02 /* ack, but try to delay it */
8b5a83bb
BJ
23#define TF_DONTKEEP 0x04 /* don't use keep-alives */
24#define TF_NOOPT 0x08 /* don't use tcp options */
2ff61f9d
BJ
25 struct tcpiphdr *t_template; /* skeletal packet for transmit */
26 struct inpcb *t_inpcb; /* back pointer to internet pcb */
ad6d0022 27/*
2ff61f9d
BJ
28 * The following fields are used as in the protocol specification.
29 * See RFC783, Dec. 1981, page 21.
ad6d0022 30 */
2ff61f9d
BJ
31/* send sequence variables */
32 tcp_seq snd_una; /* send unacknowledged */
33 tcp_seq snd_nxt; /* send next */
2ff61f9d
BJ
34 tcp_seq snd_up; /* send urgent pointer */
35 tcp_seq snd_wl1; /* window update seg seq number */
36 tcp_seq snd_wl2; /* window update seg ack number */
37 tcp_seq iss; /* initial send sequence number */
4aed14e3 38 u_short snd_wnd; /* send window */
2ff61f9d 39/* receive sequence variables */
f3800948 40 short rcv_wnd; /* receive window */
4aed14e3 41 tcp_seq rcv_nxt; /* receive next */
2ff61f9d
BJ
42 tcp_seq rcv_up; /* receive urgent pointer */
43 tcp_seq irs; /* initial receive sequence number */
ad6d0022 44/*
2ff61f9d 45 * Additional variables for this implementation.
ad6d0022 46 */
2ff61f9d 47/* receive variables */
a6503abf
BJ
48 tcp_seq rcv_adv; /* advertised window */
49/* retransmit variables */
a41e26c7 50 tcp_seq snd_max; /* highest sequence number sent
a6503abf 51 used to recognize retransmits */
405c9168
BJ
52/* transmit timing stuff */
53 short t_idle; /* inactivity time */
54 short t_rtt; /* round trip time */
55 tcp_seq t_rtseq; /* sequence number being timed */
56 float t_srtt; /* smoothed round-trip time */
8b5a83bb
BJ
57/* out-of-band data */
58 char t_oobflags; /* have some */
b2db9217 59 char t_iobc; /* input character */
8b5a83bb 60#define TCPOOB_HAVEDATA 0x01
2ff61f9d 61};
ad6d0022 62
2ff61f9d
BJ
63#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
64#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
ad6d0022 65
2b4b57cd
BJ
66struct tcpstat {
67 int tcps_badsum;
68 int tcps_badoff;
69 int tcps_hdrops;
70 int tcps_badsegs;
71 int tcps_unack;
72};
73
ad6d0022 74#ifdef KERNEL
2ff61f9d
BJ
75struct inpcb tcb; /* head of queue of active tcpcb's */
76struct tcpstat tcpstat; /* tcp statistics */
53a5409e 77struct tcpiphdr *tcp_template();
ad6d0022 78#endif