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>
33 pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
34 pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
35 pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
36 #endif /* AFS_DARWIN_ENV */
41 fprintf(stderr, "Usage: rxdebug_supported_stats <host> <port>\n");
46 ParseArgs(int argc, char *argv[], char **srvrName, long *srvrPort)
52 *srvrName = *(argp++);
55 *srvrPort = strtol(*(argp++), NULL, 0);
56 if (*srvrPort <= 0 || *srvrPort >= 65536)
63 main(int argc, char *argv[])
67 rxdebugHandle_p handle;
72 ParseArgs(argc, argv, &srvrName, &srvrPort);
74 rc = afsclient_Init(&st);
76 fprintf(stderr, "afsclient_Init, status %d\n", st);
80 rc = afsclient_RXDebugOpenPort(srvrName, srvrPort, &handle, &st);
82 fprintf(stderr, "afsclient_RXDebugOpenPort, status %d\n", st);
86 rc = util_RXDebugSupportedStats(handle, &supported, &st);
88 fprintf(stderr, "util_RXDebugSupportedStats, status %d\n", st);
92 rc = afsclient_RXDebugClose(handle, &st);
94 fprintf(stderr, "afsclient_RXDebugClose, status %d\n", st);
99 printf("security stats: %s supported\n",
100 (supported & RX_SERVER_DEBUG_SEC_STATS) ? "" : " not");
101 printf("all connections:%s supported\n",
102 (supported & RX_SERVER_DEBUG_ALL_CONN) ? "" : " not");
103 printf("rx stats: %s supported\n",
104 (supported & RX_SERVER_DEBUG_RX_STATS) ? "" : " not");
105 printf("waiter count: %s supported\n",
106 (supported & RX_SERVER_DEBUG_WAITER_CNT) ? "" : " not");
107 printf("idle threads: %s supported\n",
108 (supported & RX_SERVER_DEBUG_IDLE_THREADS) ? "" : " not");
109 printf("all peers: %s supported\n",
110 (supported & RX_SERVER_DEBUG_ALL_PEER) ? "" : " not");