Tidy up UKERNEL includes
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Thu, 15 Apr 2010 19:52:11 +0000 (20:52 +0100)
committerDerrick Brashear <shadow@dementia.org>
Thu, 15 Apr 2010 22:56:05 +0000 (15:56 -0700)
UKERNEL is just another userspace build - there's no need to
maintain completely separate header file lists in each object file
for "userspace" and "ukernel". Tidy this up to improve the
readability of these sections of code.

Change-Id: I69f476a0b8aae1204cd4207c7c656ec7e07184df
Reviewed-on: http://gerrit.openafs.org/1758
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

26 files changed:
src/auth/authcon.c
src/auth/cellconfig.c
src/auth/ktc.c
src/des/des.h
src/fsint/afsaux.c
src/kauth/authclient.c
src/kauth/client.c
src/kauth/kaaux.c
src/kauth/kalocalcell.c
src/kauth/kautils.p.h
src/kauth/token.c
src/kauth/user.c
src/ptserver/ptclient.h
src/ptserver/ptserver.h
src/ptserver/ptuser.c
src/rx/rx_conncache.c
src/rxkad/crc.c
src/rxkad/md4.c
src/rxkad/md5.c
src/rxkad/ticket.c
src/rxkad/ticket5.c
src/rxstat/rxstat.c
src/ubik/ubik.p.h
src/ubik/ubikclient.c
src/util/afsutil.h
src/util/hostparse.c

index 36b0670..61fd731 100644 (file)
@@ -8,27 +8,8 @@
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "afs/pthread_glock.h"
-#include "rx/rxkad.h"
-#include "rx/rx.h"
-#include "afs/cellconfig.h"
-#include "afs/keys.h"
-#include "afs/auth.h"
-#include "afs/pthread_glock.h"
-#include "des.h"
-#include "des_prototypes.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #include <sys/types.h>
@@ -49,7 +30,6 @@
 #include "cellconfig.h"
 #include "keys.h"
 #include "auth.h"
-#endif /* defined(UKERNEL) */
 
 /* return a null security object if nothing else can be done */
 static afs_int32
index f20173f..4c21918 100644 (file)
 
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
-#ifdef UKERNEL
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "des/des.h"
-#include "rx/rxkad.h"
-#include <netdb.h>
-#include <ctype.h>
-#else /* UKERNEL */
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
@@ -54,7 +46,7 @@
 #endif
 #include <rx/rxkad.h>
 #include <rx/rx.h>
-#endif /* UKERNEL */
+
 #include <afs/afsutil.h>
 #include "cellconfig.h"
 #include "keys.h"
index 0620157..bb885be 100644 (file)
 /* ticket caching code */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
 
 #if defined(UKERNEL)
-#include "afs/sysincludes.h"
 #include "afsincludes.h"
-#include "afs/stds.h"
-#include "afs/pthread_glock.h"
-#include "afs/vice.h"
-#include "afs/auth.h"
-#include "afs/venus.h"
-#include "afs/pthread_glock.h"
-#include "afs/dirpath.h"
-#include <ctype.h>
-
-#if !defined(min)
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif /* !defined(min) */
-
-#else /* defined(UKERNEL) */
+#endif
 
 #ifdef AFS_SUN5_ENV
 #include <unistd.h>
 #include <afs/auth.h>
 #include <afs/venus.h>
 #include <afs/afsutil.h>
-#include <afs/sys_prototypes.h>
 
-#endif /* defined(UKERNEL) */
+#if !defined(UKERNEL)
+#include <afs/sys_prototypes.h>
+#endif
 
 #if defined(LINUX_KEYRING_SUPPORT) && defined(HAVE_SESSION_TO_PARENT)
 #include <sys/syscall.h>
index 2b4b768..747caad 100644 (file)
 #ifndef DES_DEFS
 #define DES_DEFS
 
-#if defined(UKERNEL)
-#include "des/mit-cpyright.h"
-#else /* defined(UKERNEL) */
 #include "mit-cpyright.h"
-#endif /* defined(UKERNEL) */
 
 typedef unsigned char des_cblock[8];   /* crypto-block size */
 /* Key schedule */
index b5f85bd..bbfda38 100644 (file)
@@ -8,11 +8,7 @@
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 
 #ifdef KERNEL
