Path: blob/main/crypto/heimdal/appl/telnet/telnetd/telnetd.h
34889 views
/*1* Copyright (c) 1989, 19932* The Regents of the University of California. All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12* 3. All advertising materials mentioning features or use of this software13* must display the following acknowledgement:14* This product includes software developed by the University of15* California, Berkeley and its contributors.16* 4. Neither the name of the University nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*32* @(#)telnetd.h 8.1 (Berkeley) 6/4/9333*/343536#include <config.h>3738#include <stdio.h>39#include <stdarg.h>40#include <stdlib.h>41#include <string.h>4243#ifdef HAVE_SYS_TYPES_H44#include <sys/types.h>45#endif46#ifdef HAVE_SYS_PARAM_H47#include <sys/param.h>48#endif4950#ifdef HAVE_SYS_SOCKET_H51#include <sys/socket.h>52#endif53#ifdef TIME_WITH_SYS_TIME54#include <sys/time.h>55#include <time.h>56#elif defined(HAVE_SYS_TIME_H)57#include <sys/time.h>58#else59#include <time.h>60#endif6162#ifdef HAVE_SYS_RESOURCE_H63#include <sys/resource.h>64#endif /* HAVE_SYS_RESOURCE_H */6566#ifdef HAVE_SYS_WAIT_H67#include <sys/wait.h>68#endif6970#ifdef HAVE_FCNTL_H71#include <fcntl.h>72#endif73#ifdef HAVE_SYS_FILE_H74#include <sys/file.h>75#endif76#ifdef HAVE_SYS_STAT_H77#include <sys/stat.h>78#endif7980/* including both <sys/ioctl.h> and <termios.h> in SunOS 4 generates a81lot of warnings */8283#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4084#include <sys/ioctl.h>85#endif86#ifdef HAVE_SYS_FILIO_H87#include <sys/filio.h>88#endif8990#ifdef HAVE_NETINET_IN_H91#include <netinet/in.h>92#endif93#ifdef HAVE_NETINET_IN6_H94#include <netinet/in6.h>95#endif96#ifdef HAVE_NETINET6_IN6_H97#include <netinet6/in6.h>98#endif99100#ifdef HAVE_ARPA_INET_H101#include <arpa/inet.h>102#endif103104#include <signal.h>105#include <errno.h>106#ifdef HAVE_NETDB_H107#include <netdb.h>108#endif109#ifdef HAVE_SYSLOG_H110#include <syslog.h>111#endif112#include <ctype.h>113114#ifdef HAVE_UNISTD_H115#include <unistd.h>116#endif117118#include <termios.h>119120#ifdef HAVE_PTY_H121#include <pty.h>122#endif123124#ifdef STREAMSPTY125#ifdef HAVE_SAC_H126#include <sac.h>127#endif128#ifdef HAVE_SYS_STROPTS_H129#include <sys/stropts.h>130#endif131132# include <stropts.h>133134#ifdef HAVE_SYS_UIO_H135#include <sys/uio.h>136#ifdef __hpux137#undef SE138#endif139#endif140#ifdef HAVE_SYS_STREAM_H141#include <sys/stream.h>142#endif143144#endif /* STREAMSPTY */145146#undef NOERROR147148#include "defs.h"149150#ifndef _POSIX_VDISABLE151# ifdef VDISABLE152# define _POSIX_VDISABLE VDISABLE153# else154# define _POSIX_VDISABLE ((unsigned char)'\377')155# endif156#endif157158159#ifdef HAVE_SYS_PTY_H160#include <sys/pty.h>161#endif162#ifdef HAVE_SYS_SELECT_H163#include <sys/select.h>164#endif165166#ifdef HAVE_SYS_PTYIO_H167#include <sys/ptyio.h>168#endif169170#ifdef HAVE_SYS_UTSNAME_H171#include <sys/utsname.h>172#endif173174#ifdef HAVE_PATHS_H175#include <paths.h>176#endif177178#ifdef HAVE_ARPA_TELNET_H179#include <arpa/telnet.h>180#endif181182#include "ext.h"183184#ifdef SOCKS185#include <socks.h>186/* This doesn't belong here. */187struct tm *localtime(const time_t *);188struct hostent *gethostbyname(const char *);189#endif190191#ifdef AUTHENTICATION192#include <libtelnet/auth.h>193#include <libtelnet/misc.h>194#ifdef ENCRYPTION195#include <libtelnet/encrypt.h>196#endif197#endif198199#ifdef HAVE_LIBUTIL_H200#include <libutil.h>201#endif202203#include <roken.h>204205/* Don't use the system login, use our version instead */206207/* BINDIR should be defined somewhere else... */208209#ifndef BINDIR210#define BINDIR "/usr/athena/bin"211#endif212213#undef _PATH_LOGIN214#define _PATH_LOGIN BINDIR "/login"215216/* fallbacks */217218#ifndef _PATH_DEV219#define _PATH_DEV "/dev/"220#endif221222#ifndef _PATH_TTY223#define _PATH_TTY "/dev/tty"224#endif /* _PATH_TTY */225226#ifdef DIAGNOSTICS227#define DIAG(a,b) if (diagnostic & (a)) b228#else229#define DIAG(a,b)230#endif231232/* other external variables */233extern char **environ;234235/* prototypes */236237/* appends data to nfrontp and advances */238int output_data (const char *format, ...)239#ifdef __GNUC__240__attribute__ ((format (printf, 1, 2)))241#endif242;243244#ifdef ENCRYPTION245extern int require_encryption;246#endif247248249