Correct incorrect type-punning fixes
[openafs.git] / src / rxdebug / rxdebug.c
index 5c48a57..86f105b 100644 (file)
@@ -10,8 +10,6 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -34,31 +32,29 @@ RCSID
 #endif
 #include <string.h>
 #include <sys/stat.h>
+#include <afs/afsutil.h>
 #include <afs/stds.h>
 #include <afs/cmd.h>
 
 #include <stdio.h>
 
-#include "rx_user.h"
-#include "rx_clock.h"
-#include "rx_queue.h"
-#include "rx.h"
-#include "rx_globals.h"
+#include <rx/rx_user.h>
+#include <rx/rx_clock.h>
+#include <rx/rx_queue.h>
+#include <rx/rx.h>
+#include <rx/rx_globals.h>
 
 
 #define        TIMEOUT     20
 
-extern struct hostent *hostutil_GetHostByName();
-
 static short
-PortNumber(aport)
-     register char *aport;
+PortNumber(char *aport)
 {
     register int tc;
     register short total;
 
     total = 0;
-    while (tc = *aport++) {
+    while ((tc = *aport++)) {
        if (tc < '0' || tc > '9')
            return -1;          /* bad port number */
        total *= 10;
@@ -68,8 +64,7 @@ PortNumber(aport)
 }
 
 static short
-PortName(aname)
-     register char *aname;
+PortName(char *aname)
 {
     register struct servent *ts;
     ts = getservbyname(aname, NULL);
@@ -294,8 +289,9 @@ MainCommand(struct cmd_syndesc *as, void *arock)
                exit(1);
            }
            if (code != sizeof(rxstats)) {
-               if ((((struct rx_debugIn *)(&rxstats))->type ==
-                    RX_DEBUGI_BADTYPE))
+               struct rx_debugIn debug;
+               memcpy(&debug, &rxstats, sizeof(debug));
+               if (debug.type == RX_DEBUGI_BADTYPE)
                    goto noRxStats;
                printf
                    ("WARNING: returned Rx statistics of unexpected size (got %d)\n",
@@ -417,8 +413,6 @@ MainCommand(struct cmd_syndesc *as, void *arock)
                     printf(" busy");
                 if (tconn.flags & RX_CONN_ATTACHWAIT)
                     printf(" attachWait");
-                if (tconn.flags & RX_CLONED_CONNECTION)
-                    printf(" clone");
                printf(", ");
            }
            printf("security index %d, ", tconn.securityIndex);
@@ -502,6 +496,8 @@ MainCommand(struct cmd_syndesc *as, void *arock)
                    printf("dally, ");
                else if (tconn.callState[j] == RX_STATE_HOLD)
                    printf("hold, ");
+               else if (tconn.callState[j] == RX_STATE_RESET)
+                   printf("reset, ");
                printf("mode: ");
                if (tconn.callMode[j] == RX_MODE_SENDING)
                    printf("sending");
@@ -597,9 +593,7 @@ MainCommand(struct cmd_syndesc *as, void *arock)
 #include "AFS_component_version_number.c"
 #endif
 int
-main(argc, argv)
-     int argc;
-     char **argv;
+main(int argc, char **argv)
 {
     struct cmd_syndesc *ts;