rx: Remove unneeded rxi_ReceiveDataPacket params
[openafs.git] / src / rx / rx_packet.c
index 7c95515..a8ea7bc 100644 (file)
@@ -31,7 +31,7 @@
 #  endif
 #  include "h/socket.h"
 #  if !defined(AFS_SUN5_ENV) &&  !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV)
-#   if !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV)
+#   if !defined(AFS_AIX41_ENV)
 #    include "sys/mount.h"             /* it gets pulled in by something later anyway */
 #   endif
 #   include "h/mbuf.h"
@@ -871,7 +871,7 @@ rx_CheckPackets(void)
 static void
 rxi_FreePacketNoLock(struct rx_packet *p)
 {
-    dpf(("Free %"AFS_PTR_FMT"\n", p));
+    dpf(("Free %p\n", p));
 
     RX_FPQ_MARK_FREE(p);
     rx_nFreePackets++;
@@ -884,7 +884,7 @@ static void
 rxi_FreePacketTSFPQ(struct rx_packet *p, int flush_global)
 {
     struct rx_ts_info_t * rx_ts_info;
-    dpf(("Free %"AFS_PTR_FMT"\n", p));
+    dpf(("Free %p\n", p));
 
     RX_TS_INFO_GET(rx_ts_info);
     RX_TS_FPQ_CHECKIN(rx_ts_info,p);
@@ -1183,7 +1183,7 @@ rxi_AllocPacketNoLock(int class)
 
     RX_TS_FPQ_CHECKOUT(rx_ts_info,p);
 
-    dpf(("Alloc %"AFS_PTR_FMT", class %d\n", p, class));
+    dpf(("Alloc %p, class %d\n", p, class));
 
 
     /* have to do this here because rx_FlushWrite fiddles with the iovs in
@@ -1241,7 +1241,7 @@ rxi_AllocPacketNoLock(int class)
     opr_queue_Remove(&p->entry);
     RX_FPQ_MARK_USED(p);
 
-    dpf(("Alloc %"AFS_PTR_FMT", class %d\n", p, class));
+    dpf(("Alloc %p, class %d\n", p, class));
 
 
     /* have to do this here because rx_FlushWrite fiddles with the iovs in
@@ -1279,7 +1279,7 @@ rxi_AllocPacketTSFPQ(int class, int pull_global)
 
     RX_TS_FPQ_CHECKOUT(rx_ts_info,p);
 
-    dpf(("Alloc %"AFS_PTR_FMT", class %d\n", p, class));
+    dpf(("Alloc %p, class %d\n", p, class));
 
     /* have to do this here because rx_FlushWrite fiddles with the iovs in
      * order to truncate outbound packets.  In the near future, may need
@@ -1544,8 +1544,7 @@ rxi_ReadPacket(osi_socket socket, struct rx_packet *p, afs_uint32 * host,
  * last two pad bytes. */
 
 struct rx_packet *
-rxi_SplitJumboPacket(struct rx_packet *p, afs_uint32 host, short port,
-                    int first)
+rxi_SplitJumboPacket(struct rx_packet *p)
 {
     struct rx_packet *np;
     struct rx_jumboHeader *jp;
@@ -1598,6 +1597,7 @@ rxi_SplitJumboPacket(struct rx_packet *p, afs_uint32 host, short port,
     np->header = p->header;
     np->header.serial = p->header.serial + 1;
     np->header.seq = p->header.seq + 1;
+    np->header.userStatus = 0;
     np->header.flags = jp->flags;
     np->header.spare = jp->cksum;
 
@@ -1873,6 +1873,7 @@ rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
                for (tc = rx_connHashTable[i]; tc; tc = tc->next) {
                    if ((all || rxi_IsConnInteresting(tc))
                        && tin.index-- <= 0) {
+                       int do_secstats = 0;
                        tconn.host = tc->peer->host;
                        tconn.port = tc->peer->port;
                        tconn.cid = htonl(tc->cid);
@@ -1894,12 +1895,18 @@ rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
 
                        tconn.natMTU = htonl(tc->peer->natMTU);
                        tconn.error = htonl(tc->error);
-                       tconn.flags = tc->flags;
+                       tconn.flags = (u_char) (tc->flags & 0xff);  /* compat. */
                        tconn.type = tc->type;
                        tconn.securityIndex = tc->securityIndex;
                        if (tc->securityObject) {
-                           RXS_GetStats(tc->securityObject, tc,
-                                        &tconn.secStats);
+                           int code;
+                           code = RXS_GetStats(tc->securityObject, tc,
+                                               &tconn.secStats);
+                           if (code == 0) {
+                               do_secstats = 1;
+                           }
+                       }
+                       if (do_secstats) {
 #define DOHTONL(a) (tconn.secStats.a = htonl(tconn.secStats.a))
 #define DOHTONS(a) (tconn.secStats.a = htons(tconn.secStats.a))
                            DOHTONL(flags);
@@ -1918,6 +1925,8 @@ rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
                                 sizeof(tconn.secStats.sparel) /
                                 sizeof(afs_int32); i++)
                                DOHTONL(sparel[i]);
+                       } else {
+                           memset(&tconn.secStats, 0, sizeof(tconn.secStats));
                        }
 
                        MUTEX_EXIT(&rx_connHashTable_lock);
@@ -2148,7 +2157,7 @@ rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket,
        if (!waslocked)
            AFS_GLOCK();
        afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING,
-                  "before osi_NetSend()");
+                  "before rxi_NetSend()");
        AFS_GUNLOCK();
     }
 #else
@@ -2157,14 +2166,14 @@ rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket,
 #endif
 #endif
     /* debug packets are not reliably delivered, hence the cast below. */
-    (void)osi_NetSend(asocket, &taddr, apacket->wirevec, apacket->niovecs,
+    (void)rxi_NetSend(asocket, &taddr, apacket->wirevec, apacket->niovecs,
                      apacket->length + RX_HEADER_SIZE, istack);
 #ifdef KERNEL
 #ifdef RX_KERNEL_TRACE
     if (ICL_SETACTIVE(afs_iclSetp)) {
        AFS_GLOCK();
        afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING,
-                  "after osi_NetSend()");
+                  "after rxi_NetSend()");
        if (!waslocked)
            AFS_GUNLOCK();
     }
@@ -2301,7 +2310,7 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn,
            if (!waslocked)
                AFS_GLOCK();
            afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING,
-                      "before osi_NetSend()");
+                      "before rxi_NetSend()");
            AFS_GUNLOCK();
        }
 #else
