#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#include <sys/types.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
#include <sys/stat.h>
+#include <afs/afsutil.h>
#include <afs/stds.h>
#include <afs/cmd.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);
}
int
-MainCommand(as, arock)
- char *arock;
- struct cmd_syndesc *as;
+MainCommand(struct cmd_syndesc *as, void *arock)
{
register int i;
osi_socket s;
int withIdleThreads;
int withWaited;
int withPeers;
+ int withPackets;
struct rx_debugStats tstats;
char *portName, *hostName;
char hoststr[20];
withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_IDLE_THREADS);
withWaited = (supportedDebugValues & RX_SERVER_DEBUG_WAITED_CNT);
withPeers = (supportedDebugValues & RX_SERVER_DEBUG_ALL_PEER);
+ withPackets = (supportedDebugValues & RX_SERVER_DEBUG_PACKETS_CNT);
- printf("Free packets: %d, packet reclaims: %d, calls: %d, used FDs: %d\n",
- tstats.nFreePackets, tstats.packetReclaims, tstats.callsExecuted,
- tstats.usedFDs);
+ if (withPackets)
+ printf("Free packets: %d/%d, packet reclaims: %d, calls: %d, used FDs: %d\n",
+ tstats.nFreePackets, tstats.nPackets, tstats.packetReclaims,
+ tstats.callsExecuted, tstats.usedFDs);
+ else
+ printf("Free packets: %d, packet reclaims: %d, calls: %d, used FDs: %d\n",
+ tstats.nFreePackets, tstats.packetReclaims, tstats.callsExecuted,
+ tstats.usedFDs);
if (!tstats.waitingForPackets)
printf("not ");
printf("waiting for packets.\n");
fprintf(stderr,
"WARNING: Server doesn't support retrieval of Rx statistics\n");
} else {
- struct rx_stats 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(" DESTROYED");
if (tconn.flags & RX_CONN_USING_PACKET_CKSUM)
printf(" pktCksum");
+ if (tconn.flags & RX_CONN_KNOW_WINDOW)
+ printf(" knowWindow");
+ if (tconn.flags & RX_CONN_RESET)
+ printf(" reset");
+ if (tconn.flags & RX_CONN_BUSY)
+ printf(" busy");
+ if (tconn.flags & RX_CONN_ATTACHWAIT)
+ printf(" attachWait");
printf(", ");
}
printf("security index %d, ", tconn.securityIndex);
#include "AFS_component_version_number.c"
#endif
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
struct cmd_syndesc *ts;
}
#endif
- ts = cmd_CreateSyntax(NULL, MainCommand, 0, "probe RX server");
+ ts = cmd_CreateSyntax(NULL, MainCommand, NULL, "probe RX server");
cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
cmd_AddParm(ts, "-nodally", CMD_FLAG, CMD_OPTIONAL,