rx: Use a red black tree for the event stack
[openafs.git] / src / rx / rx.h
index f45fbd0..50d2bf2 100644 (file)
@@ -152,6 +152,8 @@ rx_IsLoopbackAddr(afs_uint32 addr)
 #define rx_SetBeforeProc(service,proc) ((service)->beforeProc = (proc))
 #define rx_GetAfterProc(service) ((service)->afterProc)
 #define rx_GetBeforeProc(service) ((service)->beforeProc)
+#define rx_SetPostProc(service,proc) ((service)->postProc = (proc))
+#define rx_GetPostProc(service) ((service)->postProc)
 
 /* Define a procedure to be called when a server connection is created */
 #define rx_SetNewConnProc(service, proc) ((service)->newConnProc = (proc))
@@ -315,6 +317,7 @@ struct rx_service {
     void (*newConnProc) (struct rx_connection * tcon); /* Routine to call when a server connection is created */
     void (*beforeProc) (struct rx_call * acall);       /* routine to call before a call is executed */
     void (*afterProc) (struct rx_call * acall, afs_int32 code);        /* routine to call after a call is executed */
+    void (*postProc) (afs_int32 code); /* routine to call after the call has ended */
     u_short maxProcs;          /* Maximum procs to be used for this service */
     u_short minProcs;          /* Minimum # of requests guaranteed executable simultaneously */
     u_short connDeadTime;      /* Seconds until a client of this service will be declared dead, if it is not responding */
@@ -400,7 +403,6 @@ struct rx_peer {
  * is likely to have been dropped. */
     afs_uint32 inPacketSkew;   /* Maximum skew on incoming packets */
     afs_uint32 outPacketSkew;  /* Peer-reported max skew on our sent packets */
-    int rateFlag;              /* Flag for rate testing (-no 0yes +decrement) */
 
     /* the "natural" MTU, excluding IP,UDP headers, is negotiated by the endpoints */
     u_short natMTU;
@@ -427,11 +429,6 @@ struct rx_peer {
     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
@@ -444,6 +441,7 @@ struct rx_peer {
 #define RX_CONN_BUSY               32  /* connection is busy; don't delete */
 #define RX_CONN_ATTACHWAIT        64   /* attach waiting for peer->lastReach */
 #define RX_CONN_MAKECALL_ACTIVE   128   /* a thread is actively in rx_NewCall */
+#define RX_CONN_NAT_PING          256   /* nat ping requested */
 
 /* Type of connection, client or server */
 #define        RX_CLIENT_CONNECTION    0
@@ -531,6 +529,7 @@ struct rx_call {
     struct rxevent *keepAliveEvent;    /* Scheduled periodically in active calls to keep call alive */
     struct rxevent *growMTUEvent;      /* Scheduled periodically in active calls to discover true maximum MTU */
     struct rxevent *delayedAckEvent;   /* Scheduled after all packets are received to send an ack if a reply or new call is not generated soon */
+    struct clock delayedAckTime;        /* Time that next delayed ack was scheduled  for */
     struct rxevent *delayedAbortEvent; /* Scheduled to throttle looping client */
     int abortCode;             /* error code from last RPC */
     int abortCount;            /* number of times last error was sent */
@@ -583,9 +582,6 @@ struct rx_call {
 
     struct rx_packet *xmitList[RX_MAXACKS]; /* Can't xmit more than we ack */
                                 /* Protected by setting RX_CALL_TQ_BUSY */
-#ifdef ADAPT_WINDOW
-    struct clock pingRequestTime;
-#endif
 #ifdef RXDEBUG_PACKET
     u_short tqc;                /* packet count in tq */
     u_short rqc;                /* packet count in rq */