tconn = rx_ConnectionOf(acall);
tpeer = rx_PeerOf(tconn);
- printf("From %08x: %s <%d>\n", tpeer->host, amessage, acode);
+ printf("From %08x: %s <%d>\n", rx_HostOf(tpeer), amessage, acode);
return 0;
}
server = 0;
if (conn && conn->conns[count - 1]
&& rx_PeerOf(conn->conns[count - 1])) {
- server = rx_PeerOf(conn->conns[count - 1])->host;
+ server = rx_HostOf(rx_PeerOf(conn->conns[count - 1]));
}
afs_com_err(whoami, code,
"so %s.%s may still be locked (on server %d.%d.%d.%d)",
}
code = ubik_EndTrans(tt);
KALOG(aname, ainstance, NULL, NULL, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_CRUSER);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_CRUSER);
return code;
}
code = ubik_EndTrans(tt);
KALOG(aname, ainstance, NULL, NULL, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_CHPASSWD);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_CHPASSWD);
return code;
abort:
&user_schedule, ktc_to_cblockptr(&tentry.key), ENCRYPT);
code = ubik_EndTrans(tt);
KALOG(aname, ainstance, sname, sinst, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_AUTHENTICATE);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_AUTHENTICATE);
return code;
abort:
COUNT_ABO;
ubik_AbortTrans(tt);
KALOG(aname, ainstance, sname, sinst, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_AUTHFAILED);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_AUTHFAILED);
return code;
}
code = ubik_EndTrans(tt);
KALOG(aname, ainstance, NULL, NULL, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_SETFIELDS);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_SETFIELDS);
return code;
abort:
code = ubik_EndTrans(tt);
KALOG(aname, ainstance, NULL, NULL, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_DELUSER);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_DELUSER);
return code;
}
&schedule, ktc_to_cblockptr(&authSessionKey), ENCRYPT);
code = ubik_EndTrans(tt);
KALOG(name, instance, sname, sinstance, (import ? authDomain : NULL),
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_GETTICKET);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_GETTICKET);
return code;
abort:
code = ubik_EndTrans(tt);
KALOG(aname, ainstance, NULL, NULL, NULL,
- rx_PeerOf(rx_ConnectionOf(call))->host, LOG_UNLOCK);
+ rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), LOG_UNLOCK);
goto exit;
abort:
rx.o \
rx_call.o \
rx_conn.o \
+ rx_peer.o \
rx_rdwr.o \
rx_clock.o \
rx_event.o \
rx.o \
rx_call.o \
rx_conn.o \
+ rx_peer.o \
rx_rdwr.o \
rx_clock.o \
rx_event.o \
$(CRULE_OPT) $(TOP_SRC_RX)/rx_call.c
rx_conn.o: $(TOP_SRC_RX)/rx_conn.c
$(CRULE_OPT) $(TOP_SRC_RX)/rx_conn.c
+rx_peer.o: $(TOP_SRC_RX)/rx_peer.c
+ $(CRULE_OPT) $(TOP_SRC_RX)/rx_peer.c
rx_rdwr.o: $(TOP_SRC_RX)/rx_rdwr.c
$(CRULE_OPT) $(TOP_SRC_RX)/rx_rdwr.c
afs_uuid.o: $(TOP_SRCDIR)/util/uuid.c
rx_opaque.o \
rx_call.o \
rx_conn.o \
+ rx_peer.o \
rx_conncache.o \
rx_globals.o \
rx_identity.o \
rx_conncache.o: ${RX}/rx_conncache.c
$(AFS_CCRULE) $(RX)/rx_conncache.c
+rx_peer.o: $(RX)/rx_peer.c
+ $(AFS_CCRULE) $(RX)/rx_peer.c
+
rx_conn.o: ${RX}/rx_conn.c
$(AFS_CCRULE) $(RX)/rx_conn.c
$(OUT)\rx_packet.obj $(OUT)\rx_rdwr.obj $(OUT)\rx_trace.obj \
$(OUT)\rx_xmit_nt.obj $(OUT)\rx_conncache.obj $(OUT)\rx_opaque.obj \
$(OUT)\rx_identity.obj $(OUT)\rx_stats.obj \
- $(OUT)\rx_call.obj $(OUT)\rx_conn.obj
+ $(OUT)\rx_call.obj $(OUT)\rx_conn.obj $(OUT)\rx_peer.obj
RXSTATBJS = $(OUT)\rxstat.obj $(OUT)\rxstat.ss.obj $(OUT)\rxstat.xdr.obj $(OUT)\rxstat.cs.obj
rx_RecordCallStatistics @334
rx_KeepAliveOn @335
rx_KeepAliveOff @336
+ rx_HostOf @337
+ rx_PortOf @338
; for performance testing
rx_TSFPQGlobSize @2001 DATA
$(UOBJ)/rx_conncache.o \
$(UOBJ)/rx_call.o \
$(UOBJ)/rx_conn.o \
+ $(UOBJ)/rx_peer.o \
$(UOBJ)/xdr_rx.o \
$(UOBJ)/Kvldbint.cs.o \
$(UOBJ)/Kvldbint.xdr.o \
$(PICOBJ)/rx_conncache.o \
$(PICOBJ)/rx_call.o \
$(PICOBJ)/rx_conn.o \
+ $(PICOBJ)/rx_peer.o \
$(PICOBJ)/xdr_rx.o \
$(PICOBJ)/Kvldbint.cs.o \
$(PICOBJ)/Kvldbint.xdr.o \
$(WEBOBJ)/rx_conncache.o \
$(WEBOBJ)/rx_call.o \
$(WEBOBJ)/rx_conn.o \
+ $(WEBOBJ)/rx_peer.o \
$(WEBOBJ)/xdr_rx.o \
$(WEBOBJ)/Kvldbint.cs.o \
$(WEBOBJ)/Kvldbint.xdr.o \
$(WEBOBJ)/rx_conncache.o \
$(WEBOBJ)/rx_call.o \
$(WEBOBJ)/rx_conn.o \
+ $(WEBOBJ)/rx_peer.o \
$(WEBOBJ)/xdr_rx.o \
$(WEBOBJ)/Kvldbint.cs.o \
$(WEBOBJ)/Kvldbint.xdr.o \
$(JUAFS)/rx_conncache.o \
$(JUAFS)/rx_call.o \
$(JUAFS)/rx_conn.o \
+ $(JUAFS)/rx_peer.o \
$(JUAFS)/xdr_rx.o \
$(JUAFS)/Kvldbint.cs.o \
$(JUAFS)/Kvldbint.xdr.o \
$(CRULE1)
$(UOBJ)/rx_conn.o: $(TOP_SRCDIR)/rx/rx_conn.c
$(CRULE1)
+$(UOBJ)/rx_peer.o: $(TOP_SRCDIR)/rx/rx_peer.c
+ $(CRULE1)
$(UOBJ)/xdr_rx.o: $(TOP_SRC_RX)/xdr_rx.c
$(CRULE1)
$(UOBJ)/xdr_int32.o: $(TOP_SRC_RX)/xdr_int32.c
$(CRULEPIC)
$(PICOBJ)/rx_conn.o: $(TOP_SRCDIR)/rx/rx_conn.c
$(CRULEPIC)
+$(PICOBJ)/rx_peer.o: $(TOP_SRCDIR)/rx/rx_peer.c
+ $(CRULEPIC)
$(PICOBJ)/xdr_rx.o: $(TOP_SRC_RX)/xdr_rx.c
$(CRULEPIC)
$(PICOBJ)/xdr_int32.o: $(TOP_SRC_RX)/xdr_int32.c
$(CRULE2)
$(WEBOBJ)/rx_conn.o: $(TOP_SRCDIR)/rx/rx_conn.c
$(CRULE2)
+$(WEBOBJ)/rx_peer.o: $(TOP_SRCDIR)/rx/rx_peer.c
+ $(CRULE2)
$(WEBOBJ)/xdr_rx.o: $(TOP_SRC_RX)/xdr_rx.c
$(CRULE2)
$(WEBOBJ)/afs_usrops.o: $(TOP_SRC_AFS)/UKERNEL/afs_usrops.c
$(CRULE1)
$(JUAFS)/rx_conn.o: $(TOP_SRC_RX)/rx_conn.c
$(CRULE1)
+$(JUAFS)/rx_peer.o: $(TOP_SRC_RX)/rx_peer.c
+ $(CRULE1)
$(JUAFS)/xdr_rx.o: $(TOP_SRC_RX)/xdr_rx.c
$(CRULE1)
$(JUAFS)/xdr_int64.o: $(TOP_SRC_RX)/xdr_int64.c
RXOBJS_common = rx_clock.o rx_call.o rx_conn.o rx_event.o rx_user.o rx_lwp.o \
rx.o rx_null.o rx_globals.o rx_getaddr.o rx_misc.o rx_packet.o \
- rx_rdwr.o rx_trace.o rx_conncache.o rx_opaque.o rx_identity.o \
- rx_stats.o xdr_int32.o xdr_int64.o xdr_update.o xdr_refernce.o
+ rx_peer.o rx_rdwr.o rx_trace.o rx_conncache.o rx_opaque.o \
+ rx_identity.o rx_stats.o \
+ xdr_int32.o xdr_int64.o xdr_update.o xdr_refernce.o
RXOBJS = ${RXOBJS_common}
$(OUT)\rx_packet.obj $(OUT)\rx_rdwr.obj $(OUT)\rx_trace.obj \
$(OUT)\rx_xmit_nt.obj $(OUT)\rx_conncache.obj \
$(OUT)\rx_opaque.obj $(OUT)\rx_identity.obj $(OUT)\rx_stats.obj \
- $(OUT)\rx_call.obj $(OUT)\rx_conn.obj
+ $(OUT)\rx_call.obj $(OUT)\rx_conn.obj $(OUT)\rx_peer.obj
MULTIOBJS = $(OUT)\rx_multi.obj
#include "rx_stats.h"
#include "rx_event.h"
+#include "rx_peer.h"
#include "rx_conn.h"
#include "rx_call.h"
#include "rx_packet.h"
unsigned int totalFunc,
int isServer);
+/* Peer management */
+extern afs_uint32 rx_HostOf(struct rx_peer *peer);
+extern u_short rx_PortOf(struct rx_peer *peer);
/* Packets */
#define RX_WAIT 1
#define RX_DONTWAIT 0
-#define rx_HostOf(peer) ((peer)->host)
-#define rx_PortOf(peer) ((peer)->port)
#define rx_GetLocalStatus(call, status) ((call)->localStatus)
osi_socket *socketp;
};
-
-/* A peer refers to a peer process, specified by a (host,port) pair. There may be more than one peer on a given host. */
-#ifdef KDUMP_RX_LOCK
-struct rx_peer_rx_lock {
- struct rx_peer_rx_lock *next; /* Next in hash conflict or free list */
-#else
-struct rx_peer {
- struct rx_peer *next; /* Next in hash conflict or free list */
-#endif
-#ifdef RX_ENABLE_LOCKS
- afs_kmutex_t peer_lock; /* Lock peer */
-#endif /* RX_ENABLE_LOCKS */
- afs_uint32 host; /* Remote IP address, in net byte order */
- u_short port; /* Remote UDP port, in net byte order */
-
- /* interface mtu probably used for this host - includes RX Header */
- u_short ifMTU; /* doesn't include IP header */
-
- /* For garbage collection */
- afs_uint32 idleWhen; /* When the refcountwent to zero */
- afs_int32 refCount; /* Reference count for this structure (rx_peerHashTable_lock) */
-
- /* Congestion control parameters */
- u_char burstSize; /* Reinitialization size for the burst parameter */
- u_char burst; /* Number of packets that can be transmitted right now, without pausing */
- struct clock burstWait; /* Delay until new burst is allowed */
- struct rx_queue congestionQueue; /* Calls that are waiting for non-zero burst value */
- int rtt; /* Smoothed round trip time, measured in milliseconds/8 */
- int rtt_dev; /* Smoothed rtt mean difference, in milliseconds/4 */
- 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 */
-
-/* Skew: if a packet is received N packets later than expected (based
- * on packet serial numbers), then we define it to have a skew of N.
- * The maximum skew values allow us to decide when a packet hasn't
- * been received yet because it is out-of-order, as opposed to when it
- * 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 */
-
- /* the "natural" MTU, excluding IP,UDP headers, is negotiated by the endpoints */
- u_short natMTU;
- u_short maxMTU;
- /* negotiated maximum number of packets to send in a single datagram. */
- u_short maxDgramPackets;
- /* local maximum number of packets to send in a single datagram. */
- u_short ifDgramPackets;
- /*
- * MTU, cwind, and nDgramPackets are used to initialize
- * slow start parameters for new calls. These values are set whenever a
- * call sends a retransmission and at the end of each call.
- * congestSeq is incremented each time the congestion parameters are
- * changed by a call recovering from a dropped packet. A call used
- * MAX when updating congestion parameters if it started with the
- * current congestion sequence number, otherwise it uses MIN.
- */
- u_short MTU; /* MTU for AFS 3.4a jumboGrams */
- u_short cwind; /* congestion window */
- u_short nDgramPackets; /* number packets per AFS 3.5 jumbogram */
- u_short congestSeq; /* Changed when a call retransmits */
- afs_hyper_t bytesSent; /* Number of bytes sent to this peer */
- afs_hyper_t bytesReceived; /* Number of bytes received from this peer */
- struct rx_queue rpcStats; /* rpc statistic list */
- int lastReachTime; /* Last time we verified reachability */
- afs_int32 maxPacketSize; /* peer packetsize hint */
-};
-
#ifndef KDUMP_RX_LOCK
/* Flag bits for connection structure */
#define RX_CONN_MAKECALL_WAITING 1 /* rx_NewCall is waiting for a channel */
#include "rx_packet.h"
#include "rx_internal.h"
#include "rx_stats.h"
+#include "rx_peer.h"
#ifdef AFS_HPUX110_ENV
#include "h/tihdr.h"
#include "rx_internal.h"
#include "rx_stats.h"
+#include "rx_peer.h"
#include "rx_conn.h"
#include "rx_call.h"
--- /dev/null
+/*
+ * 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
+ */
+
+#include <afsconfig.h>
+#include <afs/param.h>
+
+#include <roken.h>
+
+#include "rx.h"
+
+#include "rx_atomic.h"
+#include "rx_clock.h"
+#include "rx_peer.h"
+
+afs_uint32 rx_HostOf(struct rx_peer *peer) {
+ return peer->host;
+}
+
+u_short rx_PortOf(struct rx_peer *peer) {
+ return peer->port;
+}
--- /dev/null
+/*
+ * 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
+ */
+
+#ifndef OPENAFS_RX_PEER_H
+#define OPENAFS_RX_PEER_H
+
+/* A peer refers to a peer process, specified by a (host,port) pair. There may
+ * be more than one peer on a given host. */
+
+#ifdef KDUMP_RX_LOCK
+struct rx_peer_rx_lock {
+ struct rx_peer_rx_lock *next; /* Next in hash conflict or free list */
+#else
+struct rx_peer {
+ struct rx_peer *next; /* Next in hash conflict or free list */
+#endif
+#ifdef RX_ENABLE_LOCKS
+ afs_kmutex_t peer_lock; /* Lock peer */
+#endif /* RX_ENABLE_LOCKS */
+ afs_uint32 host; /* Remote IP address, in net byte order */
+ u_short port; /* Remote UDP port, in net byte order */
+
+ /* interface mtu probably used for this host - includes RX Header */
+ u_short ifMTU; /* doesn't include IP header */
+
+ /* For garbage collection */
+ afs_uint32 idleWhen; /* When the refcountwent to zero */
+ afs_int32 refCount; /* Reference count for this structure (rx_peerHashTable_lock) */
+
+ /* Congestion control parameters */
+ u_char burstSize; /* Reinitialization size for the burst parameter */
+ u_char burst; /* Number of packets that can be transmitted right now, without pausing */
+ struct clock burstWait; /* Delay until new burst is allowed */
+ struct rx_queue congestionQueue; /* Calls that are waiting for non-zero burst value */
+ int rtt; /* Smoothed round trip time, measured in milliseconds/8 */
+ int rtt_dev; /* Smoothed rtt mean difference, in milliseconds/4 */
+ 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 */
+
+/* Skew: if a packet is received N packets later than expected (based
+ * on packet serial numbers), then we define it to have a skew of N.
+ * The maximum skew values allow us to decide when a packet hasn't
+ * been received yet because it is out-of-order, as opposed to when it
+ * 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 */
+
+ /* the "natural" MTU, excluding IP,UDP headers, is negotiated by the endpoints */
+ u_short natMTU;
+ u_short maxMTU;
+ /* negotiated maximum number of packets to send in a single datagram. */
+ u_short maxDgramPackets;
+ /* local maximum number of packets to send in a single datagram. */
+ u_short ifDgramPackets;
+ /*
+ * MTU, cwind, and nDgramPackets are used to initialize
+ * slow start parameters for new calls. These values are set whenever a
+ * call sends a retransmission and at the end of each call.
+ * congestSeq is incremented each time the congestion parameters are
+ * changed by a call recovering from a dropped packet. A call used
+ * MAX when updating congestion parameters if it started with the
+ * current congestion sequence number, otherwise it uses MIN.
+ */
+ u_short MTU; /* MTU for AFS 3.4a jumboGrams */
+ u_short cwind; /* congestion window */
+ u_short nDgramPackets; /* number packets per AFS 3.5 jumbogram */
+ u_short congestSeq; /* Changed when a call retransmits */
+ afs_hyper_t bytesSent; /* Number of bytes sent to this peer */
+ afs_hyper_t bytesReceived; /* Number of bytes received from this peer */
+ struct rx_queue rpcStats; /* rpc statistic list */
+ int lastReachTime; /* Last time we verified reachability */
+ afs_int32 maxPacketSize; /* peer packetsize hint */
+};
+
+#endif
#include "rx_atomic.h"
#include "rx_globals.h"
#include "rx_stats.h"
+#include "rx_peer.h"
#include "rx_packet.h"
#ifdef AFS_PTHREAD_ENV
rx_stats.o \
rx_trace.o \
rx_multi.o \
+ rx_peer.o \
rx_conn.o \
rx_call.o
rx_call.o: ${RX}/rx_call.c
$(AFS_CCRULE) $(RX)/rx_call.c
-rx_conn.o : ${RX}/rx_conn.c
+rx_conn.o: ${RX}/rx_conn.c
$(AFS_CCRULE) $(RX)/rx_conn.c
+rx_peer.o: ${RX}/rx_peer.c
+ $(AFS_CCRULE) $(RX)/rx_peer.c
+
rx_null.o: ${RX}/rx_null.c
$(AFS_CCRULE) $(RX)/rx_null.c
rx_GetSecurityHeaderSize;
rx_SetSecurityHeaderSize;
rx_SetSecurityMaxTrailerSize;
+ rx_HostOf;
+ rx_PortOf;
local:
*;
};
if (!FidArray && !CallBackArray) {
ViceLog(1,
("SAFS_GiveUpAllCallBacks: host=%x\n",
- (rx_PeerOf(tcon) ? rx_PeerOf(tcon)->host : 0)));
+ (rx_PeerOf(tcon) ? rx_HostOf(rx_PeerOf(tcon)) : 0)));
errorCode = GetClient(tcon, &client);
if (!errorCode) {
H_LOCK;
ViceLog(0,
("GiveUpCallBacks: #Fids %d < #CallBacks %d, host=%x\n",
FidArray->AFSCBFids_len, CallBackArray->AFSCBs_len,
- (rx_PeerOf(tcon) ? rx_PeerOf(tcon)->host : 0)));
+ (rx_PeerOf(tcon) ? rx_HostOf(rx_PeerOf(tcon)) : 0)));
errorCode = EINVAL;
goto Bad_GiveUpCallBacks;
}