00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00073 #if !defined(INCLUDED_TELNET_H)
00074 #define INCLUDED_TELNET_H
00075
00076 #if defined(HAVE_WINSOCK2_H)
00077 #include <winsock2.h>
00078 #endif
00079
00080 #if defined(HAVE_WS2TCPIP_H)
00081 #include <ws2tcpip.h>
00082 #endif
00083
00084 #if defined(HAVE_SYS_SOCKET_H)
00085 #include <sys/socket.h>
00086 #endif
00087
00088 #if defined(HAVE_SOCKET_H)
00089 #include <socket.h>
00090 #endif
00091
00092 #if defined(HAVE_IN_H)
00093 #include <in.h>
00094 #endif
00095
00096 #if defined(HAVE_INET_H)
00097 #include <inet.h>
00098 #endif
00099
00100 #if defined(HAVE_ARPA_INET_H)
00101 #include <arpa/inet.h>
00102 #endif
00103
00104 #if defined(HAVE_ARPA_TELNET_H)
00105 #include <arpa/telnet.h>
00106 #endif
00107
00108 #if defined(HAVE_NETINET_IN_H)
00109 #include <netinet/in.h>
00110 #endif
00111
00112 #if defined(HAVE_SYS_SELECT_H)
00113 #include <sys/select.h>
00114 #endif
00115
00116 #if defined(HAVE_ERRNO_H)
00117 #include <errno.h>
00118 #endif
00119
00120 #if defined(HAVE_FCNTL_H)
00121 #include <fcntl.h>
00122 #endif
00123
00124 #if defined(HAVE_SIGNAL_H)
00125 #include <signal.h>
00126 #endif
00127
00128 #if defined(_WIN32) && !defined(__GNUWIN32__)
00129 typedef size_t ssize_t;
00130 typedef int socklen_t;
00131 #endif // _WIN32
00132
00133 #if defined(__VMS)
00134 #define INVALID_SOCKET - 1
00135 typedef unsigned int socklen_t;
00136 #endif // __VMS
00137
00138 #if defined(_WIN32) || defined(__VMS)
00139 #define IAC 255
00140 #define DONT 254
00141 #define DO 253
00142 #define WONT 252
00143 #define WILL 251
00144 #define SB 250
00145 #define GA 249
00146 #define EL 248
00147 #define EC 247
00148 #define AYT 246
00149 #define AO 245
00150 #define IP 244
00151 #define BREAK 243
00152 #define DM 242
00153 #define NOP 241
00154 #define SE 240
00155 #define EOR 239
00156 #define ABORT 238
00157 #define SUSP 237
00158 #define xEOF 236
00159
00160 #define SYNCH 242
00161 #define TELOPT_ECHO 1
00162 #define TELOPT_SGA 3
00163 #define TELOPT_NAWS 31
00164 #define TELOPT_LFLOW 33
00165
00166 #else // defined(_WIN32) || defined(__VMS)
00167 #define INVALID_SOCKET 1
00168 #endif // defined (_WIN32) || defined(__VMS)
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178 #if !defined(HAVE_INET_ATON)
00179 inline int inet_aton(const char* name, struct in_addr* addr)
00180 {
00181 unsigned long a = inet_addr(name);
00182 addr->s_addr = a;
00183 return a != (unsigned int) -1;
00184 }
00185 #endif
00186 #endif // !defined(INCLUDED_TELNET_H)