index de499d3..34e56a6 100644 (file)
 /* These routines provide a convenient interface to the AuthServer. */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 #ifdef IGNORE_SOME_GCC_WARNINGS
 # pragma GCC diagnostic warning "-Wstrict-prototypes"
 
 #define UBIK_LEGACY_CALLITER 1
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs_usrops.h"
-#include "afs/stds.h"
-#include "afs/pthread_glock.h"
-#include "des.h"
-#include "des_prototypes.h"
-#include "rx/rxkad.h"
-#include "afs/cellconfig.h"
-#include "ubik.h"
-#include "afs/auth.h"
-#include "afs/afsutil.h"
-
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/pthread_glock.h"
-
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #include <sys/types.h>
 #include <afs/afsutil.h>
 #include "kauth.h"
 #include "kautils.h"
-#endif /* defined(UKERNEL) */
 
+#ifdef UKERNEL
+#include "afs_usrops.h"
+#endif
 
 static struct afsconf_dir *conf = 0;
 static struct afsconf_cell explicit_cell_server_list;
index ffd6875..7db7ba0 100644 (file)
@@ -8,31 +8,8 @@
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
 
-#if defined(UKERNEL)
-#if defined(HAVE_UNISTD_H) && !defined(__USE_XOPEN)
-#define __USE_XOPEN
-#endif
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "afs/pthread_glock.h"
-#include "afs/cellconfig.h"
-#include "afs/afsutil.h"
-#include "afs/auth.h"
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/pthread_glock.h"
-#include "des/des.h"
-#include "des/des_prototypes.h"
-
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #include <stdio.h>
@@ -54,7 +31,6 @@
 #include <des_prototypes.h>
 #include "kauth.h"
 #include "kautils.h"
-#endif /* defined(UKERNEL) */
 
 
 /* This defines the Andrew string_to_key function.  It accepts a password
index bf673a0..5f83d22 100644 (file)
 #include <afs/param.h>
 
 
-#if defined(UKERNEL)
-#include "rx/xdr.h"
-#include "afs/kauth.h"
-#else /* defined(UKERNEL) */
 #include <rx/xdr.h>
 #include <afs/kauth.h>
-#endif /* defined(UKERNEL) */
 
 #define MAXBS  2048            /* try to avoid horrible allocs */
 
index 959b909..bcd88dc 100644 (file)
@@ -8,26 +8,8 @@
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
-
-#if defined(UKERNEL)
-#include "afs/pthread_glock.h"
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs_usrops.h"
-#include "afs/cellconfig.h"
-#include "afs/pthread_glock.h"
-#include "rx/xdr.h"
-#include "rx/rx.h"
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/afsutil.h"
-#else /* defined(UKERNEL) */
 #include <afs/pthread_glock.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include "kauth.h"
 #include "kautils.h"
 #include <afs/afsutil.h>
-#endif /* defined(UKERNEL) */
+
+#ifdef UKERNEL
+#include "afs_usrops.h"
+#endif
 
 /* This is a utility routine that many parts of kauth use but it invokes the
    afsconf package so its best to have it in a separate .o file to make the
index 32d491a..3504aa7 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __KAUTILS__
 #define __KAUTILS__
 
-#if !defined(UKERNEL)
 #include <des.h>
 #include <afs/auth.h>
 
 #include <afs/cellconfig.h>
 #include <afs/afsutil.h>
 
-#else
-#include "ubik.h"
-#include "afs/auth.h"
-#include "afs/cellconfig.h"
-#endif /* !defined(UKERNEL) */
-
 
 #define KA_TIMESTR_LEN 30
 #define Date afs_uint32
index 07e7978..e2e7c5e 100644 (file)
    from the AuthServer. */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
+#ifdef UKERNEL
+# include "afsincludes.h"
+#endif
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "rx/xdr.h"
-#include "afs/pthread_glock.h"
-#include "afs/lock.h"
-#include "ubik.h"
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/auth.h"
-#include "afs/pthread_glock.h"
-#include "afs/afsutil.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <sys/types.h>
 #include <rx/xdr.h>
@@ -53,7 +38,6 @@
 #include "kauth.h"
 #include "kautils.h"
 #include <afs/auth.h>
-#endif /* defined(UKERNEL) */
 
 
 afs_int32
index 380b39f..9f002a7 100644 (file)
  * package. */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "afs/com_err.h"
-#include "afs/cellconfig.h"
-#include "afs/auth.h"
-#include "afs/ptint.h"
-#include "afs/pterror.h"
-#include "afs/ptserver.h"
-#include "rx/rx.h"
-#include "rx/rx_globals.h"
-#include "rx/rxkad.h"
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/afsutil.h"
-#include "afs/ptuser.h"
-#include "des.h"
-#include "des_prototypes.h"
-#include "afs/ktc.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <signal.h>
 #include <afs/com_err.h>
 #include <afs/ptuser.h>
 #include <afs/ptserver.h>
 #include <afs/afsutil.h>