@@ -2310,7 +2319,7 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn,
 #endif
 #endif
        if ((code =
-            osi_NetSend(socket, &addr, p->wirevec, p->niovecs,
+            rxi_NetSend(socket, &addr, p->wirevec, p->niovecs,
                         p->length + RX_HEADER_SIZE, istack)) != 0) {
            /* send failed, so let's hurry up the resend, eh? */
             if (rx_stats_active)
@@ -2331,7 +2340,7 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn,
        if (ICL_SETACTIVE(afs_iclSetp)) {
            AFS_GLOCK();
            afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING,
-                      "after osi_NetSend()");
+                      "after rxi_NetSend()");
            if (!waslocked)
                AFS_GUNLOCK();
        }
@@ -2342,7 +2351,7 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn,
 #endif
 #ifdef RXDEBUG
     }
-    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %"AFS_PTR_FMT" len %d\n",
+    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %p len %d\n",
           deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], ntohl(peer->host),
           ntohs(peer->port), p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber,
           p->header.seq, p->header.flags, p, p->length));
@@ -2508,7 +2517,7 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn,
            AFS_GUNLOCK();
 #endif
        if ((code =
-            osi_NetSend(socket, &addr, &wirevec[0], len + 1, length,
+            rxi_NetSend(socket, &addr, &wirevec[0], len + 1, length,
                         istack)) != 0) {
            /* send failed, so let's hurry up the resend, eh? */
             if (rx_stats_active)
@@ -2535,7 +2544,7 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn,
 
     osi_Assert(p != NULL);
 
-    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %"AFS_PTR_FMT" len %d\n",
+    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %p len %d\n",
           deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], ntohl(peer->host),
           ntohs(peer->port), p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber,
           p->header.seq, p->header.flags, p, p->length));
@@ -2591,7 +2600,7 @@ rxi_SendRawAbort(osi_socket socket, afs_uint32 host, u_short port,
     addr.sin_len = sizeof(struct sockaddr_in);
 #endif
 
-    osi_NetSend(socket, &addr, iov, 2,
+    rxi_NetSend(socket, &addr, iov, 2,
                sizeof(struct rx_header) + sizeof(error), istack);
 }
 
@@ -2645,6 +2654,7 @@ rxi_SendSpecial(struct rx_call *call,
     p->header.seq = 0;
     p->header.epoch = conn->epoch;
     p->header.type = type;
+    p->header.userStatus = 0;
     p->header.flags = 0;
     if (conn->type == RX_CLIENT_CONNECTION)
        p->header.flags |= RX_CLIENT_INITIATED;
@@ -2767,6 +2777,7 @@ rxi_PrepareSendPacket(struct rx_call *call,
     p->header.seq = seq;
     p->header.epoch = conn->epoch;
     p->header.type = RX_PACKET_TYPE_DATA;
+    p->header.userStatus = 0;
     p->header.flags = 0;
     p->header.spare = 0;
     if (conn->type == RX_CLIENT_CONNECTION)