Initial import from FreeBSD RELENG_4:
[dragonfly.git] / crypto / kerberosIV / appl / telnet / telnetd / telnetd.h
1 /*
2  * Copyright (c) 1989, 1993
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by the University of
16  *      California, Berkeley and its contributors.
17  * 4. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  *      @(#)telnetd.h   8.1 (Berkeley) 6/4/93
34  */
35 /* $FreeBSD: src/crypto/kerberosIV/appl/telnet/telnetd/telnetd.h,v 1.2.2.2 2003/02/13 21:34:35 nectar Exp $ */
36
37
38 #include <config.h>
39
40 #include <stdio.h>
41 #include <stdarg.h>
42 #include <stdlib.h>
43 #include <string.h>
44
45 #ifdef HAVE_SYS_TYPES_H
46 #include <sys/types.h>
47 #endif
48 #ifdef HAVE_SYS_PARAM_H
49 #include <sys/param.h>
50 #endif
51
52 #ifdef HAVE_SYS_SOCKET_H
53 #include <sys/socket.h>
54 #endif
55 #ifdef TIME_WITH_SYS_TIME
56 #include <sys/time.h>
57 #include <time.h>
58 #elif defined(HAVE_SYS_TIME_H)
59 #include <sys/time.h>
60 #else
61 #include <time.h>
62 #endif
63
64 #ifdef HAVE_SYS_RESOURCE_H
65 #include <sys/resource.h>
66 #endif /* HAVE_SYS_RESOURCE_H */
67
68 #ifdef HAVE_SYS_WAIT_H
69 #include <sys/wait.h>
70 #endif
71
72 #ifdef HAVE_FCNTL_H
73 #include <fcntl.h>
74 #endif
75 #ifdef HAVE_SYS_FILE_H
76 #include <sys/file.h>
77 #endif
78 #ifdef HAVE_SYS_STAT_H
79 #include <sys/stat.h>
80 #endif
81
82 /* including both <sys/ioctl.h> and <termios.h> in SunOS 4 generates a
83    lot of warnings */
84
85 #if defined(HAVE_SYS_IOCTL_H) && SunOS != 40
86 #include <sys/ioctl.h>
87 #endif
88 #ifdef HAVE_SYS_FILIO_H
89 #include <sys/filio.h>
90 #endif
91
92 #ifdef HAVE_NETINET_IN_H
93 #include <netinet/in.h>
94 #endif
95 #ifdef HAVE_NETINET_IN6_H
96 #include <netinet/in6.h>
97 #endif
98 #ifdef HAVE_NETINET6_IN6_H
99 #include <netinet6/in6.h>
100 #endif
101
102 #ifdef HAVE_ARPA_INET_H
103 #include <arpa/inet.h>
104 #endif
105
106 #include <signal.h>
107 #include <errno.h>
108 #ifdef HAVE_NETDB_H
109 #include <netdb.h>
110 #endif
111 #ifdef HAVE_SYSLOG_H
112 #include <syslog.h>
113 #endif
114 #include <ctype.h>
115
116 #ifdef HAVE_UNISTD_H
117 #include <unistd.h>
118 #endif
119
120 #include <termios.h>
121
122 #ifdef HAVE_PTY_H
123 #include <pty.h>
124 #endif
125
126 #include "defs.h"
127
128 #ifndef _POSIX_VDISABLE
129 # ifdef VDISABLE
130 #  define _POSIX_VDISABLE VDISABLE
131 # else
132 #  define _POSIX_VDISABLE ((unsigned char)'\377')
133 # endif
134 #endif
135
136
137 #ifdef HAVE_SYS_PTY_H
138 #include <sys/pty.h>
139 #endif
140 #ifdef HAVE_SYS_SELECT_H
141 #include <sys/select.h>
142 #endif
143
144 #ifdef HAVE_SYS_PTYIO_H
145 #include <sys/ptyio.h>
146 #endif
147
148 #ifdef HAVE_SYS_UTSNAME_H
149 #include <sys/utsname.h>
150 #endif
151
152 #ifdef HAVE_PATHS_H
153 #include <paths.h>
154 #endif
155
156 #ifdef HAVE_ARPA_TELNET_H
157 #include <arpa/telnet.h>
158 #endif
159
160 #include "ext.h"
161
162 #ifdef SOCKS
163 #include <socks.h>
164 /* This doesn't belong here. */
165 struct tm *localtime(const time_t *);
166 struct hostent  *gethostbyname(const char *);
167 #endif
168
169 #ifdef KRB4
170 #define OPENSSL_DES_LIBDES_COMPATIBILITY
171 #include <openssl/des.h>
172 #include <krb.h>
173 #endif
174
175 #ifdef AUTHENTICATION
176 #include <libtelnet/auth.h>
177 #include <libtelnet/misc.h>
178 #ifdef ENCRYPTION
179 #include <libtelnet/encrypt.h>
180 #endif
181 #endif
182
183 #ifdef HAVE_LIBUTIL_H
184 #include <libutil.h>
185 #endif
186
187 #include <roken.h>
188
189 /* Don't use the system login, use our version instead */
190
191 /* BINDIR should be defined somewhere else... */
192
193 #ifndef BINDIR
194 #define BINDIR "/usr/athena/bin"
195 #endif
196
197 #undef _PATH_LOGIN
198 #define _PATH_LOGIN     BINDIR "/login"
199
200 /* fallbacks */
201
202 #ifndef _PATH_DEV
203 #define _PATH_DEV "/dev/"
204 #endif
205
206 #ifndef _PATH_TTY
207 #define _PATH_TTY "/dev/tty"
208 #endif /* _PATH_TTY */
209
210 #ifdef  DIAGNOSTICS
211 #define DIAG(a,b)       if (diagnostic & (a)) b
212 #else
213 #define DIAG(a,b)
214 #endif
215
216 /* other external variables */
217 extern  char **environ;
218
219 /* prototypes */
220
221 /* appends data to nfrontp and advances */
222 int output_data (const char *format, ...)
223 #ifdef __GNUC__
224 __attribute__ ((format (printf, 1, 2)))
225 #endif
226 ;