+
+#ifndef UKERNEL
 #include <afs/sys_prototypes.h>
+#endif
+
 #include <des.h>
 #include <des_prototypes.h>
 #include <rx/rx.h>
@@ -66,7 +45,6 @@
 #include "kauth.h"
 #include "kautils.h"
 #include <afs/ktc.h>
-#endif /* defined(UKERNEL) */
 
 
 afs_int32
index 429ba91..65e45ac 100644 (file)
@@ -7,16 +7,9 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#if defined(UKERNEL)
-#include "afs/lock.h"
-#include "ubik.h"
-#include "afs/ptint.h"
-#include "afs/ptserver.h"
-#else /* defined(UKERNEL) */
 #include <lock.h>
 #include <ubik.h>
 #include "ptint.h"
 #include "ptserver.h"
-#endif /* defined(UKERNEL) */
 
 #define pr_ErrorMsg afs_error_message
index 2e777ab..4742dbb 100644 (file)
@@ -7,11 +7,7 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#if defined(UKERNEL)
-#include "afs/ptint.h"
-#else /* defined(UKERNEL) */
 #include "ptint.h"
-#endif /* defined(UKERNEL) */
 
 #define        PRSRV           73
 
index 12054ab..d59878e 100644 (file)
@@ -8,28 +8,8 @@
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afs_usrops.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "rx/rx.h"
-#include "rx/xdr.h"
-#include "afs/auth.h"
-#include "afs/cellconfig.h"
-#include "afs/afsutil.h"
-#include "afs/ptclient.h"
-#include "afs/ptuser.h"
-#include "afs/pterror.h"
-#include "afs/com_err.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include "ptclient.h"
 #include "ptuser.h"
 #include "pterror.h"
-#endif /* defined(UKERNEL) */
 
+#ifdef UKERNEL
+# include "afs_usrops.h"
+#endif
 
 struct ubik_client *pruclient = 0;
 static afs_int32 lastLevel;    /* security level pruclient, if any */
index 5a94f33..887d9e9 100644 (file)
  */
 
 #include <afsconfig.h>
-#ifdef UKERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
 
-#ifdef UKERNEL
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "rx/rx.h"
-#else /* ! UKERNEL */
 #include <sys/types.h>
 #include <errno.h>
 #include <assert.h>
 #include "rx.h"
-#endif /* UKERNEL */
 
 /*
  * We initialize rxi_connectionCache at compile time, so there is no
index e9f5d78..de694bd 100644 (file)
 /* RCSID("$Heimdal: crc.c,v 1.9 2000/08/03 01:45:14 assar Exp $"); */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "../afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 
-#if defined(UKERNEL)
-#include "../afs/sysincludes.h"
-#include "../afs/afsincludes.h"
-#include "../afs/stds.h"
-#include "../rx/xdr.h"
-#include "../rx/rx.h"
-#include "../des/des.h"
-#include "../afs/lifetimes.h"
-#include "../afs/rxkad.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -64,7 +50,6 @@
 #include <rx/rxkad.h>
 #include <des.h>
 #include "lifetimes.h"
-#endif /* defined(UKERNEL) */
 
 static u_long table[256];
 
index 1738b90..fd574fb 100644 (file)
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "../afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
-#if defined(UKERNEL)
-#include "../afs/sysincludes.h"
-#include "../afs/afsincludes.h"
-#include "../afs/stds.h"
-#include "../rx/xdr.h"
-#include "../rx/rx.h"
-#include "../des/des.h"
-#include "../afs/lifetimes.h"
-#include "../afs/rxkad.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include <rx/rxkad.h>
 #include <des.h>
 #include "lifetimes.h"
-#endif /* defined(UKERNEL) */
-
-
-
-
-
-
-
 #include "md4.h"
 #include "hash.h"
 
index 0910063..8e34522 100644 (file)
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "../afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
-#if defined(UKERNEL)
-#include "../afs/sysincludes.h"
-#include "../afs/afsincludes.h"
-#include "../afs/stds.h"
-#include "../rx/xdr.h"
-#include "../rx/rx.h"
-#include "../des/des.h"
-#include "../afs/lifetimes.h"
-#include "../afs/rxkad.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include <rx/rxkad.h>
 #include <des.h>
 #include "lifetimes.h"
-#endif /* defined(UKERNEL) */
-
-
-
-
-
-
 
 #include "md5.h"
 #include "hash.h"
