7699ee21c406d4a6e935269718f9a5127d931715
[openafs.git] / src / des / stats.h
1 /* 
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 /* Some Cheap statistics which should be shared with the rxkad definitions, but
11  * aren't.  The layout should match the layout in rxkad/rxkad.p.h. */
12
13 struct rxkad_stats {
14     afs_uint32 connections[3];  /* client side only */
15     afs_uint32 destroyObject;   /* client security objects */
16     afs_uint32 destroyClient;   /* client connections */
17     afs_uint32 destroyUnused;   /* unused server conn */
18     afs_uint32 destroyUnauth;   /* unauthenticated server conn */
19     afs_uint32 destroyConn[3];  /* server conn per level */
20     afs_uint32 expired;         /* server packets rejected */
21     afs_uint32 challengesSent;  /* server challenges sent */
22     afs_uint32 challenges[3];   /* challenges seen by client */
23     afs_uint32 responses[3];    /* responses seen by server */
24     afs_uint32 preparePackets[6];
25     afs_uint32 checkPackets[6];
26     afs_uint32 bytesEncrypted[2];       /* index just by type */
27     afs_uint32 bytesDecrypted[2];
28     afs_uint32 fc_encrypts[2];  /* DECRYPT==0, ENCRYPT==1 */
29     afs_uint32 fc_key_scheds;   /* key schedule creations */
30     afs_uint32 des_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
31     afs_uint32 des_key_scheds;  /* key schedule creations */
32     afs_uint32 des_randoms;     /* random blocks generated */
33     long spares[10];
34 } rxkad_stats;                  /* put these here for convenience */
35
36 #ifdef AFS_PTHREAD_ENV
37 #include <pthread.h>
38 #include <assert.h>
39 extern pthread_mutex_t rxkad_stats_mutex;
40 #define LOCK_RXKAD_STATS assert(pthread_mutex_lock(&rxkad_stats_mutex)==0)
41 #define UNLOCK_RXKAD_STATS assert(pthread_mutex_unlock(&rxkad_stats_mutex)==0)
42 #else
43 #define LOCK_RXKAD_STATS
44 #define UNLOCK_RXKAD_STATS
45 #endif