#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;
}
static short
-PortName(aname)
- register char *aname;
+PortName(char *aname)
{
register struct servent *ts;
ts = getservbyname(aname, NULL);
fprintf(stderr,
"WARNING: Server doesn't support retrieval of Rx statistics\n");
} else {
- struct rx_statistics rxstats;
+ union {
+ struct rx_statistics rxstats;
+ struct rx_debugIn debug;
+ } packet;
/* should gracefully handle the case where rx_stats grows */
code =
- rx_GetServerStats(s, host, port, &rxstats,
+ rx_GetServerStats(s, host, port, &packet.rxstats,
&supportedStatValues);
if (code < 0) {
printf("rxstats call failed with code %d\n", code);
exit(1);
}
- if (code != sizeof(rxstats)) {
- if ((((struct rx_debugIn *)(&rxstats))->type ==
- RX_DEBUGI_BADTYPE))
+ if (code != sizeof(packet.rxstats)) {
+ if (packet.debug.type == RX_DEBUGI_BADTYPE)
goto noRxStats;
printf
("WARNING: returned Rx statistics of unexpected size (got %d)\n",
/* handle other versions?... */
}
- rx_PrintTheseStats(stdout, &rxstats, sizeof(rxstats),
+ rx_PrintTheseStats(stdout, &packet.rxstats, sizeof(packet.rxstats),
tstats.nFreePackets, tstats.version);
}
}
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");
#include "AFS_component_version_number.c"
#endif
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
struct cmd_syndesc *ts;