pull-prototypes-to-head-20020821
[openafs.git] / src / rx / rx_packet.c
index 12e2644..294316e 100644 (file)
@@ -76,7 +76,6 @@ RCSID("$Header$");
 #include "rx_packet.h"
 #include "rx_globals.h"
 #include <lwp.h>
-#include "rx_internal.h"
 #ifdef HAVE_STRING_H
 #include <string.h>
 #else
@@ -156,7 +155,7 @@ afs_int32 rx_SlowPutInt32(struct rx_packet *packet, size_t offset, afs_int32 dat
  *         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++ ) {
@@ -189,7 +188,7 @@ afs_int32 rx_SlowReadPacket(struct rx_packet *packet, unsigned int offset,
  *        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;
@@ -222,7 +221,7 @@ afs_int32 rx_SlowWritePacket(struct rx_packet *packet, int offset, int resid,
   return (resid ? (r - resid) : r);
 }
 
-static struct rx_packet * allocCBuf(int class)
+static struct rx_packet *allocCBuf(int class)
 {
   struct rx_packet *c;
   SPLVAR;
@@ -308,9 +307,7 @@ void rxi_freeCBuf(struct rx_packet *c)
  * 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;
@@ -433,7 +430,7 @@ void rxi_FreeAllPackets(void)
 /* 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); 
@@ -465,9 +462,7 @@ void rxi_FreePacketNoLock(struct rx_packet *p)
   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;
   
@@ -515,9 +510,7 @@ void rxi_RestoreDataBufs(struct rx_packet *p)
     }
 }
 
-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;
@@ -580,8 +573,7 @@ void rxi_FreePacket(struct rx_packet *p)
  * 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;
   
@@ -647,8 +639,7 @@ struct rx_packet *rxi_AllocPacketNoLock(class)
   return p;
 }
 
-struct rx_packet *rxi_AllocPacket(class)
-     int class;
+struct rx_packet *rxi_AllocPacket(int class)
 {
     register struct rx_packet *p;
 
@@ -663,9 +654,7 @@ struct rx_packet *rxi_AllocPacket(class)
  * 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;
@@ -729,8 +718,8 @@ int want;
 #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;
@@ -756,11 +745,7 @@ register int amax; {
  * (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;
@@ -869,11 +854,8 @@ int rxi_ReadPacket(socket, p, host, port)
  * 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;
@@ -934,13 +916,8 @@ struct rx_packet *rxi_SplitJumboPacket(p, host, port, first)
 
 #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, char *addr, struct iovec *dvec, int nvecs, 
+       int length, int istack)
 {
     struct msghdr msg;
 
@@ -967,10 +944,7 @@ int osi_NetSend(socket, addr, dvec, nvecs, length, istack)
  * 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;
 
@@ -991,10 +965,7 @@ static int cpytoc(mp, off, len, cp)
  * 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;
 
@@ -1024,10 +995,7 @@ static int cpytoiovec(mp, off, len, iovs, niovs)
 #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;
@@ -1103,12 +1071,8 @@ int hdr_len, data_len;
 
 /* 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;
@@ -1390,12 +1354,8 @@ struct rx_packet *rxi_ReceiveDebugPacket(ap, asocket, ahost, aport, istack)
     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;
 
@@ -1582,10 +1542,8 @@ void rxi_SendPacket(struct rx_connection * conn, struct rx_packet *p,
 /* 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;
@@ -1756,14 +1714,9 @@ void rxi_SendPacketList(struct rx_connection * conn,
  * 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) */
@@ -1831,8 +1784,7 @@ rxi_SendSpecial(call, conn, optionalPacket, type, data, nbytes, istack)
 /* 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 */
 
@@ -1850,8 +1802,7 @@ register struct rx_packet *p;
 }
 
 /* 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;
@@ -1884,10 +1835,8 @@ register struct rx_packet *p;
     /* 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;