includes.h revision 124211
1/*	$OpenBSD: includes.h,v 1.17 2002/01/26 16:44:22 stevesk Exp $	*/
2/*	$FreeBSD: head/crypto/openssh/includes.h 124211 2004-01-07 11:16:27Z des $	*/
3
4/*
5 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
7 *                    All rights reserved
8 * This file includes most of the needed system headers.
9 *
10 * As far as I am concerned, the code I have written for this software
11 * can be used freely for any purpose.  Any derived versions of this
12 * software must be clearly marked as such, and if the derived work is
13 * incompatible with the protocol description in the RFC file, it must be
14 * called by a name other than "ssh" or "Secure Shell".
15 */
16
17#ifndef INCLUDES_H
18#define INCLUDES_H
19
20#define RCSID(msg) \
21__RCSID(msg)
22
23#include "config.h"
24
25#include <stdio.h>
26#include <ctype.h>
27#include <errno.h>
28#include <fcntl.h> /* For O_NONBLOCK */
29#include <signal.h>
30#include <stdlib.h>
31#include <string.h>
32#include <stdarg.h>
33#include <pwd.h>
34#include <grp.h>
35#include <time.h>
36#include <dirent.h>
37
38#ifdef HAVE_LIMITS_H
39# include <limits.h> /* For PATH_MAX */
40#endif
41#ifdef HAVE_GETOPT_H
42# include <getopt.h>
43#endif
44#ifdef HAVE_BSTRING_H
45# include <bstring.h>
46#endif
47#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
48    defined(GLOB_HAS_GL_MATCHC)
49# include <glob.h>
50#endif
51#ifdef HAVE_NETGROUP_H
52# include <netgroup.h>
53#endif
54#ifdef HAVE_ENDIAN_H
55# include <endian.h>
56#endif
57#ifdef HAVE_TTYENT_H
58# include <ttyent.h>
59#endif
60#ifdef HAVE_UTIME_H
61# include <utime.h>
62#endif
63#ifdef HAVE_MAILLOCK_H
64# include <maillock.h> /* For _PATH_MAILDIR */
65#endif
66#ifdef HAVE_NEXT
67#  include <libc.h>
68#endif
69#define __USE_GNU /* before unistd.h, activate extra prototypes for glibc */
70#include <unistd.h> /* For STDIN_FILENO, etc */
71#include <termios.h> /* Struct winsize */
72
73/*
74 *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively
75 */
76#ifdef HAVE_STRINGS_H
77# include <strings.h>
78#endif
79#ifdef HAVE_LOGIN_H
80# include <login.h>
81#endif
82
83#ifdef HAVE_UTMP_H
84#  include <utmp.h>
85#endif
86#ifdef HAVE_UTMPX_H
87#  ifdef HAVE_TV_IN_UTMPX
88#    include <sys/time.h>
89#  endif
90#  include <utmpx.h>
91#endif
92#ifdef HAVE_LASTLOG_H
93#  include <lastlog.h>
94#endif
95#ifdef HAVE_PATHS_H
96#  include <paths.h> /* For _PATH_XXX */
97#endif
98
99#include <sys/types.h>
100#include <sys/socket.h>
101#include <sys/ioctl.h>
102#include <sys/wait.h>
103#ifdef HAVE_SYS_TIME_H
104# include <sys/time.h> /* For timersub */
105#endif
106#include <sys/resource.h>
107#ifdef HAVE_SYS_SELECT_H
108# include <sys/select.h>
109#endif
110#ifdef HAVE_SYS_BSDTTY_H
111# include <sys/bsdtty.h>
112#endif
113#include <sys/param.h> /* For MAXPATHLEN and roundup() */
114#ifdef HAVE_SYS_UN_H
115# include <sys/un.h> /* For sockaddr_un */
116#endif
117#ifdef HAVE_STDINT_H
118# include <stdint.h>
119#endif
120#ifdef HAVE_SYS_BITYPES_H
121# include <sys/bitypes.h> /* For u_intXX_t */
122#endif
123#ifdef HAVE_SYS_CDEFS_H
124# include <sys/cdefs.h> /* For __P() */
125#endif
126#ifdef HAVE_SYS_STAT_H
127# include <sys/stat.h> /* For S_* constants and macros */
128#endif
129#ifdef HAVE_SYS_SYSMACROS_H
130# include <sys/sysmacros.h> /* For MIN, MAX, etc */
131#endif
132#ifdef HAVE_SYS_MMAN_H
133#include <sys/mman.h> /* for MAP_ANONYMOUS */
134#endif
135#ifdef HAVE_SYS_STRTIO_H
136#include <sys/strtio.h>	/* for TIOCCBRK on HP-UX */
137#endif
138
139#include <netinet/in_systm.h> /* For typedefs */
140#include <netinet/in.h> /* For IPv6 macros */
141#include <netinet/ip.h> /* For IPTOS macros */
142#include <netinet/tcp.h>
143#include <arpa/inet.h>
144#if defined(HAVE_NETDB_H)
145# include <netdb.h>
146#endif
147#ifdef HAVE_RPC_TYPES_H
148# include <rpc/types.h> /* For INADDR_LOOPBACK */
149#endif
150#ifdef USE_PAM
151# include <security/pam_appl.h>
152#endif
153#ifdef HAVE_READPASSPHRASE_H
154# include <readpassphrase.h>
155#endif
156
157#ifdef HAVE_IA_H
158# include <ia.h>
159#endif
160
161#ifdef HAVE_TMPDIR_H
162# include <tmpdir.h>
163#endif
164
165#ifdef HAVE_LIBUTIL_H
166# include <libutil.h> /* Openpty on FreeBSD at least */
167#endif
168
169#include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
170
171#include "defines.h"
172
173#include "version.h"
174#include "openbsd-compat/openbsd-compat.h"
175#include "openbsd-compat/bsd-nextstep.h"
176
177#include "entropy.h"
178
179#endif /* INCLUDES_H */
180