📄 www_tcp.h
字号:
#define TCP_INCLUDES_DONE#endif /* DECNET */#ifdef UCX#include <types.h>#include <errno.h>#include <time.h>#include <socket.h>#include <in.h>#include <inet.h>#if defined(TCPWARE) && !defined(__DECC)#include "tcpware_include:netdb.h"#include "tcpware_include:ucx$inetdef.h"#else#include <netdb.h>#include <ucx$inetdef.h>#endif /* TCPWARE */#define TCP_INCLUDES_DONE#endif /* UCX */#ifdef CMU_TCP#include <types.h>#include <errno.h>#include "cmuip_root:[syslib]time.h"#include "cmuip_root:[syslib]socket.h"#include <in.h>#include <inet.h>#include <netdb.h>#include "cmuip_root:[syslib]ioctl.h"#define TCP_INCLUDES_DONE#endif /* CMU_TCP */#ifdef SOCKETSHR_TCP#include <types.h>#include <errno.h>#include <time.h>#include <socket.h>#include <in.h>#include <inet.h>#include <netdb.h>#include "socketshr_library:socketshr.h"#include "socketshr_library:ioctl.h"#define TCP_INCLUDES_DONE#endif /* SOCKETSHR_TCP */#ifdef WIN_TCP#include <types.h>#include <errno.h>#include <time.h>#include <socket.h>#include <in.h>#include <inet.h>#include <netdb.h>#ifndef NO_IOCTL#include <ioctl.h>#endif /* !NO_IOCTL */#define TCP_INCLUDES_DONE#endif /* WIN_TCP */#ifndef TCP_INCLUDES_DONE#include <types.h>#include <errno.h>#include <time.h>#ifdef VMS_SOCKET_HEADERS/*** Not all versions of VMS have the full set of headers** for socket library functions, because the TCP/IP** packages were layered products. If we want these** specifically, instead of those for the above packages,** the module should be compiled with VMS_SOCKET_HEADERS** defined instead of layered product definitions, above.** If the module is not using socket library functions,** none of the definitions need be used, and we include** only the above three headers. - FM*/#include <socket.h>#include <in.h>#include <inet.h>#include <netdb.h>#include <ioctl.h>#endif /* VMS_SOCKET_HEADERS */#define TCP_INCLUDES_DONE#endif /* !TCP_INCLUDES_DONE *//* On VMS machines, the linker needs to be told to put global data sections into a data segment using these storage classes. (MarkDonszelmann) */#if defined(VAXC) && !defined(__DECC)#define GLOBALDEF globaldef#define GLOBALREF globalref#else#ifdef __GNUC__ /* this added by Sterling Bjorndahl */#define GLOBALREF_IS_MACRO 1#define GLOBALDEF_IS_MACRO 1#include <gnu_hacks.h> /* defines GLOBALREF and GLOBALDEF for GNUC on VMS */#endif /* __GNUC__ */#endif /* VAXC && !DECC */#include <perror.h>#ifndef errnoextern int errno;#endif /* !errno */#endif /* VMS *//* * On non-VMS machines and for DECC on VMS, the GLOBALDEF and GLOBALREF * storage types default to normal C storage types. */#ifndef GLOBALREF#define GLOBALDEF#define GLOBALREF extern#endif /* !GLOBALREF */#ifdef __DJGPP__#undef SELECT#define TCP_INCLUDES_DONE#undef IOCTL#define IOCTL(s,cmd,arg) ioctlsocket(s,cmd,(char*)(arg))#define DECL_ERRNO#include <errno.h>#include <sys/types.h>#include <io.h>#include <sys/ioctl.h>#include <sys/socket.h>#include <arpa/inet.h>#include <tcp.h>#ifdef word#undef word#endif /* word */#define select select_s#undef NETWRITE#define NETWRITE write_s#undef NETREAD#define NETREAD read_s#undef NETCLOSE#define NETCLOSE close_s#ifdef UNIX#undef UNIX#endif /* UNIX */#ifdef HAVE_GETTEXT#define gettext gettext__#endif#if !defined(NCURSES) && !defined(USE_SLANG)#define HAVE_CBREAK 1#endif /* !NCURSES && !USE_SLANG */#if defined(USE_SLANG) && !defined(NO_DJ_KEYHANDLER) && defined(HAVE_CONFIG_H)#define DJGPP_KEYHANDLER#endif /* USE_SLANG && !NO_DJ_KEYHANDLER && HAVE_CONFIG_H */#endif /* DJGPP */#ifdef HAVE_UNISTD_H#include <unistd.h>#endif /* HAVE_UNISTD_H */#ifdef HAVE_SYS_FILIO_H#include <sys/filio.h>#endif /* HAVE_SYS_FILIO_H */#if !defined(HAVE_LSTAT) && !defined(lstat)#define lstat(path,block) stat(path,block)#endif#if defined(DECL_ERRNO) && !defined(errno)extern int errno;#endif /* DECL_ERRNO *//*Regular BSD unix versions========================= These are a default unix where not already defined specifically. */#ifndef INCLUDES_DONE#include <sys/types.h>#ifdef HAVE_STRING_H#include <string.h>#endif /* HAVE_STRING_H */#include <errno.h> /* independent */#ifdef __MVS__ /* S/390 -- gil -- 1361 */#include <time.h>#endif /* __MVS__ */#ifdef SCO#include <sys/timeb.h>#include <time.h>#endif /* SCO */#if defined(AIX) || defined(SVR4)#include <time.h>#endif /* AIX || SVR4 */#include <sys/time.h> /* independent */#include <sys/stat.h>#ifndef __MVS__ /* S/390 -- gil -- 1373 */#include <sys/param.h>#endif /* __MVS__ */#include <sys/file.h> /* For open() etc */#if defined(NeXT) || defined(sony_news)#ifndef mode_ttypedef unsigned short mode_t;#endif /* !mode_t */#endif /* NeXT || sony_news */#define INCLUDES_DONE#endif /* Normal includes *//* FIXME: this should be autoconf'd *//* Interactive UNIX for i386 and i486 -- Thanks to jeffrey@itm.itm.org */#ifdef ISC#include <net/errno.h>#include <sys/types.h>#include <sys/tty.h>#include <sys/sioctl.h>#include <sys/bsdtypes.h>#ifndef MERGE#define MERGE#include <sys/pty.h>#undef MERGE#else#include <sys/pty.h>#endif /* !MERGE */#ifndef USE_DIRENT#define USE_DIRENT /* sys V style directory open */#endif /* USE_DIRENT */#include <sys/dirent.h>#endif /* ISC *//* Directory reading stuff - BSD or SYS V*/#ifdef HAVE_CONFIG_H# ifdef HAVE_LIMITS_H# include <limits.h># endif /* HAVE_LIMITS_H */# if !defined(MAXINT) && defined(INT_MAX)# define MAXINT INT_MAX# endif /* !MAXINT && INT_MAX */#else#if !(defined(VM) || defined(VMS) || defined(THINK_C) || defined(PCNFS) || defined(__MINGW32__))#define DECL_SYS_ERRLIST 1#endif#endif /* !HAVE_CONFIG_H */#ifdef HAVE_LIBINTL_H#include <libintl.h>#endif#ifdef HAVE_LIBGETTEXT_H#include <libgettext.h>#endif#define N_(s) s#ifndef HAVE_GETTEXT#define gettext(s) s#endif/*Defaults======== INCLUDE FILES FOR TCP */#ifndef TCP_INCLUDES_DONE#ifndef NO_IOCTL#include <sys/ioctl.h> /* EJB */#endif /* !NO_IOCTL */#include <sys/socket.h>#include <netinet/in.h>#ifdef HAVE_ARPA_INET_H#include <arpa/inet.h> /* Must be after netinet/in.h */#endif#include <netdb.h>#endif /* TCP includes */typedef unsigned short PortNumber;#ifndef S_ISLNK#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)#endif /* S_ISLNK */#ifndef S_ISDIR#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)#endif /* S_ISDIR */#ifndef S_ISREG#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)#endif /* S_ISREG */#ifndef S_ISUID#define S_ISUID 0004000#endif#ifndef S_ISGID#define S_ISGID 0002000#endif#ifndef S_ISVTX#define S_ISVTX 0001000#endif#ifndef S_IRWXU#define S_IRWXU 00700#endif#ifndef S_IRUSR#define S_IRUSR 00400#endif#ifndef S_IWUSR#define S_IWUSR 00200#endif#ifndef S_IXUSR#define S_IXUSR 00100#endif#ifndef S_IRWXG#define S_IRWXG 00070#endif#ifndef S_IRGRP#define S_IRGRP 00040#endif#ifndef S_IWGRP#define S_IWGRP 00020#endif#ifndef S_IXGRP#define S_IXGRP 00010#endif#ifndef S_IRWXO#define S_IRWXO 00007#endif#ifndef S_IROTH#define S_IROTH 00004#endif#ifndef S_IWOTH#define S_IWOTH 00002#endif#ifndef S_IXOTH#define S_IXOTH 00001#endif/*ROUGH ESTIMATE OF MAX PATH LENGTH*/#ifndef HT_MAX_PATH#ifdef MAXPATHLEN#define HT_MAX_PATH MAXPATHLEN#else#ifdef PATH_MAX#define HT_MAX_PATH PATH_MAX#else#define HT_MAX_PATH 1024 /* Any better ideas? */#endif#endif#endif /* HT_MAX_PATH */#if HT_MAX_PATH < 256#undef HT_MAX_PATH#define HT_MAX_PATH 256#endif/* MACROS FOR MANIPULATING MASKS FOR SELECT() */#ifdef SELECT#ifndef FD_SETtypedef unsigned int fd_set;#define FD_SET(fd,pmask) (*(pmask)) |= (1<<(fd))#define FD_CLR(fd,pmask) (*(pmask)) &= ~(1<<(fd))#define FD_ZERO(pmask) (*(pmask))=0#define FD_ISSET(fd,pmask) (*(pmask) & (1<<(fd)))#endif /* !FD_SET */#endif /* SELECT *//* * Macro for setting errno - only define this if you really can do it. */#if defined(CAN_SET_ERRNO) || (!defined(errno) && (!defined(VMS) || defined(UCX)))#define set_errno(value) errno = value#else#define set_errno(value) /* we do not know how */#endif/* IPv6 support */#if defined(HAVE_GETADDRINFO) && defined(HAVE_GAI_STRERROR) && defined(ENABLE_IPV6)# define INET6#endif /* HAVE_GETADDRINFO && HAVE_GAI_STRERROR && ENABLE_IPV6 */#if !defined(__MINGW32__)#ifdef INET6typedef struct sockaddr_storage SockA; /* See netinet/in.h */#elsetypedef struct sockaddr_in SockA; /* See netinet/in.h */#endif /* INET6 */#endif#ifdef INET6#ifdef SIN6_LEN#define SOCKADDR_LEN(soc_address) ((struct sockaddr *)&soc_address)->sa_len#else#ifndef SA_LEN#define SA_LEN(x) (((x)->sa_family == AF_INET6)?sizeof(struct sockaddr_in6): \ (((x)->sa_family == AF_INET)?sizeof(struct sockaddr_in):sizeof(struct sockaddr)))#endif#define SOCKADDR_LEN(soc_address) SA_LEN((struct sockaddr *)&soc_address)#endif /* SIN6_LEN */#else#define SOCKADDR_LEN(soc_address) sizeof(soc_address)#endif /* INET6 */#ifndef MAXHOSTNAMELEN#define MAXHOSTNAMELEN 64 /* Arbitrary limit */#endif /* MAXHOSTNAMELEN */#endif /* TCP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -