/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#define rx_SecurityClassOf(conn) ((conn)->securityIndex)
#define rx_SecurityObjectOf(conn) ((conn)->securityObject)
+static_inline int
+rx_IsLoopbackAddr(afs_uint32 addr)
+{
+ return ((addr & 0xffff0000) == 0x7f000000);
+}
+
/*******************
* Macros callable by the user to further define attributes of a
* service. Must be called before rx_StartServer
#define rx_PutConnection(conn) rx_DestroyConnection(conn)
-/* A connection is an authenticated communication path, allowing
+/* A connection is an authenticated communication path, allowing
limited multiple asynchronous conversations. */
#ifdef KDUMP_RX_LOCK
struct rx_connection_rx_lock {
int rtt; /* Smoothed round trip time, measured in milliseconds/8 */
int rtt_dev; /* Smoothed rtt mean difference, in milliseconds/4 */
struct clock timeout; /* Current retransmission delay */
+ int backedOff; /* Has the timeout been backed off due to a missing packet? */
int nSent; /* Total number of distinct data packets sent, not including retransmissions */
int reSends; /* Total number of retransmissions for this peer, since this structure was created */
struct rx_queue rpcStats; /* rpc statistic list */
int lastReachTime; /* Last time we verified reachability */
afs_int32 maxPacketSize; /* peer packetsize hint */
+
+#ifdef ADAPT_WINDOW
+ afs_int32 smRtt;
+ afs_int32 countDown;
+#endif
};
#ifndef KDUMP_RX_LOCK
* The following fields are accessed while the call is unlocked.
* These fields are used by the caller/server thread to marshall
* and unmarshall RPC data. The only time they may be changed by
- * other threads is when the RX_CALL_IOVEC_WAIT flag is set.
- *
+ * other threads is when the RX_CALL_IOVEC_WAIT flag is set.
+ *
* NOTE: Be sure that these fields start and end on a double
* word boundary. Otherwise threads that are changing
* adjacent fields will cause problems.
short refCDebug[RX_CALL_REFCOUNT_MAX];
#endif /* RX_REFCOUNT_CHECK */
- /*
+ /*
* iov, iovNBytes, iovMax, and iovNext are set in rxi_ReadvProc()
* and adjusted by rxi_FillReadVec(). iov does not own the buffers
* it refers to. The buffers belong to the packets stored in iovq.
afs_hyper_t bytesRcvd; /* Number bytes received */
u_short tqWaiters;
+#ifdef ADAPT_WINDOW
+ struct clock pingRequestTime;
+#endif
#ifdef RXDEBUG_PACKET
u_short tqc; /* packet count in tq */
u_short rqc; /* packet count in rq */
#define RX_ACK_PING 6 /* This is a keep-alive ack */
#define RX_ACK_PING_RESPONSE 7 /* Ack'ing because we were pinged */
#define RX_ACK_DELAY 8 /* Ack generated since nothing has happened since receiving packet */
-#define RX_ACK_IDLE 9 /* Similar to RX_ACK_DELAY, but can
+#define RX_ACK_IDLE 9 /* Similar to RX_ACK_DELAY, but can
* be used to compute RTT */
+#define RX_ACK_MTU -1 /* will be rewritten to ACK_PING */
/* Packet acknowledgement type */
#define RX_ACK_TYPE_NACK 0 /* I Don't have this packet */
/* Configuration settings */
-/* Enum for storing configuration variables which can be set via the
+/* Enum for storing configuration variables which can be set via the
* SetConfiguration method in the rx_securityClass, below
*/
};
struct rx_debugConn_vL {
- afs_int32 host;
+ afs_uint32 host;
afs_int32 cid;
afs_int32 serial;
afs_int32 callNumber[RX_MAXCALLS];
};
struct rx_debugConn {
- afs_int32 host;
+ afs_uint32 host;
afs_int32 cid;
afs_int32 serial;
afs_int32 callNumber[RX_MAXCALLS];
#ifdef AFS_NT40_ENV
extern int rx_DumpCalls(FILE *outputFile, char *cookie);
-
-#define rx_MutexIncrement(object, mutex) InterlockedIncrement(&object)
-#define rx_MutexAdd(object, addend, mutex) InterlockedExchangeAdd(&object, addend)
-#define rx_MutexDecrement(object, mutex) InterlockedDecrement(&object)
-#define rx_MutexAdd1Increment2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- InterlockedIncrement(&object2); \
- MUTEX_EXIT(&mutex); \
- } while (0)
-#define rx_MutexAdd1Decrement2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- InterlockedDecrement(&object2); \
- MUTEX_EXIT(&mutex); \
- } while (0)
-#else
-#define rx_MutexIncrement(object, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object++; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexAdd(object, addend, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object += addend; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexAdd1Increment2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- object2++; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexAdd1Decrement2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- object2--; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexDecrement(object, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object--; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#endif
+#endif
#endif /* _RX_ End of rx.h */