add flag to avoid delay of short packets (Nagle algorithm)
[unix-history] / usr / src / sys / netinet / tcp_var.h
index 4627480..df54206 100644 (file)
@@ -1,4 +1,10 @@
-/*     tcp_var.h       4.13    81/12/12        */
+/*
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)tcp_var.h   6.6 (Berkeley) %G%
+ */
 
 /*
  * Kernel variables for tcp.
 
 /*
  * Kernel variables for tcp.
@@ -14,15 +20,13 @@ struct tcpcb {
        short   t_timer[TCPT_NTIMERS];  /* tcp timers */
        short   t_rxtshift;             /* log(2) of rexmt exp. backoff */
        struct  mbuf *t_tcpopt;         /* tcp options */
        short   t_timer[TCPT_NTIMERS];  /* tcp timers */
        short   t_rxtshift;             /* log(2) of rexmt exp. backoff */
        struct  mbuf *t_tcpopt;         /* tcp options */
-       struct  mbuf *t_ipopt;          /* ip options */
        short   t_maxseg;               /* maximum segment size */
        char    t_force;                /* 1 if forcing out a byte */
        u_char  t_flags;
        short   t_maxseg;               /* maximum segment size */
        char    t_force;                /* 1 if forcing out a byte */
        u_char  t_flags;
-#define        TF_ACKNOW       0x01                    /* ack peer immediately */
-#define        TF_DELACK       0x02                    /* ack, but try to delay it */
-#define        TF_PUSH         0x04                    /* push mode */
-#define        TF_URG          0x08                    /* urgent mode */
-#define        TF_DONTKEEP     0x10                    /* don't use keep-alives */
+#define        TF_ACKNOW       0x01            /* ack peer immediately */
+#define        TF_DELACK       0x02            /* ack, but try to delay it */
+#define        TF_NODELAY      0x04            /* don't delay packets to coalesce */
+#define        TF_NOOPT        0x08            /* don't use tcp options */
        struct  tcpiphdr *t_template;   /* skeletal packet for transmit */
        struct  inpcb *t_inpcb;         /* back pointer to internet pcb */
 /*
        struct  tcpiphdr *t_template;   /* skeletal packet for transmit */
        struct  inpcb *t_inpcb;         /* back pointer to internet pcb */
 /*
@@ -38,7 +42,7 @@ struct tcpcb {
        tcp_seq iss;                    /* initial send sequence number */
        u_short snd_wnd;                /* send window */
 /* receive sequence variables */
        tcp_seq iss;                    /* initial send sequence number */
        u_short snd_wnd;                /* send window */
 /* receive sequence variables */
-       short   rcv_wnd;                /* receive window */
+       u_short rcv_wnd;                /* receive window */
        tcp_seq rcv_nxt;                /* receive next */
        tcp_seq rcv_up;                 /* receive urgent pointer */
        tcp_seq irs;                    /* initial receive sequence number */
        tcp_seq rcv_nxt;                /* receive next */
        tcp_seq rcv_up;                 /* receive urgent pointer */
        tcp_seq irs;                    /* initial receive sequence number */
@@ -49,12 +53,22 @@ struct tcpcb {
        tcp_seq rcv_adv;                /* advertised window */
 /* retransmit variables */
        tcp_seq snd_max;                /* highest sequence number sent
        tcp_seq rcv_adv;                /* advertised window */
 /* retransmit variables */
        tcp_seq snd_max;                /* highest sequence number sent
-                                          used to recognize retransmits */
+                                        * used to recognize retransmits
+                                        */
+/* congestion control (for source quench) */
+       u_short snd_cwnd;               /* congestion-controlled window */
 /* transmit timing stuff */
        short   t_idle;                 /* inactivity time */
        short   t_rtt;                  /* round trip time */
 /* transmit timing stuff */
        short   t_idle;                 /* inactivity time */
        short   t_rtt;                  /* round trip time */
+       u_short max_rcvd;               /* most peer has sent into window */
        tcp_seq t_rtseq;                /* sequence number being timed */
        float   t_srtt;                 /* smoothed round-trip time */
        tcp_seq t_rtseq;                /* sequence number being timed */
        float   t_srtt;                 /* smoothed round-trip time */
+       u_short max_sndwnd;             /* largest window peer has offered */
+/* out-of-band data */
+       char    t_oobflags;             /* have some */
+       char    t_iobc;                 /* input character */
+#define        TCPOOB_HAVEDATA 0x01
+#define        TCPOOB_HADDATA  0x02
 };
 
 #define        intotcpcb(ip)   ((struct tcpcb *)(ip)->inp_ppcb)
 };
 
 #define        intotcpcb(ip)   ((struct tcpcb *)(ip)->inp_ppcb)
@@ -72,4 +86,6 @@ struct        tcpstat {
 struct inpcb tcb;              /* head of queue of active tcpcb's */
 struct tcpstat tcpstat;        /* tcp statistics */
 struct tcpiphdr *tcp_template();
 struct inpcb tcb;              /* head of queue of active tcpcb's */
 struct tcpstat tcpstat;        /* tcp statistics */
 struct tcpiphdr *tcp_template();
+struct tcpcb *tcp_close(), *tcp_drop();
+struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed();
 #endif
 #endif