347361f72ac361551165360969fc4c743a71495d
[openafs.git] / src / rx / rx_peer.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef OPENAFS_RX_PEER_H
11 #define OPENAFS_RX_PEER_H
12
13 /* A peer refers to a peer process, specified by a (host,port) pair.  There may
14  * be more than one peer on a given host. */
15
16 #ifdef KDUMP_RX_LOCK
17 struct rx_peer_rx_lock {
18     struct rx_peer_rx_lock *next;       /* Next in hash conflict or free list */
19 #else
20 struct rx_peer {
21     struct rx_peer *next;       /* Next in hash conflict or free list */
22 #endif
23 #ifdef RX_ENABLE_LOCKS
24     afs_kmutex_t peer_lock;     /* Lock peer */
25 #endif                          /* RX_ENABLE_LOCKS */
26     afs_uint32 host;            /* Remote IP address, in net byte order */
27     u_short port;               /* Remote UDP port, in net byte order */
28
29     /* interface mtu probably used for this host  -  includes RX Header */
30     u_short ifMTU;              /* doesn't include IP header */
31
32     /* For garbage collection */
33     afs_uint32 idleWhen;        /* When the refcountwent to zero */
34     afs_int32 refCount;         /* Reference count for this structure (rx_peerHashTable_lock) */
35
36     /* Congestion control parameters */
37     u_char burstSize;           /* Reinitialization size for the burst parameter */
38     u_char burst;               /* Number of packets that can be transmitted right now, without pausing */
39     struct clock burstWait;     /* Delay until new burst is allowed */
40     struct rx_queue congestionQueue;    /* Calls that are waiting for non-zero burst value */
41     int rtt;                    /* Smoothed round trip time, measured in milliseconds/8 */
42     int rtt_dev;                /* Smoothed rtt mean difference, in milliseconds/4 */
43     int nSent;                  /* Total number of distinct data packets sent, not including retransmissions */
44     int reSends;                /* Total number of retransmissions for this peer, since this structure was created */
45
46     /* the "natural" MTU, excluding IP,UDP headers, is negotiated by the endpoints */
47     u_short natMTU;
48     u_short maxMTU;
49     /* negotiated maximum number of packets to send in a single datagram. */
50     u_short maxDgramPackets;
51     /* local maximum number of packets to send in a single datagram. */
52     u_short ifDgramPackets;
53     /*
54      * MTU, cwind, and nDgramPackets are used to initialize
55      * slow start parameters for new calls. These values are set whenever a
56      * call sends a retransmission and at the end of each call.
57      * congestSeq is incremented each time the congestion parameters are
58      * changed by a call recovering from a dropped packet. A call used
59      * MAX when updating congestion parameters if it started with the
60      * current congestion sequence number, otherwise it uses MIN.
61      */
62     u_short MTU;                /* MTU for AFS 3.4a jumboGrams */
63     u_short cwind;              /* congestion window */
64     u_short nDgramPackets;      /* number packets per AFS 3.5 jumbogram */
65     u_short congestSeq;         /* Changed when a call retransmits */
66     afs_hyper_t bytesSent;      /* Number of bytes sent to this peer */
67     afs_hyper_t bytesReceived;  /* Number of bytes received from this peer */
68     struct rx_queue rpcStats;   /* rpc statistic list */
69     int lastReachTime;          /* Last time we verified reachability */
70     afs_int32 maxPacketSize;    /* peer packetsize hint */
71 };
72
73 #endif