index 10cde7b..a98fec2 100644 (file)
@@ -8,25 +8,10 @@
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 #include <stdio.h>
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs/stds.h"
-#include "rx/xdr.h"
-#include "rx/rx.h"
-#include "rxkad/lifetimes.h"
-#include "des.h"
-#include "des/des_prototypes.h"
-#include "rx/rxkad.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -41,7 +26,6 @@
 #include <rx/rx.h>
 #include "lifetimes.h"
 #include "rxkad.h"
-#endif /* defined(UKERNEL) */
 
 /* This union is used to insure we allocate enough space for a key
  * schedule even if we are linked against a library that uses OpenSSL's
index da90081..3dea140 100644 (file)
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "../afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 #ifdef IGNORE_SOME_GCC_WARNINGS
 # pragma GCC diagnostic warning "-Wimplicit-function-declaration"
 #endif
 
-#if defined(UKERNEL)
-#include "../afs/sysincludes.h"
-#include "../afs/afsincludes.h"
-#include "../afs/stds.h"
-#include "../rx/xdr.h"
-#include "../rx/rx.h"
-#include "../afs/lifetimes.h"
-#include "../afs/rxkad.h"
-#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -86,7 +73,6 @@
 #include <rx/rx.h>
 #include "lifetimes.h"
 #include "rxkad.h"
-#endif /* defined(UKERNEL) */
 
 #include "v5gen-rewrite.h"
 #include "asn1-common.h"
index 9a30a0a..bfb7898 100644 (file)
@@ -7,28 +7,18 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#ifdef UKERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 #include <afsconfig.h>
 
 
-#ifdef UKERNEL
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include <rx/rxstat.h>
-#else /* UKERNEL */
 #include <afs/stds.h>
 #include <rx/rx.h>
 #include <rx/rxstat.h>
-#ifdef KERNEL
+#if defined(KERNEL) && !defined(UKERNEL)
 #include "sys/errno.h"
-#else /* KERNEL */
+#else /* KERNEL && !UKERNEL */
 #include <errno.h>
-#endif /* KERNEL */
-#endif /* UKERNEL */
+#endif /* KERNEL && !UKERNEL */
 
 /*
  * This file creates a centralized mechanism for implementing the rpc
index fcfd460..5f9f48f 100644 (file)
 
 #endif
 
-#if defined(UKERNEL)
-#include "ubik_int.h"
-#else /* defined(UKERNEL) */
 #include <ubik_int.h>
-#endif /* defined(UKERNEL) */
 
 /*! \name ubik_trans types */
 #define        UBIK_READTRANS      0
index b185db7..d1af899 100644 (file)
@@ -8,29 +8,16 @@
  */
 
 #include <afsconfig.h>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 #ifdef IGNORE_SOME_GCC_WARNINGS
 # pragma GCC diagnostic warning "-Wstrict-prototypes"
 #endif
 
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
+#ifdef UKERNEL
 #include "afsincludes.h"
-#include "afs/stds.h"
-#include "rx/xdr.h"
-#include "rx/rx.h"
-#include "afs/lock.h"
-#include "afs/rxgen_consts.h"
-#define UBIK_LEGACY_CALLITER 1
-#include "ubik.h"
-#include "afs/pthread_glock.h"
-#include <netdb.h>
-#else /* defined(UKERNEL) */
+#endif
+
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #include <stdio.h>
@@ -46,8 +33,8 @@
 #include <netinet/in.h>
 #endif
 #include <afs/rxgen_consts.h>
+#define UBIK_LEGACY_CALLITER
 #include "ubik.h"
-#endif /* defined(UKERNEL) */
 
 #ifdef HAVE_STDINT_H
 # include <stdint.h>
index 3aa037b..18b7b72 100644 (file)
@@ -162,9 +162,7 @@ extern size_t strlcat(char *dst, const char *src, size_t siz);
 extern size_t strlcpy(char *dst, const char *src, size_t siz);
 #endif
 
-#ifndef UKERNEL
-#include "afs/ktime.h"
-#endif
+#include <afs/ktime.h>
 #include "afsutil_prototypes.h"
 
 #endif /* _AFSUTIL_H_ */
index 1ae412e..e090323 100644 (file)
 #include <afs/param.h>
 
 
-#ifdef UKERNEL
-#include "afs/sysincludes.h"
-#include "afs/afsutil.h"
-#include <netdb.h>
-#include <ctype.h>
-#else /* UKERNEL */
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
@@ -37,7 +31,6 @@
 #include <string.h>
 #include <errno.h>
 #include "afsutil.h"
-#endif /* UKERNEL */
 
 
 /* also parse a.b.c.d addresses */