all: \
${TOP_LIBDIR}/libdes.a \
${TOP_INCDIR}/des.h \
- ${TOP_INCDIR}/des/stats.h \
${TOP_INCDIR}/des_prototypes.h \
${TOP_INCDIR}/des_conf.h \
${TOP_INCDIR}/mit-cpyright.h \
make_odd \
${TOP_INCDIR}/des.h \
${TOP_INCDIR}/mit-cpyright.h \
- ${TOP_INCDIR}/des/stats.h
generated: \
p.c \
${TOP_INCDIR}/des.h: des.h
${INSTALL_DATA} $? $@
-${TOP_INCDIR}/des/stats.h: stats.h
- ${INSTALL_DATA} $? $@
-
${TOP_INCDIR}/des_prototypes.h: des_prototypes.h
${INSTALL_DATA} $? $@
$(INCFILEDIR)\mit-cpyright.h \
$(INCFILEDIR)\des_odd.h \
$(INCFILEDIR)\crypt.h \
- $(INCFILEDIR)\des\stats.h
$(INCFILEDIR)\des_odd.h: odd.h
$(COPY) odd.h $@
-$(INCFILEDIR)\des\stats.h: stats.h
- $(COPY) stats.h $@
-
# Library component lists.
LIBOBJS = \
+++ /dev/null
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/* Some Cheap statistics which should be shared with the rxkad definitions, but
- * aren't. The layout should match the layout in rxkad/rxkad.p.h. */
-
-#ifndef OPENAFS_DES_STATS_H
-#define OPENAFS_DES_STATS_H
-
-
-/* this is an optimization for pthreads environments. Instead of having global
- rxkad statistics, make them thread-specific, and only perform aggregation on
- the stats structures when necessary. Furthermore, don't do any locking, and
- live with the nearly accurate aggregation (e.g. you might miss a few increments,
- but the resulting aggregation should be almost correct). */
-
-#ifdef AFS_PTHREAD_ENV
-typedef struct rxkad_stats_t {
-#else
-struct rxkad_stats {
-#endif
- afs_uint32 connections[3]; /* client side only */
- afs_uint32 destroyObject; /* client security objects */
- afs_uint32 destroyClient; /* client connections */
- afs_uint32 destroyUnused; /* unused server conn */
- afs_uint32 destroyUnauth; /* unauthenticated server conn */
- afs_uint32 destroyConn[3]; /* server conn per level */
- afs_uint32 expired; /* server packets rejected */
- afs_uint32 challengesSent; /* server challenges sent */
- afs_uint32 challenges[3]; /* challenges seen by client */
- afs_uint32 responses[3]; /* responses seen by server */
- afs_uint32 preparePackets[6];
- afs_uint32 checkPackets[6];
- afs_uint32 bytesEncrypted[2]; /* index just by type */
- afs_uint32 bytesDecrypted[2];
- afs_uint32 fc_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
- afs_uint32 fc_key_scheds; /* key schedule creations */
- afs_uint32 des_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
- afs_uint32 des_key_scheds; /* key schedule creations */
- afs_uint32 des_randoms; /* random blocks generated */
- afs_uint32 clientObjects;
- afs_uint32 serverObjects;
- long spares[8];
-#ifdef AFS_PTHREAD_ENV
- struct rxkad_stats_t * next;
- struct rxkad_stats_t * prev;
-} rxkad_stats_t; /* put these here for convenience */
-#else /* AFS_PTHREAD_ENV */
-};
-#ifdef AFS_NT40_ENV
-struct rxkad_stats rxkad_stats; /* put this here for convenience */
-#endif
-#endif /* AFS_PTHREAD_ENV */
-
-
-#ifdef AFS_PTHREAD_ENV
-struct rxkad_global_stats {
- rxkad_stats_t * first;
- rxkad_stats_t * last;
-};
-
-#include <pthread.h>
-#include <assert.h>
-extern pthread_mutex_t rxkad_global_stats_lock;
-extern pthread_key_t rxkad_stats_key;
-
-extern void rxkad_global_stats_init(void);
-extern rxkad_stats_t * rxkad_thr_stats_init(void);
-extern int rxkad_stats_agg(rxkad_stats_t *);
-
-#ifndef BEGIN
-#define BEGIN do {
-#define END } while(0)
-#endif
-#define RXKAD_GLOBAL_STATS_LOCK assert(pthread_mutex_lock(&rxkad_global_stats_lock)==0)
-#define RXKAD_GLOBAL_STATS_UNLOCK assert(pthread_mutex_unlock(&rxkad_global_stats_lock)==0)
-#define GET_RXKAD_STATS(stats) rxkad_stats_agg(stats)
-#define GET_RXKAD_THR_STATS(rxkad_stats) \
- BEGIN \
- (rxkad_stats) = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
- if ((rxkad_stats) == NULL) { \
- assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
- } \
- END
-#define INC_RXKAD_STATS(stats_elem) \
- BEGIN \
- rxkad_stats_t * rxkad_stats; \
- rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
- if (rxkad_stats == NULL) { \
- assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
- } \
- rxkad_stats->stats_elem++; \
- END
-#define DEC_RXKAD_STATS(stats_elem) \
- BEGIN \
- rxkad_stats_t * rxkad_stats; \
- rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
- if (rxkad_stats == NULL) { \
- assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
- } \
- rxkad_stats->stats_elem--; \
- END
-#ifndef AFS_OBSD38_ENV
-#define ADD_RXKAD_STATS(stats_elem, inc_value) \
- BEGIN \
- rxkad_stats_t * rxkad_stats; \
- rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
- if (rxkad_stats == NULL) { \
- assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
- } \
- rxkad_stats->stats_elem += inc_value; \
- END
-#define SUB_RXKAD_STATS(stats_elem, dec_value) \
- BEGIN \
- rxkad_stats_t * rxkad_stats; \
- rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
- if (rxkad_stats == NULL) { \
- assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
- } \
- rxkad_stats->stats_elem -= dec_value; \
- END
-#else /* AFS_OBSD38_ENV */
-/* segfaults but we don't know why */
-#define ADD_RXKAD_STATS(stats_elem, inc_value)
-#define SUB_RXKAD_STATS(stats_elem, dec_value)
-#endif /* AFS_OBSD38_ENV */
-#else /* AFS_PTHREAD_ENV */
-#define INC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem++
-#define DEC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem--
-#define ADD_RXKAD_STATS(stats_elem, inc_value) rxkad_stats.stats_elem += (inc_value)
-#define SUB_RXKAD_STATS(stats_elem, dec_value) rxkad_stats.stats_elem -= (dec_value)
-#define GET_RXKAD_STATS(stats) memcpy((stats), &rxkad_stats, sizeof(rxkad_stats))
-#endif /* AFS_PTHREAD_ENV */
-
-
-#if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
-#ifndef RXKAD_STATS_DECLSPEC
-#define RXKAD_STATS_DECLSPEC __declspec(dllimport) extern
-#endif
-#else
-#define RXKAD_STATS_DECLSPEC extern
-#endif
-
-#ifdef AFS_PTHREAD_ENV
-RXKAD_STATS_DECLSPEC struct rxkad_global_stats rxkad_global_stats;
-#else /* AFS_PTHREAD_ENV */
-RXKAD_STATS_DECLSPEC struct rxkad_stats rxkad_stats;
-#endif
-
-
-#endif /* OPENAFS_DES_STATS_H */
depinstall: \
${TOP_INCDIR}/rx/rxkad.h \
${TOP_INCDIR}/rx/rxkad_prototypes.h \
- ${TOP_INCDIR}/rx/fcrypt.h
+ ${TOP_INCDIR}/rx/fcrypt.h \
+ ${TOP_INCDIR}/rx/rxkad_stats.h
${TOP_LIBDIR}/librxkad.a: librxkad.a
${INSTALL_DATA} $? $@
${TOP_INCDIR}/rx/rxkad_prototypes.h: rxkad_prototypes.h
${INSTALL_DATA} $? $@
+${TOP_INCDIR}/rx/rxkad_stats.h: stats.h
+ ${INSTALL_DATA} $? $@
+
#
# Build targets
#
$(INCFILES):$$(@F)
$(COPY) $** $(INCFILEDIR)\.
$(COPY) fcrypt.h $(INCFILEDIR)\.
+ $(COPY) stats.h $(INCFILEDIR)\rxkad_stats.h
rxkad.h rxkad_errs.c : rxkad_errs.et rxkad.p.h
$(DEL) rxkad_errs.c
#include "rxkad.h"
#include "fcrypt.h"
#include "private_data.h"
-#include <des/stats.h>
+#include "stats.h"
/*
* Unrolling of the inner loops helps the most on pentium chips
#endif
#endif /* KERNEL */
-#include <des/stats.h>
+#include <rx/rxkad_stats.h>
#include "private_data.h"
#define XPRT_RXKAD_CRYPT
#include "sboxes.h"
#include "fcrypt.h"
#include <rxkad.h>
-#include <des/stats.h>
+#include <rx/rxkad_stats.h>
#ifdef TCRYPT
int ROUNDS = 16;
#endif /* AFS_PTHREAD_ENV */
#endif /* KERNEL */
-#include <des/stats.h>
+#include "stats.h"
#include "private_data.h"
#define XPRT_RXKAD_CLIENT
#include <afs/afsutil.h>
#endif /* KERNEL */
-#include <des/stats.h>
+#include "stats.h"
#include "private_data.h"
#define XPRT_RXKAD_COMMON
pthread_mutex_t rxkad_global_stats_lock;
pthread_key_t rxkad_stats_key;
#else /* AFS_PTHREAD_ENV */
-#if defined(KERNEL) && !defined(UKERNEL)
struct rxkad_stats rxkad_stats = { { 0 } };
-#else
-/* Move delaration of this to des/key_sched.c */
-#endif
#endif /* AFS_PTHREAD_ENV */
#ifdef AFS_PTHREAD_ENV
#include <rx/xdr.h>
#include <des.h>
#include <afs/afsutil.h>
-#include <des/stats.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+#include "stats.h"
#include "private_data.h"
#define XPRT_RXKAD_SERVER
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* Some Cheap statistics which should be shared with the rxkad definitions, but
+ * aren't. The layout should match the layout in rxkad/rxkad.p.h. */
+
+#ifndef AFS_SRC_RXKAD_STATS_H
+#define AFS_SRC_RXKAD_STATS_H
+
+
+/* this is an optimization for pthreads environments. Instead of having global
+ rxkad statistics, make them thread-specific, and only perform aggregation on
+ the stats structures when necessary. Furthermore, don't do any locking, and
+ live with the nearly accurate aggregation (e.g. you might miss a few increments,
+ but the resulting aggregation should be almost correct). */
+
+#ifdef AFS_PTHREAD_ENV
+typedef struct rxkad_stats_t {
+#else
+struct rxkad_stats {
+#endif
+ afs_uint32 connections[3]; /* client side only */
+ afs_uint32 destroyObject; /* client security objects */
+ afs_uint32 destroyClient; /* client connections */
+ afs_uint32 destroyUnused; /* unused server conn */
+ afs_uint32 destroyUnauth; /* unauthenticated server conn */
+ afs_uint32 destroyConn[3]; /* server conn per level */
+ afs_uint32 expired; /* server packets rejected */
+ afs_uint32 challengesSent; /* server challenges sent */
+ afs_uint32 challenges[3]; /* challenges seen by client */
+ afs_uint32 responses[3]; /* responses seen by server */
+ afs_uint32 preparePackets[6];
+ afs_uint32 checkPackets[6];
+ afs_uint32 bytesEncrypted[2]; /* index just by type */
+ afs_uint32 bytesDecrypted[2];
+ afs_uint32 fc_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
+ afs_uint32 fc_key_scheds; /* key schedule creations */
+ afs_uint32 des_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
+ afs_uint32 des_key_scheds; /* key schedule creations */
+ afs_uint32 des_randoms; /* random blocks generated */
+ afs_uint32 clientObjects;
+ afs_uint32 serverObjects;
+ long spares[8];
+#ifdef AFS_PTHREAD_ENV
+ struct rxkad_stats_t * next;
+ struct rxkad_stats_t * prev;
+} rxkad_stats_t; /* put these here for convenience */
+#else /* AFS_PTHREAD_ENV */
+};
+#ifdef AFS_NT40_ENV
+struct rxkad_stats rxkad_stats; /* put this here for convenience */
+#endif
+#endif /* AFS_PTHREAD_ENV */
+
+
+#ifdef AFS_PTHREAD_ENV
+struct rxkad_global_stats {
+ rxkad_stats_t * first;
+ rxkad_stats_t * last;
+};
+
+#include <pthread.h>
+#include <assert.h>
+extern pthread_mutex_t rxkad_global_stats_lock;
+extern pthread_key_t rxkad_stats_key;
+
+extern void rxkad_global_stats_init(void);
+extern rxkad_stats_t * rxkad_thr_stats_init(void);
+extern int rxkad_stats_agg(rxkad_stats_t *);
+
+#ifndef BEGIN
+#define BEGIN do {
+#define END } while(0)
+#endif
+#define RXKAD_GLOBAL_STATS_LOCK assert(pthread_mutex_lock(&rxkad_global_stats_lock)==0)
+#define RXKAD_GLOBAL_STATS_UNLOCK assert(pthread_mutex_unlock(&rxkad_global_stats_lock)==0)
+#define GET_RXKAD_STATS(stats) rxkad_stats_agg(stats)
+#define GET_RXKAD_THR_STATS(rxkad_stats) \
+ BEGIN \
+ (rxkad_stats) = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
+ if ((rxkad_stats) == NULL) { \
+ assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
+ } \
+ END
+#define INC_RXKAD_STATS(stats_elem) \
+ BEGIN \
+ rxkad_stats_t * rxkad_stats; \
+ rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
+ if (rxkad_stats == NULL) { \
+ assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
+ } \
+ rxkad_stats->stats_elem++; \
+ END
+#define DEC_RXKAD_STATS(stats_elem) \
+ BEGIN \
+ rxkad_stats_t * rxkad_stats; \
+ rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
+ if (rxkad_stats == NULL) { \
+ assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
+ } \
+ rxkad_stats->stats_elem--; \
+ END
+#ifndef AFS_OBSD38_ENV
+#define ADD_RXKAD_STATS(stats_elem, inc_value) \
+ BEGIN \
+ rxkad_stats_t * rxkad_stats; \
+ rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
+ if (rxkad_stats == NULL) { \
+ assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
+ } \
+ rxkad_stats->stats_elem += inc_value; \
+ END
+#define SUB_RXKAD_STATS(stats_elem, dec_value) \
+ BEGIN \
+ rxkad_stats_t * rxkad_stats; \
+ rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
+ if (rxkad_stats == NULL) { \
+ assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
+ } \
+ rxkad_stats->stats_elem -= dec_value; \
+ END
+#else /* AFS_OBSD38_ENV */
+/* segfaults but we don't know why */
+#define ADD_RXKAD_STATS(stats_elem, inc_value)
+#define SUB_RXKAD_STATS(stats_elem, dec_value)
+#endif /* AFS_OBSD38_ENV */
+#else /* AFS_PTHREAD_ENV */
+#define INC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem++
+#define DEC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem--
+#define ADD_RXKAD_STATS(stats_elem, inc_value) rxkad_stats.stats_elem += (inc_value)
+#define SUB_RXKAD_STATS(stats_elem, dec_value) rxkad_stats.stats_elem -= (dec_value)
+#define GET_RXKAD_STATS(stats) memcpy((stats), &rxkad_stats, sizeof(rxkad_stats))
+#endif /* AFS_PTHREAD_ENV */
+
+
+#if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
+#ifndef RXKAD_STATS_DECLSPEC
+#define RXKAD_STATS_DECLSPEC __declspec(dllimport) extern
+#endif
+#else
+#define RXKAD_STATS_DECLSPEC extern
+#endif
+
+#ifdef AFS_PTHREAD_ENV
+RXKAD_STATS_DECLSPEC struct rxkad_global_stats rxkad_global_stats;
+#else /* AFS_PTHREAD_ENV */
+RXKAD_STATS_DECLSPEC struct rxkad_stats rxkad_stats;
+#endif
+
+
+#endif /* AFS_SRC_DES_STATS_H */
hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
afs_atomlist.o afs_lhash.o snprintf.o strlcat.o strlcpy.o strnlen.o \
- pthread_glock.o daemon.o rxkstats.o ${REGEX_OBJ}
+ pthread_glock.o daemon.o ${REGEX_OBJ}
includes = \
${TOP_INCDIR}/afs/dirpath.h \
daemon.o: ${srcdir}/daemon.c ${includes}
${CCOBJ} ${CFLAGS} -c ${srcdir}/daemon.c
-rxkstats.o: ${srcdir}/rxkstats.c ${includes}
- ${CCOBJ} ${CFLAGS} -c ${srcdir}/rxkstats.c
-
#
# Install targets
#
+++ /dev/null
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#include <des.h>
-#include <des/stats.h>
-
-#ifndef AFS_PTHREAD_ENV
-struct rxkad_stats rxkad_stats = { { 0 } };
-#else
-rxkad_stats_t rxkad_stats = { { 0 } };
-#endif