⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcp.h

📁 Magic C++!的源代码
💻 H
字号:
/* tcp.h -- Magic C++ header file
   (Mostly) portable public-domain implementation
   -- Copyright(C) 2003 Magicunix Infomation Technology Limited 
   This file is part of magicd.
   magicd is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
	 
   For details, see the Magic C++ World-Wide-Web page, 
   `http://www.magicunix.com',
   or send a mail to the Magic C++ developers <support@magicunix.com>.
 */
/*
 * Definitions for TCP and UDP client/server programs.
 */
#include 	<sys/types.h>
#include	<sys/stat.h>
#include	<sys/errno.h>
#include	<stdio.h>
#include	<pwd.h>
#include	<fcntl.h>
#include 	<signal.h>
#include	<netdb.h>
#include	<sys/socket.h>
#include 	<netinet/in.h>

#ifdef linux
#include	<sys/time.h>
#endif /* linux */

#ifdef NEED_INET_H
#include	<sys/inet.h>
#endif /* Was needed for a 3b2 running System V.3.2 */

#ifdef HAVE_SELECT
#include	<sys/select.h>
#endif	/* Was needed for an AIX system */

/* The structure passwed back and forth between negotiate() 
   and the calling function; contains the received buffer, and
   it's length */

struct Buf_Len {
	char buffer[BUFSIZ];
	int len;
	};

extern int netdebug;	/* flag: do network debugging? */

/* library function declarations */

extern unsigned long inet_addr();
extern char	*inet_ntoa();

/* Local function declarations */

extern void d_zero(), d_copy();
extern int init_telnet();
struct Buf_Len *negotiate();

/* Definitions: */

#ifndef DEV_TCP
#define	DEV_UDP		"/dev/udp"	/* WIN/TCP names */
#define	DEV_TCP		"/dev/tcp"	/* WIN/TCP names */
#endif

#define	MAXLINE		 255

extern char	*pname;

/* System configuration definitions */

#ifdef HAVE_ARPA_TELNET
#define TELNET	/* Define this if you have /usr/include/arpa/telnet.h */
#else
static char *telopts[] = {
		"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
		"STATUS", "TIMING MARK", "RCTE" };
#endif

#ifndef SIGCLD  		/* For BSD systems */
#define SIGCLD SIGCHLD
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -