void *unused, int unused2);
static void rxi_ReapConnections(struct rxevent *unused, void *unused1,
void *unused2, int unused3);
+static struct rx_packet *rxi_SendCallAbort(struct rx_call *call,
+ struct rx_packet *packet,
+ int istack, int force);
+static void rxi_AckAll(struct rxevent *event, struct rx_call *call,
+ char *dummy);
+static struct rx_connection
+ *rxi_FindConnection(osi_socket socket, afs_uint32 host, u_short port,
+ u_short serviceId, afs_uint32 cid,
+ afs_uint32 epoch, int type, u_int securityIndex);
+static struct rx_packet
+ *rxi_ReceiveDataPacket(struct rx_call *call, struct rx_packet *np,
+ int istack, osi_socket socket,
+ afs_uint32 host, u_short port, int *tnop,
+ struct rx_call **newcallp);
+static struct rx_packet
+ *rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np,
+ int istack);
+static struct rx_packet
+ *rxi_ReceiveResponsePacket(struct rx_connection *conn,
+ struct rx_packet *np, int istack);
+static struct rx_packet
+ *rxi_ReceiveChallengePacket(struct rx_connection *conn,
+ struct rx_packet *np, int istack);
+static void rxi_AttachServerProc(struct rx_call *call, osi_socket socket,
+ int *tnop, struct rx_call **newcallp);
+static void rxi_ClearTransmitQueue(struct rx_call *call, int force);
+static void rxi_ClearReceiveQueue(struct rx_call *call);
+static void rxi_ResetCall(struct rx_call *call, int newcall);
+static void rxi_ScheduleKeepAliveEvent(struct rx_call *call);
+static void rxi_ScheduleNatKeepAliveEvent(struct rx_connection *conn);
+static void rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs);
+static void rxi_KeepAliveOn(struct rx_call *call);
+static void rxi_GrowMTUOn(struct rx_call *call);
+static void rxi_ChallengeOn(struct rx_connection *conn);
#ifdef RX_ENABLE_LOCKS
+static int rxi_CheckCall(struct rx_call *call, int haveCTLock);
static void rxi_SetAcksInTransmitQueue(struct rx_call *call);
+#else
+static int rxi_CheckCall(struct rx_call *call);
#endif
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
* parameter must match the existing index for the connection. If a
* server connection is created, it will be created using the supplied
* index, if the index is valid for this service */
-struct rx_connection *
+static struct rx_connection *
rxi_FindConnection(osi_socket socket, afs_uint32 host,
u_short port, u_short serviceId, afs_uint32 cid,
afs_uint32 epoch, int type, u_int securityIndex)
* appropriate to the call (the call is in the right state, etc.). This
* routine can return a packet to the caller, for re-use */
-struct rx_packet *
+static struct rx_packet *
rxi_ReceiveDataPacket(struct rx_call *call,
struct rx_packet *np, int istack,
osi_socket socket, afs_uint32 host, u_short port,
/* The real smarts of the whole thing. */
-struct rx_packet *
+static struct rx_packet *
rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np,
int istack)
{
}
/* Received a response to a challenge packet */
-struct rx_packet *
+static struct rx_packet *
rxi_ReceiveResponsePacket(struct rx_connection *conn,
struct rx_packet *np, int istack)
{
* back to the server. The server is responsible for retrying the
* challenge if it fails to get a response. */
-struct rx_packet *
+static struct rx_packet *
rxi_ReceiveChallengePacket(struct rx_connection *conn,
struct rx_packet *np, int istack)
{
/* Find an available server process to service the current request in
* the given call structure. If one isn't available, queue up this
* call so it eventually gets one */
-void
+static void
rxi_AttachServerProc(struct rx_call *call,
osi_socket socket, int *tnop,
struct rx_call **newcallp)
#endif /* RX_ENABLE_LOCKS */
}
-void
+static void
rxi_SendDelayedAck(struct rxevent *event, void *arg1, void *unused1,
int unused2)
{
/* Clear out the transmit queue for the current call (all packets have
* been received by peer) */
-void
+static void
rxi_ClearTransmitQueue(struct rx_call *call, int force)
{
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
#endif
}
-void
+static void
rxi_ClearReceiveQueue(struct rx_call *call)
{
if (queue_IsNotEmpty(&call->rq)) {
}
/* Send an abort packet for the specified call */
-struct rx_packet *
+static struct rx_packet *
rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet,
int istack, int force)
{
* unprotected macros, and may only be reset by non-interrupting code.
*/
-void
+static void
rxi_ResetCall(struct rx_call *call, int newcall)
{
int flags;
*/
#ifdef RX_ENABLE_LOCKS
int
-rxi_CheckCall(struct rx_call *call, int haveCTLock)
+static rxi_CheckCall(struct rx_call *call, int haveCTLock)
#else /* RX_ENABLE_LOCKS */
int
-rxi_CheckCall(struct rx_call *call)
+static rxi_CheckCall(struct rx_call *call)
#endif /* RX_ENABLE_LOCKS */
{
struct rx_connection *conn = call->conn;
}
}
-void
+static void
rxi_ScheduleNatKeepAliveEvent(struct rx_connection *conn)
{
if (!conn->natKeepAliveEvent && conn->secondsUntilNatPing) {
MUTEX_EXIT(&conn->conn_data_lock);
}
-void
-rxi_NatKeepAliveOn(struct rx_connection *conn)
-{
- MUTEX_ENTER(&conn->conn_data_lock);
- /* if it's already attached */
- if (!(conn->flags & RX_CONN_ATTACHWAIT))
- rxi_ScheduleNatKeepAliveEvent(conn);
- else
- conn->flags |= RX_CONN_NAT_PING;
- MUTEX_EXIT(&conn->conn_data_lock);
-}
-
/* When a call is in progress, this routine is called occasionally to
* make sure that some traffic has arrived (or been sent to) the peer.
* If nothing has arrived in a reasonable amount of time, the call is
MUTEX_EXIT(&call->lock);
}
-void
+static void
rxi_ScheduleKeepAliveEvent(struct rx_call *call)
{
if (!call->keepAliveEvent) {
}
}
-void
+static void
rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs)
{
if (!call->growMTUEvent) {
}
/* N.B. rxi_KeepAliveOff: is defined earlier as a macro */
-void
+static void
rxi_KeepAliveOn(struct rx_call *call)
{
/* Pretend last packet received was received now--i.e. if another
rxi_KeepAliveOn(call);
}
-void
+static void
rxi_GrowMTUOn(struct rx_call *call)
{
struct rx_connection *conn = call->conn;
/* This routine is called to send connection abort messages
* that have been delayed to throttle looping clients. */
-void
+static void
rxi_SendDelayedConnAbort(struct rxevent *event, void *arg1, void *unused,
int unused2)
{
* seconds) to ask the client to authenticate itself. The routine
* issues a challenge to the client, which is obtained from the
* security object associated with the connection */
-void
+static void
rxi_ChallengeEvent(struct rxevent *event,
void *arg0, void *arg1, int tries)
{
* security object associated with the connection is asked to create
* the challenge at this time. N.B. rxi_ChallengeOff is a macro,
* defined earlier. */
-void
+static void
rxi_ChallengeOn(struct rx_connection *conn)
{
if (!conn->challengeEvent) {
/* Find all server connections that have not been active for a long time, and
* toss them */
-void
+static void
rxi_ReapConnections(struct rxevent *unused, void *unused1, void *unused2,
int unused3)
{
/* Globals that we don't want the world to know about */
extern rx_atomic_t rx_nWaiting;
extern rx_atomic_t rx_nWaited;
+
+/* Prototypes for internal functions */
+
+/* rx.c */
+extern void rxi_PacketsUnWait(void);
+extern void rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host,
+ afs_uint32 port, int mtu);
+extern struct rx_peer *rxi_FindPeer(afs_uint32 host, u_short port,
+ struct rx_peer *origPeer, int create);
+extern struct rx_packet *rxi_ReceivePacket(struct rx_packet *np,
+ osi_socket socket, afs_uint32 host,
+ u_short port, int *tnop,
+ struct rx_call **newcallp);
+extern int rxi_IsConnInteresting(struct rx_connection *aconn);
+extern void rxi_PostDelayedAckEvent(struct rx_call *call, struct clock *now);
+extern void rxi_ConnectionError(struct rx_connection *conn, afs_int32 error);
+extern void rxi_Start(struct rx_call *call, int istack);
+extern void rxi_Send(struct rx_call *call, struct rx_packet *p, int istack);
+extern struct rx_packet *rxi_SendAck(struct rx_call *call,
+ struct rx_packet *optionalPacket,
+ int serial, int reason, int istack);
+extern struct rx_packet *rxi_SendConnectionAbort(struct rx_connection *conn,
+ struct rx_packet *packet,
+ int istack, int force);
+
+/* rx_packet.h */
+
+extern int rxi_SendIovecs(struct rx_connection *conn, struct iovec *iov,
+ int iovcnt, size_t length, int istack);
+extern void rxi_SendRaw(struct rx_call *call, struct rx_connection *conn,
+ int type, char *data, int bytes, int istack);
extern afs_int32 rx_EndCall(struct rx_call *call, afs_int32 rc);
extern void rx_InterruptCall(struct rx_call *call, afs_int32 error);
extern void rx_Finalize(void);
-extern void rxi_PacketsUnWait(void);
extern void *rxi_Alloc(size_t size);
extern void rxi_Free(void *addr, size_t size);
-extern void rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host,
- afs_uint32 port, int mtu);
-extern struct rx_peer *rxi_FindPeer(afs_uint32 host,
- u_short port,
- struct rx_peer *origPeer, int create);
-extern struct rx_connection *rxi_FindConnection(osi_socket socket,
- afs_uint32 host,
- u_short port,
- u_short serviceId,
- afs_uint32 cid,
- afs_uint32 epoch, int type,
- u_int securityIndex);
-extern struct rx_packet *rxi_ReceivePacket(struct rx_packet *np,
- osi_socket socket, afs_uint32 host,
- u_short port, int *tnop,
- struct rx_call **newcallp);
-extern int rxi_IsConnInteresting(struct rx_connection *aconn);
-extern struct rx_packet *rxi_ReceiveDataPacket(struct rx_call *call,
- struct rx_packet *np,
- int istack, osi_socket socket,
- afs_uint32 host, u_short port,
- int *tnop,
- struct rx_call **newcallp);
-extern struct rx_packet *rxi_ReceiveAckPacket(struct rx_call *call,
- struct rx_packet *np,
- int istack);
-extern struct rx_packet *rxi_ReceiveResponsePacket(struct
- rx_connection *conn, struct rx_packet
- *np, int istack);
-extern struct rx_packet *rxi_ReceiveChallengePacket(struct
- rx_connection *conn, struct rx_packet
- *np, int istack);
-extern void rxi_AttachServerProc(struct rx_call *call,
- osi_socket socket,
- int *tnop,
- struct rx_call **newcallp);
-extern void rxi_AckAll(struct rxevent *event, struct rx_call *call,
- char *dummy);
-extern void rxi_PostDelayedAckEvent(struct rx_call *call, struct clock *now);
-extern void rxi_ClearTransmitQueue(struct rx_call *call,
- int force);
-extern void rxi_ClearReceiveQueue(struct rx_call *call);
-extern struct rx_packet *rxi_SendCallAbort(struct rx_call *call,
- struct rx_packet *packet,
- int istack, int force);
-extern struct rx_packet *rxi_SendConnectionAbort(struct rx_connection
- *conn,
- struct rx_packet *packet,
- int istack, int force);
-extern void rxi_ConnectionError(struct rx_connection *conn,
- afs_int32 error);
extern void rxi_CallError(struct rx_call *call, afs_int32 error);
-extern void rxi_ResetCall(struct rx_call *call,
- int newcall);
-extern struct rx_packet *rxi_SendAck(struct rx_call *call, struct rx_packet
- *optionalPacket, int serial, int reason,
- int istack);
-extern void rxi_Start(struct rx_call *call, int istack);
-extern void rxi_Send(struct rx_call *call,
- struct rx_packet *p, int istack);
-#ifdef RX_ENABLE_LOCKS
-extern int rxi_CheckCall(struct rx_call *call, int haveCTLock);
-#else /* RX_ENABLE_LOCKS */
-extern int rxi_CheckCall(struct rx_call *call);
-#endif /* RX_ENABLE_LOCKS */
-extern void rxi_ScheduleKeepAliveEvent(struct rx_call *call);
-extern void rxi_ScheduleNatKeepAliveEvent(struct rx_connection *conn);
-extern void rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs);
-extern void rxi_KeepAliveOn(struct rx_call *call);
-extern void rxi_NatKeepAliveOn(struct rx_connection *conn);
-extern void rxi_GrowMTUOn(struct rx_call *call);
-extern void rx_SetConnSecondsUntilNatPing(struct rx_connection *conn, afs_int32 seconds);
-extern void rxi_ChallengeEvent(struct rxevent *event,
- void *conn, /* struct rx_connection *conn */
- void *arg1, int atries);
-extern void rxi_ChallengeOn(struct rx_connection *conn);
+extern void rx_SetConnSecondsUntilNatPing(struct rx_connection *conn,
+ afs_int32 seconds);
extern void rx_KeepAliveOn(struct rx_call *call);
extern void rx_KeepAliveOff(struct rx_call *call);
extern int rxs_Release(struct rx_securityClass *aobj);
extern struct rx_securityClass *rxnull_NewServerSecurityObject(void);
extern struct rx_securityClass *rxnull_NewClientSecurityObject(void);
+
/* rx_packet.c */
extern afs_int32 rx_SlowGetInt32(struct rx_packet *packet, size_t offset);
extern afs_int32 rx_SlowPutInt32(struct rx_packet *packet, size_t offset,