📄 ckcnet.h
字号:
#ifndef TGVORWIN /* WINTCP and MULTINET */#define TGVORWIN /* share a lot of code... */#endif /* TGVORWIN */#endif /* WINTCP *//* Wollongong TCP/IP for AT&T Sys V */#ifdef WOLLONGONG /* WOLLONGONG implies TCPSOCKET */#ifndef TCPSOCKET /* Don't confuse WOLLONGONG */#define TCPSOCKET /* (which is for UNIX) with */#endif /* TCPSOCKET */ /* WINTCP, which is for VMS! */#endif /* WOLLONGONG */#ifdef EXCELAN /* EXCELAN implies TCPSOCKET */#ifndef TCPSOCKET#define TCPSOCKET#endif /* TCPSOCKET */#endif /* EXCELAN */#ifdef INTERLAN /* INTERLAN implies TCPSOCKET */#ifndef TCPSOCKET#define TCPSOCKET#endif /* TCPSOCKET */#endif /* INTERLAN */#ifdef BEOSORBEBOX#ifndef TCPIPLIB#define TCPIPLIB#endif /* TCPIPLIB */#define socket_errno h_errno#define socket_read(x,y,z) recv(x,y,sizeof(char),z)#define socket_write(x,y,z) send(x,y,sizeof(char),z)#define socket_ioctl ioctl#define socket_close(x) closesocket(x)#ifndef FIONBIO#define FIONBIO 2#endif /* FIONBIO */#ifndef COHERENT /* eh? */#ifndef FIONREAD#define FIONREAD 1#endif /* FIONREAD */#endif /* COHERENT */#ifndef SIOCATMARK#define SIOCATMARK 3#endif /* SIOCATMARK */#endif /* BEOSORBEBOX */#ifdef COMMENT /* no longer used but might come in handy again later... *//* CK_READ0 can (and should) be defined if and only if: (a) read(fd,&x,0) can be used harmlessly on a TCP/IP socket connection. (b) read(fd,&x,0) returns 0 if the connection is up, -1 if it is down.*/#ifndef CK_READ0#ifdef TCPSOCKET#ifdef SUNOS41 /* It works in SunOS 4.1 */#define CK_READ0#else#ifdef NEXT /* and NeXTSTEP */#define CK_READ0#endif /* NEXT */#endif /* SUNOS41 */#endif /* TCPSOCKET */#endif /* CK_READ0 */#endif /* COMMENT */#ifdef TCPSOCKET#ifndef NOHADDRLIST#ifndef HADDRLIST#ifdef SUNOS41#define HADDRLIST#endif /* SUNOS41 */#ifdef SOLARIS#define HADDRLIST#endif /* SOLARIS */#ifdef LINUX#define HADDRLIST#endif /* LINUX */#ifdef AIXRX#define HADDRLIST#endif /* AIXRS */#ifdef HPUX#define HADDRLIST#endif /* HPUX */#ifdef IRIX#define HADDRLIST#endif /* IRIX */#ifdef I386IX#define HADDRLIST#endif /* I386IX */#endif /* HADDRLIST */#endif /* NOHADDRLIST */#endif /* TCPSOCKET *//* Telnet protocol */#ifdef TCPSOCKET /* TCPSOCKET implies TNCODE */#ifndef TNCODE /* Which means... */#define TNCODE /* Compile in telnet code */#endif /* TNCODE *//* Platforms where we must call gethostname(buf,len) and then gethostbyname(buf) to get local IP address, rather than calling gethostbyname("").*/#ifndef CKGHNLHOST#ifdef datageneral#define CKGHNLHOST#else#ifdef SOLARIS#define CKGHNLHOST#else#ifdef SUNOS4#define CKGHNLHOST#else#ifdef UNIXWARE#define CKGHNLHOST#else#ifdef SINIX#define CKGHNLHOST#endif /* SINIX */#endif /* UNIXWARE */#endif /* SUNOS4 */#endif /* SOLARIS */#endif /* datageneral */#endif /* CKGHNLHOST *//* Telnet local-echo buffer, used for saving up user data that can't be properly displayed and/or evaluated until pending Telnet negotiations are complete. TTLEBUF is defined for platforms (like UNIX) where net i/o is done by the same routines that do serial i/o (in which case the relevant code goes into the ck?tio.c module, in the ttinc(), ttchk(), etc, routines); NETLETBUF is defined for platforms (like VMS) that use different APIs for network and serial i/o, and enables the copies of the same routines that are in ckcnet.c.*/#ifndef TTLEBUF#ifdef UNIX#define TTLEBUF#else#ifdef datageneral#define TTLEBUF#endif /* datageneral */#endif /* UNIX */#endif /* TTLEBUF */#ifndef NETLEBUF#ifdef VMS#define NETLEBUF#endif /* VMS */#endif /* NETLEBUF */#ifndef RLOGCODE /* What about Rlogin? */#ifndef NORLOGIN/* Rlogin can be enabled only for UNIX versions that have both SIGURG (SCO doesn't) and CK_TTGWSIZ (OSF/1 doesn't), so we don't assume that any others have these without verifying first. Not that it really makes little difference since you can only use Rlogin if you are root...*/#ifdef SUNOS41#define RLOGCODE#else#ifdef SOLARIS#define RLOGCODE#else#ifdef HPUX9#define RLOGCODE#else#ifdef HPUX10#define RLOGCODE#else#ifdef OSF40#define RLOGCODE#else#ifdef NEXT#define RLOGCODE#else#ifdef AIX41#define RLOGCODE#else#ifdef UNIXWARE#define RLOGCODE#else#ifdef IRIX51#define RLOGCODE#else#ifdef IRIX60#define RLOGCODE#else#ifdef QNX#define RLOGCODE#else#ifdef __linux__#define RLOGCODE#endif /* __linux__ */#endif /* QNX */#endif /* IRIX60 */#endif /* IRIX51 */#endif /* UNIXWARE */#endif /* AIX41 */#endif /* NEXT */#endif /* OSF40 */#endif /* HPUX10 */#endif /* HPUX9 */#endif /* SOLARIS */#endif /* SUNOS41 */#endif /* NORLOGIN */#ifdef VMS /* VMS */#define RLOGCODE#endif /* VMS */#endif /* RLOGCODE */#endif /* TCPSOCKET */#ifdef SUNX25 /* SUNX25 implies TCPSOCKET */#ifndef TCPSOCKET /* But doesn't imply TNCODE */#define TCPSOCKET#endif /* TCPSOCKET */#endif /* SUNX25 */#ifndef TCPSOCKET#ifndef NO_DNS_SRV#define NO_DNS_SRV#endif /* NO_DNS_SRV */#endif /* TCPSOCKET *//* This is the TCPSOCKET section... */#ifdef TCPSOCKET#ifndef NETCONN /* TCPSOCKET implies NETCONN */#define NETCONN#endif /* NETCONN */#ifndef NO_DNS_SRV#ifdef OS2ONLY#define NO_DNS_SRV#endif /* OS2ONLY */#ifdef VMS#define NO_DNS_SRV#endif /* VMS */#ifdef STRATUS#define NO_DNS_SRV#endif /* STRATUS */#ifdef datageneral#define NO_DNS_SRV#endif /* datageneral */#ifdef ultrix#define NO_DNS_SRV#endif /* ultrix */#ifdef NEXT#define NO_DNS_SRV#endif /* NEXT */#endif /* NO_DNS_SRV */#ifndef CK_DNS_SRV /* Use DNS SRV records to determine */#ifndef NO_DNS_SRV /* host and ports */#define CK_DNS_SRV#endif /* NO_DNS_SRV */#endif /* CK_DNS_SRV */#ifndef NOLISTEN /* select() is required to support */#ifndef SELECT /* incoming connections. */#ifndef VMS#ifndef OS2#define NOLISTEN#endif /* OS2 */#endif /* VMS */#endif /* SELECT */#endif /* NOLISTEN *//* BSD sockets library header files */#ifdef VMS/* Because bzero() and bcopy() are not portable among VMS versions, or compilers, or TCP/IP products, etc.*/#ifndef bzero#define bzero(s,n) memset(s,0,n)#endif /* bzero */#ifndef bcopy#define bcopy(h,a,l) memcpy(a,h,l)#endif /* bcopy */#endif /* VMS */#ifdef UNIX /* UNIX section */#ifdef SVR4/* These suggested by Rob Healey, rhealey@kas.helios.mn.org, to avoid bugs in Berkeley compatibility library on Sys V R4 systems, but untested by me (fdc). Remove this bit if it gives you trouble. (Later corrected by Marc Boucher <mboucher@iro.umontreal.ca> because bzero/bcopy are not argument-compatible with memset/memcpy|memmove.)*/#define bzero(s,n) memset(s,0,n)#ifdef SOLARIS#ifdef SUNX25#undef bzero/* WOULD YOU BELIEVE... That the Solaris X.25 /opt/SUNWcomm/lib/libsockx25 library references bzero, even though the use of bzero is forbidden in Solaris? Look for the function definition in ckcnet.c.*/_PROTOTYP( void bzero, (char *, int) );#endif /* SUNX25 */#define bcopy(h,a,l) memcpy(a,h,l)#else#define bcopy(h,a,l) memmove(a,h,l)#endif /* SOLARIS */#else /* !SVR4 */#ifdef PTX /* Sequent DYNIX PTX 1.3 */#define bzero(s,n) memset(s,0,n)#define bcopy(h,a,l) memcpy(a,h,l)#endif /* PTX */#endif /* SVR4 */#ifdef INTERLAN /* Racal-Interlan TCP/IP */#include <interlan/socket.h>#include <interlan/il_types.h>#include <interlan/telnet.h>#include <interlan/il_errno.h>#include <interlan/in.h>#include <interlan/telnet.h> /* Why twice ? ? ? */#else /* Not Interlan */#ifdef BEOSORBEBOX#include <socket.h>#else /* Not BEBOX */ /* Normal BSD TCP/IP library */#ifdef COMMENT#ifndef HPUX#include <arpa/telnet.h>#endif /* HPUX */#endif /* COMMENT */#ifdef SCO234#include <sys/errno.tcp.h>#include <sys/types.tcp.h>#endif /* SCO234 */#include <sys/socket.h>#ifdef WOLLONGONG#include <sys/in.h>#else#include <netinet/in.h>#endif /* WOLLONGONG */#endif /* BEOSORBEBOX */#endif /* INTERLAN */#ifndef EXCELAN#include <netdb.h>#ifndef INTERLAN#ifdef WOLLONGONG#define minor /* Do not include <sys/macros.h> */#include <sys/inet.h>#else#ifndef OXOS#ifndef HPUX#ifndef BEOSORBEBOX#include <arpa/inet.h>#endif /* BEOSORBEBOX */#endif /* HPUX */#else /* OXOS *//* In too many releases of X/OS, <arpa/inet.h> declares inet_addr() as * ``struct in_addr''. This is definitively wrong, and could cause * core dumps. Instead of including that bad file, inet_addr() is * correctly declared here. Of course, all the declarations done there * has been copied here. */unsigned long inet_addr();char *inet_ntoa();struct in_addr inet_makeaddr();unsigned long inet_network();#endif /* OXOS */#endif /* WOLLONGONG */#endif /* INTERLAN */#endif /* EXCELAN */#ifdef EXCELAN /* Excelan TCP/IP */#ifndef bzero#define bzero(s,n) memset(s,0,n)#endif /* bzero */#ifndef bcopy#define bcopy(h,a,l) memcpy(a,h,l)#endif /* bcopy */#include <ex_errno.h>#endif /* EXCELAN */#ifdef I386IX /* Interactive Sys V R3 network. *//* #define TELOPTS */ /* This might need defining. */#define ORG_NLONG ENAMETOOLONG /* Resolve conflicting symbols */#undef ENAMETOOLONG /* in <errno.h> and <net/errno.h> */#define ORG_NEMPTY ENOTEMPTY#undef ENOTEMPTY#include <net/errno.h>#undef ENAMETOOLONG#define ENAMETOOLONG ORG_NLONG#undef ENOTEMPTY#define ENOTEMPTY ORG_NEMPTY#include <netinet/tcp.h> /* for inet_addr() */#endif /* I386IX *//* Data type of the inet_addr() function... We define INADDRX if it is of type struct inaddr. If it is undefined, unsigned long is assumed. Look at <arpa/inet.h> to find out. The following known cases are handled here. Other systems that need it can be added here, or else -DINADDRX can be included in the CFLAGS on the cc command line.*/#ifndef NOINADDRX#ifdef DU2 /* DEC Ultrix 2.0 */#define INADDRX#endif /* DU2 */#endif /* NOINADDRX */#else /* Not UNIX */#ifdef VMS /* (Open)VMS section */#ifdef MULTINET /* TGV MultiNet *//* In C-Kermit 7.0 Beta.08 we started getting scads of compile time warnings
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -