#ifndef TAC_PLUS_H #define TAC_PLUS_H 1 /* Copyright (c) 1995-1998 by Cisco systems, Inc. Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that this copyright and permission notice appear on all copies of the software and supporting documentation, the name of Cisco Systems, Inc. not be used in advertising or publicity pertaining to distribution of the program without specific prior permission, and notice be given in supporting documentation that modification, copying and distribution is by permission of Cisco Systems, Inc. Cisco Systems, Inc. makes no representations about the suitability of this software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * If you are defining a system from scratch, the following may be useful. * Otherwise, just use the system definitions below this section. */ /* Define this for minor include file differences on SYSV-based systems */ /* #define SYSV */ /* Define this if your sys_errlist is defined using const */ /* #define CONST_SYSERRLIST */ /* Do you need tacacs+ versions of bzero etc. */ /* #define NEED_BZERO */ /* Define this if your wait call status is a union as opposed to an int */ /* #define UNIONWAIT */ /* Define this if you need a getdtablesize routine defined */ /* #define GETDTABLESIZE */ /* Define this if your system does not reap children automatically * when you ignore SIGCLD */ /* #define REAPCHILD */ /* Define this if you have DES routines you can link to for ARAP (See * the user's guide for more details). */ /* #define ARAP_DES */ #define VERSION_TAIL " (Extended Tac_plus)" /* * System definitions. */ #ifdef NETBSD #define CONST_SYSERRLIST #endif #ifdef AIX /* * The only way to properly compile BSD stuff on AIX is to define a * "bsdcc" compiler on your system. See /usr/lpp/bos/bsdport on your * system for details. People who do NOT do this tell me that the code * still compiles but that it then doesn't behave correctly e.g. child * processes are not reaped correctly. Don't expect much sympathy if * you do this. */ #define _BSD 1 #define _BSD_INCLUDES #define UNIONWAIT #endif /* AIX */ #ifdef LINUX #define REAPCHILD #ifdef GLIBC #define CONST_SYSERRLIST #endif #endif /* LINUX */ #ifdef MIPS #define SYSV #define GETDTABLESIZE #define REAPCHILD #define NEED_BZERO #endif /* MIPS */ #ifdef SOLARIS #define SYSV #define GETDTABLESIZE #define REAPCHILD #define NEED_BZERO #endif /* SOLARIS */ #ifdef HPUX #define SYSV #define GETDTABLESIZE #define REAPCHILD #endif /* HPUX */ #ifdef FREEBSD #define CONST_SYSERRLIST #endif #define MD5_LEN 16 #ifdef MSCHAP #define MSCHAP_DIGEST_LEN 49 #endif /* MSCHAP */ #ifdef SYSV #ifdef HAVE_FCNTL_H #include #endif #define index strchr #endif /* SYSV */ /* Sometimes are bzero/bcopy/bcmp declared as prototypes with non-void argument * pointers. In such case we would generate too much warnings. */ #include #ifdef HAVE_STRINGS_H #include #endif #define bzero(s, n) bzero((void *)(s), (size_t)(n)) #define bcopy(src, dest, n) bcopy((const void *)(src), (void *)(dest), (size_t)(n)) #define bcmp(s1, s2, n) bcmp((const void *)(s1), (const void *)(s2), (size_t)(n)) #ifndef TACPLUS_PIDFILE #define TACPLUS_PIDFILE "/var/run/tac_plus.pid" #endif /* * You probably shouldn't be changing much below this line unless you really * know what you are doing. */ /* Stolen from pbmplus.h of netpbm: */ #if __STDC__ #define TAC_ARGS(alist) alist #else /*__STDC__*/ #define TAC_ARGS(alist) () #endif /*__STDC__*/ /* Stolen from glib of Gnome/GTK+ environment: */ /* Provide macros to feature the GCC function attribute. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define G_GNUC_PRINTF( format_idx, arg_idx ) \ __attribute__((format (printf, format_idx, arg_idx))) #define G_GNUC_NORETURN \ __attribute__((noreturn)) #define G_GNUC_CONST \ __attribute__((const)) #define G_GNUC_UNUSED \ __attribute__((unused)) #else /* !__GNUC__ */ #define G_GNUC_PRINTF( format_idx, arg_idx ) #define G_GNUC_NORETURN #define G_GNUC_CONST #define G_GNUC_UNUSED #endif /* !__GNUC__ */ /* Provide convenience macros for handling structure * fields through their offsets. * Project tac_plus changed "gulong" to "glong" to be able to recover * original structure base from pointer to its member. */ #define G_STRUCT_OFFSET(struct_type, member) \ ((long) ((char*) &((struct_type*) 0)->member)) #define G_STRUCT_MEMBER_P(struct_p, struct_offset) \ ((void*) ((char*) (struct_p) + (long) (struct_offset))) #define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \ (*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset))) /* reversed, in fact: for inside "member_p" calculate "struct" address */ #define TAC_MEMBER_STRUCT(struct_type, member_p, member) \ (G_STRUCT_MEMBER(struct_type,member_p,-G_STRUCT_OFFSET(struct_type,member))) /* may define MAX & MIN without checking whether they * were previously already defined: */ #ifdef HAVE_SYS_PARAM_H #include #endif /* Provide definitions for some commonly used macros. * Some of them are only provided if they haven't already * been defined. It is assumed that if they are already * defined then the current definition is correct. */ #ifndef NULL #define NULL ((void*) 0) #endif #undef MAX #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #undef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) /* The following code is not needed or used. It exists solely to prevent compilers from "helpfully" complaining that this source file is empty, which upsets novices building the software */ #define TAC_SOURCEFILE_EMPTY \ static int dummy_unused G_GNUC_UNUSED = 0; #define DOLLARSIGN '$' /* Odds and ends */ #define STREQ(a,b) (strcmp(a,b)==0) #define MAX_INPUT_LINE_LEN 255 /* miscellaneous */ #ifdef CONST_SYSERRLIST extern const char *const sys_errlist[]; #else extern char *sys_errlist[]; #endif #endif /* TAC_PLUS_H */