Include file changes. No more ../h
[unix-history] / usr / src / sys / netinet / tcp_timer.c
index 82d6acb..e234d7b 100644 (file)
@@ -1,25 +1,27 @@
-/* tcp_timer.c 4.20 82/04/04 */
+/*     tcp_timer.c     6.2     84/08/29        */
+
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "socket.h"
+#include "socketvar.h"
+#include "protosw.h"
+#include "errno.h"
 
 
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/socket.h"
-#include "../h/socketvar.h"
-#include "../h/protosw.h"
-#include "../net/in.h"
-#include "../net/route.h"
-#include "../net/in_pcb.h"
-#include "../net/in_systm.h"
 #include "../net/if.h"
 #include "../net/if.h"
-#include "../net/ip.h"
-#include "../net/ip_var.h"
-#include "../net/tcp.h"
-#include "../net/tcp_fsm.h"
-#include "../net/tcp_seq.h"
-#include "../net/tcp_timer.h"
-#include "../net/tcp_var.h"
-#include "../net/tcpip.h"
-#include "../errno.h"
+#include "../net/route.h"
+
+#include "in.h"
+#include "in_pcb.h"
+#include "in_systm.h"
+#include "ip.h"
+#include "ip_var.h"
+#include "tcp.h"
+#include "tcp_fsm.h"
+#include "tcp_seq.h"
+#include "tcp_timer.h"
+#include "tcp_var.h"
+#include "tcpip.h"
 
 int    tcpnodelack = 0;
 /*
 
 int    tcpnodelack = 0;
 /*
@@ -30,7 +32,6 @@ tcp_fasttimo()
        register struct inpcb *inp;
        register struct tcpcb *tp;
        int s = splnet();
        register struct inpcb *inp;
        register struct tcpcb *tp;
        int s = splnet();
-COUNT(TCP_FASTTIMO);
 
        inp = tcb.inp_next;
        if (inp)
 
        inp = tcb.inp_next;
        if (inp)
@@ -55,7 +56,6 @@ tcp_slowtimo()
        register struct tcpcb *tp;
        int s = splnet();
        register int i;
        register struct tcpcb *tp;
        int s = splnet();
        register int i;
-COUNT(TCP_SLOWTIMO);
 
        /*
         * Search through tcb's and update active timers.
 
        /*
         * Search through tcb's and update active timers.
@@ -74,7 +74,7 @@ COUNT(TCP_SLOWTIMO);
                        if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
                                (void) tcp_usrreq(tp->t_inpcb->inp_socket,
                                    PRU_SLOWTIMO, (struct mbuf *)0,
                        if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
                                (void) tcp_usrreq(tp->t_inpcb->inp_socket,
                                    PRU_SLOWTIMO, (struct mbuf *)0,
-                                   (caddr_t)i);
+                                   (struct mbuf *)i, (struct mbuf *)0);
                                if (ipnxt->inp_prev != ip)
                                        goto tpgone;
                        }
                                if (ipnxt->inp_prev != ip)
                                        goto tpgone;
                        }
@@ -97,24 +97,22 @@ tcp_canceltimers(tp)
 {
        register int i;
 
 {
        register int i;
 
-COUNT(TCP_CANCELTIMERS);
        for (i = 0; i < TCPT_NTIMERS; i++)
                tp->t_timer[i] = 0;
 }
 
 float  tcp_backoff[TCP_MAXRXTSHIFT] =
     { 1.0, 1.2, 1.4, 1.7, 2.0, 3.0, 5.0, 8.0, 16.0, 32.0 };
        for (i = 0; i < TCPT_NTIMERS; i++)
                tp->t_timer[i] = 0;
 }
 
 float  tcp_backoff[TCP_MAXRXTSHIFT] =
     { 1.0, 1.2, 1.4, 1.7, 2.0, 3.0, 5.0, 8.0, 16.0, 32.0 };
-int    tcprexmtprint = 0;
 int    tcpexprexmtbackoff = 0;
 /*
  * TCP timer processing.
  */
 int    tcpexprexmtbackoff = 0;
 /*
  * TCP timer processing.
  */
