Import Upstream version 1.8.5
[hcoop/debian/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/UDP 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 int rtt; /* Smoothed round trip time, measured in milliseconds/8 */
37 int rtt_dev; /* Smoothed rtt mean difference, in milliseconds/4 */
38 int nSent; /* Total number of distinct data packets sent, not including retransmissions */
39 int reSends; /* Total number of retransmissions for this peer, since this structure was created */
40
41 /* the "natural" MTU, excluding IP,UDP headers, is negotiated by the endpoints */
42 u_short natMTU; /* includes rx header */
43 u_short maxMTU;
44 /* negotiated maximum number of packets to send in a single datagram. */
45 u_short maxDgramPackets;
46 /* local maximum number of packets to send in a single datagram. */
47 u_short ifDgramPackets;
48 /*
49 * MTU, cwind, and nDgramPackets are used to initialize
50 * slow start parameters for new calls. These values are set whenever a
51 * call sends a retransmission and at the end of each call.
52 * congestSeq is incremented each time the congestion parameters are
53 * changed by a call recovering from a dropped packet. A call used
54 * MAX when updating congestion parameters if it started with the
55 * current congestion sequence number, otherwise it uses MIN.
56 */
57 u_short MTU; /* MTU for AFS 3.4a jumboGrams */
58 u_short cwind; /* congestion window */
59 u_short nDgramPackets; /* number packets per AFS 3.5 jumbogram */
60 u_short congestSeq; /* Changed when a call retransmits */
61 afs_uint64 bytesSent; /* Number of bytes sent to this peer */
62 afs_uint64 bytesReceived; /* Number of bytes received from this peer */
63 struct opr_queue rpcStats; /* rpc statistic list */
64 int lastReachTime; /* Last time we verified reachability */
65 afs_int32 maxPacketSize; /* Max size we sent that got acked (w/o hdrs) */
66 #ifdef AFS_RXERRQ_ENV
67 rx_atomic_t neterrs;
68
69 /* protected by peer_lock */
70 int last_err_origin; /* origin of the last network error received */
71 int last_err_type; /* last error 'type' received */
72 int last_err_code; /* last error 'code' received */
73 #endif
74 };
75
76 #endif