2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
9 * Portions Copyright (c) 2003 Apple Computer, Inc.
13 * This file contains sample code for the rxstats interface
16 #include <afsconfig.h>
17 #include <afs/param.h>
26 #include <rx/rxstat.h>
28 #include <afs/afs_Admin.h>
29 #include <afs/afs_clientAdmin.h>
30 #include <afs/afs_utilAdmin.h>
35 fprintf(stderr
, "Usage: rxdebug_supported_stats <host> <port>\n");
40 ParseArgs(int argc
, char *argv
[], char **srvrName
, long *srvrPort
)
46 *srvrName
= *(argp
++);
49 *srvrPort
= strtol(*(argp
++), NULL
, 0);
50 if (*srvrPort
<= 0 || *srvrPort
>= 65536)
57 main(int argc
, char *argv
[])
61 rxdebugHandle_p handle
;
66 ParseArgs(argc
, argv
, &srvrName
, &srvrPort
);
68 rc
= afsclient_Init(&st
);
70 fprintf(stderr
, "afsclient_Init, status %d\n", st
);
74 rc
= afsclient_RXDebugOpenPort(srvrName
, srvrPort
, &handle
, &st
);
76 fprintf(stderr
, "afsclient_RXDebugOpenPort, status %d\n", st
);
80 rc
= util_RXDebugSupportedStats(handle
, &supported
, &st
);
82 fprintf(stderr
, "util_RXDebugSupportedStats, status %d\n", st
);
86 rc
= afsclient_RXDebugClose(handle
, &st
);
88 fprintf(stderr
, "afsclient_RXDebugClose, status %d\n", st
);
93 printf("security stats: %s supported\n",
94 (supported
& RX_SERVER_DEBUG_SEC_STATS
) ? "" : " not");
95 printf("all connections:%s supported\n",
96 (supported
& RX_SERVER_DEBUG_ALL_CONN
) ? "" : " not");
97 printf("rx stats: %s supported\n",
98 (supported
& RX_SERVER_DEBUG_RX_STATS
) ? "" : " not");
99 printf("waiter count: %s supported\n",
100 (supported
& RX_SERVER_DEBUG_WAITER_CNT
) ? "" : " not");
101 printf("idle threads: %s supported\n",
102 (supported
& RX_SERVER_DEBUG_IDLE_THREADS
) ? "" : " not");
103 printf("all peers: %s supported\n",
104 (supported
& RX_SERVER_DEBUG_ALL_PEER
) ? "" : " not");