xref: /openssh-portable/includes.h (revision bcd14850)
1e3476ed0SDamien Miller /* $OpenBSD: includes.h,v 1.54 2006/07/22 20:48:23 stevesk Exp $ */
236579d3dSBen Lindstrom 
3d4a8b7e3SDamien Miller /*
495def098SDamien Miller  * Author: Tatu Ylonen <ylo@cs.hut.fi>
595def098SDamien Miller  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
695def098SDamien Miller  *                    All rights reserved
795def098SDamien Miller  * This file includes most of the needed system headers.
895def098SDamien Miller  *
9e4340be5SDamien Miller  * As far as I am concerned, the code I have written for this software
10e4340be5SDamien Miller  * can be used freely for any purpose.  Any derived versions of this
11e4340be5SDamien Miller  * software must be clearly marked as such, and if the derived work is
12e4340be5SDamien Miller  * incompatible with the protocol description in the RFC file, it must be
13e4340be5SDamien Miller  * called by a name other than "ssh" or "Secure Shell".
14d4a8b7e3SDamien Miller  */
15d4a8b7e3SDamien Miller 
16d4a8b7e3SDamien Miller #ifndef INCLUDES_H
17d4a8b7e3SDamien Miller #define INCLUDES_H
18d4a8b7e3SDamien Miller 
194874c79aSDamien Miller #include "config.h"
204874c79aSDamien Miller 
21221b4b24SDarren Tucker #ifndef _GNU_SOURCE
22ac0c8a53SDarren Tucker #define _GNU_SOURCE /* activate extra prototypes for glibc */
23221b4b24SDarren Tucker #endif
24ac0c8a53SDarren Tucker 
259aec9194SDamien Miller #include <sys/types.h>
2648b68ce1Sdjm@openbsd.org #include <sys/param.h>
27607aede2SDamien Miller #include <sys/socket.h> /* For CMSG_* */
2872c9a7e9SDamien Miller 
29603bdfd6SBen Lindstrom #ifdef HAVE_LIMITS_H
3038806bdaSDamien Miller # include <limits.h> /* For PATH_MAX, _POSIX_HOST_NAME_MAX */
31603bdfd6SBen Lindstrom #endif
32beb4ba5aSDamien Miller #ifdef HAVE_BSTRING_H
33beb4ba5aSDamien Miller # include <bstring.h>
34beb4ba5aSDamien Miller #endif
35ab18c412SDamien Miller #ifdef HAVE_ENDIAN_H
36ab18c412SDamien Miller # include <endian.h>
37ab18c412SDamien Miller #endif
38348c9b7aSDamien Miller #ifdef HAVE_TTYENT_H
39348c9b7aSDamien Miller # include <ttyent.h>
40348c9b7aSDamien Miller #endif
4142202bc8SBen Lindstrom #ifdef HAVE_UTIME_H
4242202bc8SBen Lindstrom # include <utime.h>
4342202bc8SBen Lindstrom #endif
44813f0452STim Rice #ifdef HAVE_MAILLOCK_H
45813f0452STim Rice # include <maillock.h> /* For _PATH_MAILDIR */
46813f0452STim Rice #endif
47813f0452STim Rice #ifdef HAVE_NEXT
48813f0452STim Rice # include <libc.h>
49b0024914SDamien Miller #endif
50725286e2SDarren Tucker #ifdef HAVE_PATHS_H
51b0024914SDamien Miller # include <paths.h>
52813f0452STim Rice #endif
53813f0452STim Rice 
54813f0452STim Rice /*
55813f0452STim Rice  *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively
56813f0452STim Rice  */
57813f0452STim Rice #ifdef HAVE_STRINGS_H
58813f0452STim Rice # include <strings.h>
59813f0452STim Rice #endif
60813f0452STim Rice #ifdef HAVE_LOGIN_H
61813f0452STim Rice # include <login.h>
62813f0452STim Rice #endif
63813f0452STim Rice 
64813f0452STim Rice #ifdef HAVE_UTMP_H
65813f0452STim Rice #  include <utmp.h>
66813f0452STim Rice #endif
67813f0452STim Rice #ifdef HAVE_UTMPX_H
68813f0452STim Rice #  include <utmpx.h>
69813f0452STim Rice #endif
70813f0452STim Rice #ifdef HAVE_LASTLOG_H
71813f0452STim Rice #  include <lastlog.h>
72813f0452STim Rice #endif
73813f0452STim Rice 
74813f0452STim Rice #ifdef HAVE_SYS_SELECT_H
75813f0452STim Rice # include <sys/select.h>
76813f0452STim Rice #endif
77813f0452STim Rice #ifdef HAVE_SYS_BSDTTY_H
78813f0452STim Rice # include <sys/bsdtty.h>
79813f0452STim Rice #endif
80eae876e8STim Rice #ifdef HAVE_STDINT_H
81eae876e8STim Rice # include <stdint.h>
82eae876e8STim Rice #endif
836645e7a7SDamien Miller #include <termios.h>
84813f0452STim Rice #ifdef HAVE_SYS_BITYPES_H
85813f0452STim Rice # include <sys/bitypes.h> /* For u_intXX_t */
86813f0452STim Rice #endif
87813f0452STim Rice #ifdef HAVE_SYS_CDEFS_H
88813f0452STim Rice # include <sys/cdefs.h> /* For __P() */
89813f0452STim Rice #endif
907a4cf232STim Rice #ifdef HAVE_SYS_STAT_H
917a4cf232STim Rice # include <sys/stat.h> /* For S_* constants and macros */
927a4cf232STim Rice #endif
93813f0452STim Rice #ifdef HAVE_SYS_SYSMACROS_H
94813f0452STim Rice # include <sys/sysmacros.h> /* For MIN, MAX, etc */
95813f0452STim Rice #endif
96*bcd14850SDamien Miller #ifdef HAVE_SYS_TIME_H
97*bcd14850SDamien Miller # include <sys/time.h> /* for timespeccmp if present */
98*bcd14850SDamien Miller #endif
99813f0452STim Rice #ifdef HAVE_SYS_MMAN_H
100813f0452STim Rice #include <sys/mman.h> /* for MAP_ANONYMOUS */
101813f0452STim Rice #endif
1025d0ccf3bSDarren Tucker #ifdef HAVE_SYS_STRTIO_H
1035d0ccf3bSDarren Tucker #include <sys/strtio.h>	/* for TIOCCBRK on HP-UX */
1045d0ccf3bSDarren Tucker #endif
1052597bfd1STim Rice #if defined(HAVE_SYS_PTMS_H) && defined(HAVE_DEV_PTMX)
10607459353SDarren Tucker # if defined(HAVE_SYS_STREAM_H)
10707459353SDarren Tucker #  include <sys/stream.h>	/* reqd for queue_t on Solaris 2.5.1 */
10807459353SDarren Tucker # endif
1092597bfd1STim Rice #include <sys/ptms.h>	/* for grantpt() and friends */
1102597bfd1STim Rice #endif
111813f0452STim Rice 
112607aede2SDamien Miller #include <netinet/in.h>
113813f0452STim Rice #include <netinet/in_systm.h> /* For typedefs */
114813f0452STim Rice #ifdef HAVE_RPC_TYPES_H
115813f0452STim Rice # include <rpc/types.h> /* For INADDR_LOOPBACK */
116813f0452STim Rice #endif
117813f0452STim Rice #ifdef USE_PAM
1180f47c537SDamien Miller #if defined(HAVE_SECURITY_PAM_APPL_H)
119813f0452STim Rice # include <security/pam_appl.h>
1200f47c537SDamien Miller #elif defined (HAVE_PAM_PAM_APPL_H)
1210f47c537SDamien Miller # include <pam/pam_appl.h>
1220f47c537SDamien Miller #endif
123813f0452STim Rice #endif
124f71d2a5dSDamien Miller #ifdef HAVE_READPASSPHRASE_H
125f71d2a5dSDamien Miller # include <readpassphrase.h>
126f71d2a5dSDamien Miller #endif
127813f0452STim Rice 
12881ed518bSTim Rice #ifdef HAVE_IA_H
12981ed518bSTim Rice # include <ia.h>
13081ed518bSTim Rice #endif
13181ed518bSTim Rice 
1322291c00aSTim Rice #ifdef HAVE_IAF_H
1332291c00aSTim Rice # include <iaf.h>
1342291c00aSTim Rice #endif
1352291c00aSTim Rice 
13681ed518bSTim Rice #ifdef HAVE_TMPDIR_H
13781ed518bSTim Rice # include <tmpdir.h>
13881ed518bSTim Rice #endif
13981ed518bSTim Rice 
140b87f6b70SDamien Miller #if defined(HAVE_BSD_LIBUTIL_H)
141b87f6b70SDamien Miller # include <bsd/libutil.h>
142b87f6b70SDamien Miller #elif defined(HAVE_LIBUTIL_H)
143b87f6b70SDamien Miller # include <libutil.h>
1447b3f58cbSDamien Miller #endif
1457b3f58cbSDamien Miller 
1463c78c5edSDarren Tucker #if defined(KRB5) && defined(USE_AFS)
147409cb328SDarren Tucker # include <krb5.h>
148409cb328SDarren Tucker # include <kafs.h>
149409cb328SDarren Tucker #endif
150409cb328SDarren Tucker 
1512be1cbb7SDarren Tucker #if defined(HAVE_SYS_SYSLOG_H)
1522be1cbb7SDarren Tucker # include <sys/syslog.h>
1532be1cbb7SDarren Tucker #endif
1542be1cbb7SDarren Tucker 
155d8968adbSDamien Miller #include <errno.h>
156d8968adbSDamien Miller 
1573d50c9bdSDarren Tucker /*
1583d50c9bdSDarren Tucker  * On HP-UX 11.11, shadow.h and prot.h provide conflicting declarations
1593d50c9bdSDarren Tucker  * of getspnam when _INCLUDE__STDC__ is defined, so we unset it here.
1603d50c9bdSDarren Tucker  */
161a56f191eSDarren Tucker #ifdef GETSPNAM_CONFLICTING_DEFS
1623d50c9bdSDarren Tucker # ifdef _INCLUDE__STDC__
1633d50c9bdSDarren Tucker #  undef _INCLUDE__STDC__
1643d50c9bdSDarren Tucker # endif
1653d50c9bdSDarren Tucker #endif
1663d50c9bdSDarren Tucker 
16772ef7c14SDamien Miller #ifdef WITH_OPENSSL
168813f0452STim Rice #include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
16972ef7c14SDamien Miller #endif
170813f0452STim Rice 
171813f0452STim Rice #include "defines.h"
172813f0452STim Rice 
1731b06dc30SDamien Miller #include "platform.h"
1743c027689SDamien Miller #include "openbsd-compat/openbsd-compat.h"
175813f0452STim Rice #include "openbsd-compat/bsd-nextstep.h"
1765f05637bSDamien Miller 
177813f0452STim Rice #include "entropy.h"
178dc0594ccSBen Lindstrom 
179d4a8b7e3SDamien Miller #endif /* INCLUDES_H */
180