#include <afsconfig.h>
#ifdef KERNEL
-#include "../afs/param.h"
+#include "afs/param.h"
#else
#include <afs/param.h>
#endif
#ifdef KERNEL
#if defined(UKERNEL)
-#include "../afs/sysincludes.h"
-#include "../afs/afsincludes.h"
-#include "../rx/rx_kcommon.h"
-#include "../rx/rx_clock.h"
-#include "../rx/rx_queue.h"
-#include "../rx/rx_packet.h"
+#include "afs/sysincludes.h"
+#include "afsincludes.h"
+#include "rx/rx_kcommon.h"
+#include "rx/rx_clock.h"
+#include "rx/rx_queue.h"
+#include "rx/rx_packet.h"
#else /* defined(UKERNEL) */
-#include "../h/types.h"
+#include "h/types.h"
#ifndef AFS_LINUX20_ENV
-#include "../h/systm.h"
+#include "h/systm.h"
#endif
#if defined(AFS_SGI_ENV) || defined(AFS_HPUX110_ENV)
-#include "../afs/sysincludes.h"
+#include "afs/sysincludes.h"
#endif
-#include "../h/socket.h"
-#include "../netinet/in.h"
-#include "../afs/afs_osi.h"
-#include "../rx/rx_kmutex.h"
-#include "../rx/rx_clock.h"
-#include "../rx/rx_queue.h"
-#ifdef AFS_SUN5_ENV
-#include <sys/sysmacros.h>
+#if defined(AFS_OBSD_ENV)
+#include "h/proc.h"
#endif
-#include "../rx/rx_packet.h"
+#include "h/socket.h"
#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV)
#if !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV)
-#include "../sys/mount.h" /* it gets pulled in by something later anyway */
+#include "sys/mount.h" /* it gets pulled in by something later anyway */
+#endif
+#include "h/mbuf.h"
#endif
-#include "../h/mbuf.h"
+#include "netinet/in.h"
+#include "afs/afs_osi.h"
+#include "rx_kmutex.h"
+#include "rx/rx_clock.h"
+#include "rx/rx_queue.h"
+#ifdef AFS_SUN5_ENV
+#include <sys/sysmacros.h>
#endif
+#include "rx/rx_packet.h"
#endif /* defined(UKERNEL) */
-#include "../rx/rx_globals.h"
+#include "rx/rx_globals.h"
#else /* KERNEL */
#include "sys/types.h"
#include <sys/stat.h>
#include "rx_packet.h"
#include "rx_globals.h"
#include <lwp.h>
-#include "rx_internal.h"
#ifdef HAVE_STRING_H
#include <string.h>
#else
* all buffers are contiguously arrayed in the iovec from 0..niovecs-1
*/
afs_int32 rx_SlowReadPacket(struct rx_packet *packet, unsigned int offset,
- int resid, char *out)
+ int resid, char *out)
{
unsigned int i, j, l, r;
for (l=0, i=1; i< packet->niovecs ; i++ ) {
* offset is an integral multiple of the word size.
*/
afs_int32 rx_SlowWritePacket(struct rx_packet *packet, int offset, int resid,
- char *in)
+ char *in)
{
int i, j, l, r;
char * b;
return (resid ? (r - resid) : r);
}
-static struct rx_packet * allocCBuf(int class)
+static struct rx_packet *allocCBuf(int class)
{
struct rx_packet *c;
SPLVAR;
* This isn't terribly general, because it knows that the packets are only
* rounded up to the EBS (userdata + security header).
*/
-int rxi_RoundUpPacket(p, nb)
- struct rx_packet * p;
- unsigned int nb;
+int rxi_RoundUpPacket(struct rx_packet *p, unsigned int nb)
{
int i;
i = p->niovecs - 1;
/* Allocate more packets iff we need more continuation buffers */
/* In kernel, can't page in memory with interrupts disabled, so we
* don't use the event mechanism. */
-void rx_CheckPackets()
+void rx_CheckPackets(void)
{
if (rxi_NeedMorePackets) {
rxi_MorePackets(rx_initSendWindow);
queue_Append(&rx_freePacketQueue, p);
}
-int rxi_FreeDataBufsNoLock(p, first)
- struct rx_packet * p;
- int first;
+int rxi_FreeDataBufsNoLock(struct rx_packet *p, int first)
{
struct iovec *iov, *end;
}
}
-int rxi_TrimDataBufs(p, first)
- struct rx_packet * p;
- int first;
+int rxi_TrimDataBufs(struct rx_packet *p, int first)
{
int length;
struct iovec *iov, *end;
* bytes in the packet at this point, **not including** the header.
* The header is absolutely necessary, besides, this is the way the
* length field is usually used */
-struct rx_packet *rxi_AllocPacketNoLock(class)
- int class;
+struct rx_packet *rxi_AllocPacketNoLock(int class)
{
register struct rx_packet *p;
return p;
}
-struct rx_packet *rxi_AllocPacket(class)
- int class;
+struct rx_packet *rxi_AllocPacket(int class)
{
register struct rx_packet *p;
* returning. caution: this is often called at NETPRI
* Called with call locked.
*/
-struct rx_packet *rxi_AllocSendPacket(call, want)
-register struct rx_call *call;
-int want;
+struct rx_packet *rxi_AllocSendPacket(register struct rx_call *call, int want)
{
register struct rx_packet *p = (struct rx_packet *) 0;
register int mud;
#ifndef KERNEL
/* count the number of used FDs */
-static int CountFDs(amax)
-register int amax; {
+static int CountFDs(register int amax)
+{
struct stat tstat;
register int i, code;
register int count;
* (host,port) of the sender are stored in the supplied variables, and
* the data length of the packet is stored in the packet structure.
* The header is decoded. */
-int rxi_ReadPacket(socket, p, host, port)
- int socket;
- register struct rx_packet *p;
- afs_uint32 *host;
- u_short *port;
+int rxi_ReadPacket(int socket, register struct rx_packet *p, afs_uint32 *host, u_short *port)
{
struct sockaddr_in from;
int nbytes;
* HACK: We store the length of the first n-1 packets in the
* last two pad bytes. */
-struct rx_packet *rxi_SplitJumboPacket(p, host, port, first)
- register struct rx_packet *p;
- afs_int32 host;
- short port;
- int first;
+struct rx_packet *rxi_SplitJumboPacket(register struct rx_packet *p, afs_int32 host,
+ short port, int first)
{
struct rx_packet *np;
struct rx_jumboHeader *jp;
#ifndef KERNEL
/* Send a udp datagram */
-int osi_NetSend(socket, addr, dvec, nvecs, length, istack)
- osi_socket socket;
- char * addr;
- struct iovec *dvec;
- int nvecs;
- int length;
- int istack;
+int osi_NetSend(osi_socket socket, void *addr, struct iovec *dvec, int nvecs,
+ int length, int istack)
{
struct msghdr msg;
return 0;
}
#elif !defined(UKERNEL)
-/* osi_NetSend is defined in afs/afs_osinet.c
+/*
* message receipt is done in rxk_input or rx_put.
*/
* Returns the number of bytes not transferred.
* The message is NOT changed.
*/
-static int cpytoc(mp, off, len, cp)
- mblk_t *mp;
- register int off, len;
- register char * cp;
+static int cpytoc(mblk_t *mp, register int off, register int len, register char *cp)
{
register int n;
* but it doesn't really.
* This sucks, anyway, do it like m_cpy.... below
*/
-static int cpytoiovec(mp, off, len, iovs, niovs)
- mblk_t *mp;
- int off, len, niovs;
- register struct iovec *iovs;
+static int cpytoiovec(mblk_t *mp, int off, int len, register struct iovec *iovs, int niovs)
{
register int m,n,o,t,i;
#define m_cpytoiovec(a, b, c, d, e) cpytoiovec(a, b, c, d, e)
#else
#if !defined(AFS_LINUX20_ENV)
-static int m_cpytoiovec(m, off, len, iovs, niovs)
- struct mbuf *m;
- int off, len, niovs;
- struct iovec iovs[];
+static int m_cpytoiovec(struct mbuf *m, int off, int len, struct iovec iovs[], int niovs)
{
caddr_t p1, p2;
unsigned int l1, l2, i, t;
/* send a response to a debug packet */
-struct rx_packet *rxi_ReceiveDebugPacket(ap, asocket, ahost, aport, istack)
- osi_socket asocket;
- afs_int32 ahost;
- short aport;
- register struct rx_packet *ap;
- int istack;
+struct rx_packet *rxi_ReceiveDebugPacket(register struct rx_packet *ap,
+ osi_socket asocket, afs_int32 ahost, short aport, int istack)
{
struct rx_debugIn tin;
afs_int32 tl;
return ap;
}
-struct rx_packet *rxi_ReceiveVersionPacket(ap, asocket, ahost, aport, istack)
- osi_socket asocket;
- afs_int32 ahost;
- short aport;
- register struct rx_packet *ap;
- int istack;
+struct rx_packet *rxi_ReceiveVersionPacket(register struct rx_packet *ap,
+ osi_socket asocket, afs_int32 ahost, short aport, int istack)
{
afs_int32 tl;
taddr.sin_family = AF_INET;
taddr.sin_port = aport;
taddr.sin_addr.s_addr = ahost;
-
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+ taddr.sin_len = sizeof(struct sockaddr_in);
+#endif
/* We need to trim the niovecs. */
nbytes = apacket->length;
/* Send a list of packets to appropriate destination for the specified
* connection. The headers are first encoded and placed in the packets.
*/
-void rxi_SendPacketList(struct rx_connection * conn,
- struct rx_packet **list,
- int len,
- int istack)
+void rxi_SendPacketList(struct rx_connection * conn, struct rx_packet **list,
+ int len, int istack)
{
#if defined(AFS_SUN5_ENV) && defined(KERNEL)
int waslocked;
* copied into the packet. Type is the type of the packet, as defined
* in rx.h. Bug: there's a lot of duplication between this and other
* routines. This needs to be cleaned up. */
-struct rx_packet *
-rxi_SendSpecial(call, conn, optionalPacket, type, data, nbytes, istack)
- register struct rx_call *call;
- register struct rx_connection *conn;
- struct rx_packet *optionalPacket;
- int type;
- char *data;
- int nbytes, istack;
+struct rx_packet *rxi_SendSpecial(register struct rx_call *call,
+ register struct rx_connection *conn, struct rx_packet *optionalPacket,
+ int type, char *data, int nbytes, int istack)
{
/* Some of the following stuff should be common code for all
* packet sends (it's repeated elsewhere) */
/* Encode the packet's header (from the struct header in the packet to
* the net byte order representation in the wire representation of the
* packet, which is what is actually sent out on the wire) */
-void rxi_EncodePacketHeader(p)
-register struct rx_packet *p;
+void rxi_EncodePacketHeader(register struct rx_packet *p)
{
register afs_uint32 *buf = (afs_uint32 *)(p->wirevec[0].iov_base); /* MTUXXX */
}
/* Decode the packet's header (from net byte order to a struct header) */
-void rxi_DecodePacketHeader(p)
-register struct rx_packet *p;
+void rxi_DecodePacketHeader(register struct rx_packet *p)
{
register afs_uint32 *buf = (afs_uint32*)(p->wirevec[0].iov_base); /* MTUXXX */
afs_uint32 temp;
/* Note: top 16 bits of this last word are the security checksum */
}
-void rxi_PrepareSendPacket(call, p, last)
- register struct rx_call *call;
- register struct rx_packet *p;
- register int last;
+void rxi_PrepareSendPacket(register struct rx_call *call, register struct rx_packet *p,
+ register int last)
{
register struct rx_connection *conn = call->conn;
int i, j;