+struct tcpcb *
 tcp_timers(tp, timer)
        register struct tcpcb *tp;
        int timer;
 {
 
 tcp_timers(tp, timer)
        register struct tcpcb *tp;
        int timer;
 {
 
-COUNT(TCP_TIMERS);
        switch (timer) {
 
        /*
        switch (timer) {
 
        /*
@@ -122,8 +120,8 @@ COUNT(TCP_TIMERS);
         * control block.
         */
        case TCPT_2MSL:
         * control block.
         */
        case TCPT_2MSL:
-               tcp_close(tp);
-               return;
+               tp = tcp_close(tp);
+               break;
 
        /*
         * Retransmission timer went off.  Message has not
 
        /*
         * Retransmission timer went off.  Message has not
@@ -134,8 +132,8 @@ COUNT(TCP_TIMERS);
        case TCPT_REXMT:
                tp->t_rxtshift++;
                if (tp->t_rxtshift > TCP_MAXRXTSHIFT) {
        case TCPT_REXMT:
                tp->t_rxtshift++;
                if (tp->t_rxtshift > TCP_MAXRXTSHIFT) {
-                       tcp_drop(tp, ETIMEDOUT);
-                       return;
+                       tp = tcp_drop(tp, ETIMEDOUT);
+                       break;
                }
                TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
                    (int)tp->t_srtt, TCPTV_MIN, TCPTV_MAX);
                }
                TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
                    (int)tp->t_srtt, TCPTV_MIN, TCPTV_MAX);
@@ -149,24 +147,21 @@ COUNT(TCP_TIMERS);
                                tcp_backoff[tp->t_rxtshift - 1],
                            TCPTV_MIN, TCPTV_MAX);
                }
                                tcp_backoff[tp->t_rxtshift - 1],
                            TCPTV_MIN, TCPTV_MAX);
                }
-if (tcprexmtprint)
-printf("rexmt set to %d\n", tp->t_timer[TCPT_REXMT]);
                tp->snd_nxt = tp->snd_una;
                /* this only transmits one segment! */
                (void) tcp_output(tp);
                tp->snd_nxt = tp->snd_una;
                /* this only transmits one segment! */
                (void) tcp_output(tp);
-               return;
+               break;
 
        /*
         * Persistance timer into zero window.
         * Force a byte to be output, if possible.
         */
        case TCPT_PERSIST:
 
        /*
         * Persistance timer into zero window.
         * Force a byte to be output, if possible.
         */
        case TCPT_PERSIST:
+               tcp_setpersist(tp);
                tp->t_force = 1;
                (void) tcp_output(tp);
                tp->t_force = 0;
                tp->t_force = 1;
                (void) tcp_output(tp);
                tp->t_force = 0;
-               TCPT_RANGESET(tp->t_timer[TCPT_PERSIST],
-                   tcp_beta * tp->t_srtt, TCPTV_PERSMIN, TCPTV_MAX);
-               return;
+               break;
 
        /*
         * Keep-alive timer went off; send something
 
        /*
         * Keep-alive timer went off; send something
@@ -193,22 +188,10 @@ printf("rexmt set to %d\n", tp->t_timer[TCPT_REXMT]);
                } else
                        tp->t_idle = 0;
                tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
                } else
                        tp->t_idle = 0;
                tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
-               return;
+               break;
        dropit:
        dropit:
-               tcp_drop(tp, ETIMEDOUT);
-               return;
-
-#ifdef TCPTRUEOOB
-       /*
-        * Out-of-band data retransmit timer.
-        */
-       case TCPT_OOBREXMT:
-               if (tp->t_flags & TF_NOOPT)
-                       return;
-               (void) tcp_output(tp);
-               TCPT_RANGESET(tp->t_timer[TCPT_OOBREXMT],
-                   2 * tp->t_srtt, TCPTV_MIN, TCPTV_MAX);
-               return;
-#endif
+               tp = tcp_drop(tp, ETIMEDOUT);
+               break;
        }
        }
+       return (tp);
 }
 }