Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 1 | /* |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 2 | * |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 3 | * includes.h |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 4 | * |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 5 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 6 | * |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 7 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 8 | * All rights reserved |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 9 | * |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 10 | * Created: Thu Mar 23 16:29:37 1995 ylo |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 11 | * |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 12 | * This file includes most of the needed system headers. |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 13 | * |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 14 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 15 | |
| 16 | #ifndef INCLUDES_H |
| 17 | #define INCLUDES_H |
| 18 | |
| 19 | #define RCSID(msg) \ |
| 20 | static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } |
| 21 | |
Damien Miller | 4874c79 | 1999-11-16 13:29:26 +1100 | [diff] [blame] | 22 | #include "config.h" |
| 23 | |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 24 | #include <sys/types.h> |
| 25 | #include <sys/socket.h> |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 26 | #include <sys/param.h> |
| 27 | #include <sys/ioctl.h> |
| 28 | #include <sys/stat.h> |
| 29 | #include <sys/wait.h> |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 30 | #include <sys/un.h> |
| 31 | #include <sys/resource.h> |
| 32 | |
| 33 | #include <netinet/in.h> |
| 34 | #include <netinet/in_systm.h> |
| 35 | #include <netinet/tcp.h> |
| 36 | #include <netinet/ip.h> |
| 37 | #include <arpa/inet.h> |
| 38 | #include <netdb.h> |
| 39 | |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 40 | #include <stdio.h> |
| 41 | #include <ctype.h> |
| 42 | #include <errno.h> |
| 43 | #include <fcntl.h> |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 44 | #include <signal.h> |
| 45 | #include <termios.h> |
| 46 | #include <stdlib.h> |
| 47 | #include <string.h> |
| 48 | #include <stdarg.h> |
| 49 | #include <pwd.h> |
| 50 | #include <grp.h> |
| 51 | #include <unistd.h> |
| 52 | #include <time.h> |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 53 | #include <dirent.h> |
| 54 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 55 | #ifdef HAVE_BSTRING_H |
| 56 | # include <bstring.h> |
| 57 | #endif |
Damien Miller | 3bd49ec | 1999-11-15 15:40:55 +1100 | [diff] [blame] | 58 | #ifdef HAVE_NETGROUP_H |
| 59 | # include <netgroup.h> |
| 60 | #endif |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 61 | #ifdef HAVE_NETDB_H |
| 62 | # include <netdb.h> |
| 63 | #endif |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 64 | #ifdef HAVE_PATHS_H |
| 65 | # include <paths.h> |
| 66 | #endif |
| 67 | #ifdef HAVE_ENDIAN_H |
| 68 | # include <endian.h> |
| 69 | #endif |
Damien Miller | 4874c79 | 1999-11-16 13:29:26 +1100 | [diff] [blame] | 70 | #ifdef HAVE_SYS_SELECT_H |
| 71 | # include <sys/select.h> |
| 72 | #endif |
Damien Miller | b3ca3aa | 1999-11-22 13:57:07 +1100 | [diff] [blame] | 73 | #ifdef HAVE_SYS_TIME_H |
| 74 | # include <sys/time.h> |
| 75 | #endif |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 76 | #ifdef HAVE_SYS_BSDTTY_H |
| 77 | # include <sys/bsdtty.h> |
| 78 | #endif |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 79 | #ifdef USE_PAM |
Damien Miller | 4874c79 | 1999-11-16 13:29:26 +1100 | [diff] [blame] | 80 | # include <security/pam_appl.h> |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 81 | #endif |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 82 | #ifdef HAVE_POLL_H |
| 83 | # include <poll.h> |
| 84 | #else |
| 85 | # ifdef HAVE_SYS_POLL_H |
| 86 | # include <sys/poll.h> |
| 87 | # endif |
| 88 | #endif |
Damien Miller | eaf9994 | 2000-01-19 13:45:07 +1100 | [diff] [blame] | 89 | #ifdef HAVE_SYS_SYSMACROS_H |
| 90 | # include <sys/sysmacros.h> |
| 91 | #endif |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 92 | |
| 93 | #include "version.h" |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 94 | |
| 95 | /* BSD function replacements */ |
| 96 | #include "bsd-bindresvport.h" |
| 97 | #include "bsd-rresvport.h" |
Damien Miller | 58ca7d8 | 1999-12-29 19:56:30 +1100 | [diff] [blame] | 98 | #include "bsd-misc.h" |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 99 | #include "bsd-strlcpy.h" |
Damien Miller | b3ca3aa | 1999-11-22 13:57:07 +1100 | [diff] [blame] | 100 | #include "bsd-strlcat.h" |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 101 | #include "bsd-mktemp.h" |
Damien Miller | 42b81ff | 1999-11-26 12:21:24 +1100 | [diff] [blame] | 102 | #include "bsd-snprintf.h" |
Damien Miller | c6b3bbe | 1999-12-13 08:27:33 +1100 | [diff] [blame] | 103 | #include "bsd-daemon.h" |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 104 | #include "bsd-login.h" |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 105 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 106 | /* rfc2553 socket API replacements */ |
| 107 | #include "fake-getaddrinfo.h" |
| 108 | #include "fake-getnameinfo.h" |
| 109 | #include "fake-socket.h" |
| 110 | |
Damien Miller | 5f05637 | 2000-04-16 12:31:48 +1000 | [diff] [blame] | 111 | /* Entropy collection */ |
| 112 | #include "entropy.h" |
| 113 | |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 114 | /* Define this to be the path of the xauth program. */ |
| 115 | #ifndef XAUTH_PATH |
| 116 | #define XAUTH_PATH "/usr/X11R6/bin/xauth" |
| 117 | #endif /* XAUTH_PATH */ |
| 118 | |
| 119 | /* Define this to be the path of the rsh program. */ |
| 120 | #ifndef _PATH_RSH |
| 121 | #define _PATH_RSH "/usr/bin/rsh" |
| 122 | #endif /* _PATH_RSH */ |
| 123 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 124 | /* |
| 125 | * Define this to use pipes instead of socketpairs for communicating with the |
| 126 | * client program. Socketpairs do not seem to work on all systems. |
| 127 | */ |
Damien Miller | 9e53f35 | 2000-02-01 23:05:30 +1100 | [diff] [blame] | 128 | /* #define USE_PIPES 1 */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 129 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 130 | #endif /* INCLUDES_H */ |