rx: Remove the ADAPT_WINDOW code
[openafs.git] / src / rx / rx_user.c
index 8fbeaf4..bbda449 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
+
+#include <afs/opr.h>
 
-# include <sys/types.h>
-# include <errno.h>
-# include <signal.h>
-# include <string.h>
 #ifdef AFS_NT40_ENV
 # include <WINNT/syscfg.h>
 #else
-# include <sys/socket.h>
-# include <sys/file.h>
-# include <netdb.h>
-# include <sys/stat.h>
-# include <netinet/in.h>
-# include <sys/time.h>
 # include <net/if.h>
-# include <sys/ioctl.h>
-# include <unistd.h>
 #endif
-# include <fcntl.h>
 #if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV)
 # include <sys/syscall.h>
 #endif
@@ -54,9 +44,6 @@
 #endif
 #endif
 
-#ifndef AFS_NT40_ENV
-# include <sys/time.h>
-#endif
 #include "rx.h"
 #include "rx_atomic.h"
 #include "rx_globals.h"
@@ -246,7 +233,7 @@ osi_Panic(char *msg, ...)
     va_end(ap);
     fflush(stderr);
     fflush(stdout);
-    afs_abort();
+    opr_abort();
 }
 
 /*
@@ -683,8 +670,6 @@ rxi_InitPeerParams(struct rx_peer *pp)
     struct sockaddr_in addr;
 #endif
 
-
-
     LOCK_IF_INIT;
     if (!Inited) {
        UNLOCK_IF_INIT;
@@ -703,19 +688,19 @@ rxi_InitPeerParams(struct rx_peer *pp)
     ppaddr = ntohl(pp->host);
 
     pp->ifMTU = 0;
-    pp->timeout.sec = 2;
-    pp->rateFlag = 2;          /* start timing after two full packets */
+    rx_rto_setPeerTimeoutSecs(pp, 2);
     /* I don't initialize these, because I presume they are bzero'd...
      * pp->burstSize pp->burst pp->burstWait.sec pp->burstWait.usec
-     * pp->timeout.usec */
+     */
 
     LOCK_IF;
     for (ix = 0; ix < rxi_numNetAddrs; ++ix) {
        if ((rxi_NetAddrs[ix] & myNetMasks[ix]) == (ppaddr & myNetMasks[ix])) {
 #ifdef IFF_POINTOPOINT
            if (myNetFlags[ix] & IFF_POINTOPOINT)
-               pp->timeout.sec = 4;
+               rx_rto_setPeerTimeoutSecs(pp, 4);
 #endif /* IFF_POINTOPOINT */
+
            rxmtu = myNetMTUs[ix] - RX_IPUDP_SIZE;
            if (rxmtu < RX_MIN_PACKET_SIZE)
                rxmtu = RX_MIN_PACKET_SIZE;
@@ -725,12 +710,11 @@ rxi_InitPeerParams(struct rx_peer *pp)
     }
     UNLOCK_IF;
     if (!pp->ifMTU) {          /* not local */
-       pp->timeout.sec = 3;
+       rx_rto_setPeerTimeoutSecs(pp, 3);
        pp->ifMTU = MIN(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE);
     }
 #else /* ADAPT_MTU */
-    pp->rateFlag = 2;          /* start timing after two full packets */
-    pp->timeout.sec = 2;
+    rx_rto_setPeerTimeoutSecs(pp, 2);
     pp->ifMTU = MIN(rx_MyMaxSendSize, OLD_MAX_PACKET_SIZE);
 #endif /* ADAPT_MTU */
 #if defined(ADAPT_PMTU) && defined(IP_MTU)