亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nettcp.h

?? 一個tcp/ip協議棧,帶有PPP、IP、TCP、UDP等協議
?? H
字號:
/*****************************************************************************
* nettcp.h - Network Transmission Control Protocol header file.
*
* Copyright (c) 1998 Global Election Systems Inc.
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
* that existing copyright notices are retained in all copies and that this
* notice and the following disclaimer are included verbatim in any 
* distributions. No written agreement, license, or royalty fee is required
* for any of the authorized uses.
*
* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
* REVISION HISTORY
*
* 98-02-02 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
*	Original based on ka9q and BSD codes.
* 2001-05-18 Mads Christiansen <mads@mogi.dk>, Partner Voxtream 
*       Added support for running uC/IP in a single proces and on ethernet.
******************************************************************************
* THEORY OF OPERATION
*
*****************************************************************************/

#ifndef NETTCP_H
#define NETTCP_H


/*************************
*** PUBLIC DEFINITIONS ***
**************************/
/*
 * TCP configuration. 
 */
#if ETHER_SUPPORT
#define	TCP_DEFMSS	1460		/* Default maximum TCP segment size. */
#define TCP_MINMSS  256 		/* Minimum MSS - interfaces must handle. I'm not sure about this! */
#define	TCP_DEFWND	1460		/* Default receiver window. 
                               Changed this to 1460 bytes (instead of 512) for ethernet.
                               This will allow use of a whole ethernet packet.
                               You will achieve much better performance on file transfers if this 
                               was set higher, but this might be overkill for an embedded system.
                               For better perfomance set this to 4096 and allocate more memory for the
                               buffer system. */
#endif

#if PPP_SUPPORT
#define	TCP_DEFMSS	256			/* Default maximum TCP segment size. */
#define TCP_MINMSS 256			/* Minimum MSS - interfaces must handle 296 - 40. */
#define	TCP_DEFWND	512			/* Default receiver window. */
#endif

#define	TCP_DEFRTT	500			/* Initial guess at round trip time (ms) */
#define TCP_ISSTHRESH 64*KILOBYTE-1	/* Initial slow start threshhold. */
#define TCP_DEFPORT 5000		/* Initial local port. */

#define TCP_MAXQUEUE 8			/* Maximum packets to allow in queue. */
#define TCP_MINSEG 80			/* Minimum sized segment for modified Nagle. */


/*
 * TCP Error codes.
 */
#define TCPERR_EOF -1			/* End of data. */
#define TCPERR_ALLOC -2			/* Unable to allocate a control block. */
#define TCPERR_PARAM -3			/* Invalid parameters. */
#define TCPERR_INVADDR -4		/* Invalid address. */
#define TCPERR_CONFIG -5		/* Invalid configuration. */
#define TCPERR_CONNECT -6		/* No connection. */
#define TCPERR_RESET -7			/* Connection reset received. */
#define TCPERR_TIMEOUT -8		/* Timeout on transmission. */
#define TCPERR_NETWORK -9		/* Network error - unreachable? */
#define TCPERR_PREC -10			/* IP Precedence error. */
#define TCPERR_PROTOCOL -11		/* Protocol error. */

/*
 * TCP IOCTL commands.
 */
/* Get an up status value - non-zero if connection is up. */
#define TCPCTLG_UPSTATUS 100
/* Get the bytes in the receive queue. */
#define TCPCTLG_RCVCNT 101
/*
 * Get/set the keepalive value in seconds - 0 for none.  The argument must
 * point to an int.  Note that if the connection is already established,
 * the keep alive timer won't be started until after the next transmission.
 */
#define TCPCTLG_KEEPALIVE 102
#define TCPCTLS_KEEPALIVE 103
/* Get/set the trace level.  For debugging use only. */
#define TCPCTLG_TRACELEVEL 104
#define TCPCTLS_TRACELEVEL 105


/*
 * TCP port numbers.
 */
#define	TCPPORT_ECHO		7		/* Echo data port */
#define	TCPPORT_DISCARD		9		/* Discard data port */
#define TCPPORT_TELNET		23		/* Telnet port */
#define TCPPORT_FINGER		79		/* Finger port */


/*
 * TCP option codes and lengths. 
 */
#define	TCPOPT_EOL				0
#define	TCPOPT_NOP				1
#define	TCPOPT_MAXSEG			2
#define TCPOLEN_MAXSEG			4
#define TCPOPT_WINDOW			3
#define TCPOLEN_WINDOW			3
#define TCPOPT_TIMESTAMP		8
#define TCPOLEN_TIMESTAMP		10


/************************
*** PUBLIC DATA TYPES ***
*************************/
typedef u_int32_t TCPAddress;
typedef u_int16_t TCPPort;

/* TCP statistics counters */
typedef struct TCPStats_s {
	DiagStat headLine;		/* Head line for display. */
	DiagStat curFree;		/* Current number of free control blocks. */
	DiagStat minFree;		/* Minimum number of free CB's during operation. */
	DiagStat runt;			/* Smaller than minimum size */
	DiagStat checksum;		/* TCP header checksum errors */
	DiagStat conout;		/* Outgoing connection attempts */
	DiagStat conin;			/* Incoming connection attempts */
	DiagStat resetOut;		/* Resets generated */
	DiagStat resetIn;		/* Resets received */
	DiagStat endRec;
} TCPStats;

/*
 * TCP connection states.
 */
typedef enum {
	CLOSED = 0,		/* Must be 0 */
	LISTEN = 1,
	SYN_SENT= 2,
	SYN_RECEIVED = 3,
	ESTABLISHED = 4,
	FINWAIT1 = 5,
	FINWAIT2 = 6,
	CLOSE_WAIT = 7,
	CLOSING	= 8,
	LAST_ACK = 9,
	TIME_WAIT = 10
} TCPState;


/* TCB state labels (for debugging.) */
extern char *tcbStates[];


/*****************************
*** PUBLIC DATA STRUCTURES ***
*****************************/
//extern const DevDef tcpdef;		/* The TCP connection interface. */

#if STATS_SUPPORT > 0
extern TCPStats tcpStats;
#endif


/***********************
*** PUBLIC FUNCTIONS ***
************************/

/*
 * Initialize the TCP subsystem.
 */
void tcpInit(void);

/* 
 * Return a new TCP descriptor on success or an error code (negative) on 
 * failure. 
 */

#if ONETASK_SUPPORT > 0
  int tcpOpen(
    void (*receiveEvent)(int, u_long),               
    void (*transmitEvent)(int, u_long),              
    void (*stateEvent)(int, TCPState, TCPState)      
  );
#else
int tcpOpen(void);
#endif

/* 
 * Close a TCP connection and release the descriptor. 
 * Any outstanding packets in the queues are dropped.
 * Return 0 on success, an error code on failure. 
 */
int tcpClose(u_int td);

/*
 * Bind an IP address and port number in the sockaddr structure as our
 * address on a TCP connection.
 * Note: Currently the IP address must equal ourAddress since that is all
 * that ipDispatch() will recognize.
 * Return 0 on success, an error code on failure.
 */
int tcpBind(u_int td, struct sockaddr_in *myAddr);

/*
 * Establish a connection with a remote host.  Unless tcpBind() has been called,
 * the local IP address and port number are generated automatically.  
 * tcpConnect() blocks until the connection request either succeeds or fails.
 * tcpConnectMs() blocks up to the specified number of milliseconds.  
 * tcpConnectJiffy() blocks up to the specified number of Jiffies (OS timer 
 * ticks).
 * Return 0 on success, an error code on failure.
 */
#define tcpConnect(td, remoteAddr, tos) \
	tcpConnectJiffy(td, remoteAddr, tos, 0)
#define tcpConnectMs(td, remoteAddr, tos, t) \
	tcpConnectJiffy(td, remoteAddr, tos, (t + MSPERJIFFY - 1) / MSPERJIFFY)
int tcpConnectJiffy(u_int td, const struct sockaddr_in *remoteAddr, u_char tos, u_int timeout);

/*
 * tcpDisconnect - Tell the peer that we will not be sending any more data
 * (i.e. perform a half close on a connection).  tcpRead() will then
 * wait until the connection closes.
 * Return 0 when the peer acknowledges our message or an error code on
 * failure.
 */
int tcpDisconnect(u_int td);

/*
 * Set the number of backLog connections which will be queued to be picked up
 * by calls to accept.  Without this call, no connection will be opened until
 * tcpAccept() or tcpConnect() is called.
 * Return 0 on success, an error code on failure.
 */
int tcpListen(u_int td, int backLog);

/*
 * Pick up a connection opened by a remote host.  tcpBind() must be used to
 * specify the local address and port number for the connection.  Unless 
 * tcpListen() has been called, no connection will be accepted until this
 * is called.
 * Return a new TCP descriptor for the opened connection on success, an
 * error code on failure.
 */
#define tcpAccept(td, peerAddr) \
	tcpAcceptJiffy(td, peerAddr, 0)
#define tcpAcceptMs(td, peerAddr, t) \
	tcpReadJiffy(td, peerAddr, (t + MSPERJIFFY - 1) / MSPERJIFFY)
int tcpAcceptJiffy(u_int td, struct sockaddr_in *peerAddr, u_int timeout);

/*
 * Read from a connected TCP connection.  tcpRead() blocks until at least
 * one character is read or an error occurs.  tcpReadMs() blocks at most
 * the specified number of milliseconds.  tcpReadJiffy() blocks at most
 * the specified number of Jiffies (OS timer ticks).
 * Return the number of bytes read on success or timeout, an error code on
 * failure. 
 */
int tcpRead(u_int td, void *s, u_int len);
#define tcpReadMs(td, s, len, t) \
	tcpReadJiffy(td, s, len, (t + MSPERJIFFY - 1) / MSPERJIFFY)
int tcpReadJiffy(u_int td, void *s, u_int len, u_int timeout);

/*
 * Write to a connected TCP connection.  tcpWrite() blocks until all bytes
 * have been queued or an error occurs.  tcpWriteMs() blocks at most the
 * specified number of milliseconds.  tcpWriteJiffy() blocks at most the
 * specified number of Jiffies (OS timer ticks).
 * Return the number of bytes written on success or timeout, an error code
 * on failure.
 */
int tcpWrite(u_int td, const void *s, u_int n);
#define tcpWriteMs(td, s, n, t) \
	tcpWriteJiffy(td, s, n, (t + MSPERJIFFY - 1) / MSPERJIFFY)
int tcpWriteJiffy(u_int td, const void *s, u_int n, u_int timeout);

/*
 * tcpWait - Wait for the connection to be closed.  Normally this will be
 * done after a disconnect before trying to reuse the TCB.  This will fail
 * if the connection is not closing.
 * Returns 0 on success or an error code if the connection is not
 * closing.
 */
int tcpWait(u_int td);

/* 
 * Receive an incoming datagram.  This is called from IP.
 */
void tcpInput(NBuf *inBuf, u_int ipHeadLen);

/* 
 * Get and set parameters for the given connection.
 * Return 0 on success, an error code on failure. 
 */
int  tcpIOCtl(u_int td, int cmd, void *arg);

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频线看| 久久久国际精品| 成人黄色一级视频| 国产一区二区三区电影在线观看| 免费精品99久久国产综合精品| 亚洲男人天堂av网| 亚洲人吸女人奶水| 亚洲精品菠萝久久久久久久| 综合色中文字幕| 一区二区免费看| 亚洲一线二线三线视频| 亚洲成人黄色影院| 日韩黄色片在线观看| 麻豆成人久久精品二区三区红 | 国产精品拍天天在线| 中文字幕不卡一区| 一区二区三区欧美日| 亚洲国产欧美一区二区三区丁香婷| 亚洲自拍偷拍av| 日本欧美大码aⅴ在线播放| 麻豆成人91精品二区三区| 欧美午夜影院一区| 欧美三级在线播放| 日韩一区二区在线免费观看| 欧美变态tickle挠乳网站| 国产日韩一级二级三级| 亚洲欧洲精品一区二区三区| 洋洋av久久久久久久一区| 日本强好片久久久久久aaa| 国产一区二区三区四| 色94色欧美sute亚洲13| 51精品国自产在线| 国产午夜精品一区二区三区四区 | 国产精品18久久久久久久久久久久| 国产成人日日夜夜| 91国产免费观看| 久久久久久久久久久黄色| 亚洲女厕所小便bbb| 美女久久久精品| 成人av免费网站| 欧美一区二区在线播放| 中文字幕一区二区5566日韩| 日韩高清在线观看| 91在线视频免费观看| 91精品国产综合久久久久久漫画| 欧美国产日韩在线观看| 丝袜诱惑亚洲看片| 91在线精品秘密一区二区| 制服丝袜日韩国产| 亚洲免费看黄网站| 国产精品18久久久久久vr| 51精品秘密在线观看| 亚洲精品视频在线观看免费| 国产精品99久久久久久久vr| 欧美日韩国产综合一区二区| 最新热久久免费视频| 久久精品国产77777蜜臀| 在线免费一区三区| 国产精品少妇自拍| 国产精品白丝jk黑袜喷水| 制服丝袜亚洲色图| 污片在线观看一区二区| 在线精品国精品国产尤物884a| 国产精品欧美一区二区三区| 精品一区二区三区在线播放视频 | 久久免费视频一区| 美女视频一区二区三区| 91麻豆精品国产91久久久更新时间| 最新欧美精品一区二区三区| av在线播放成人| 国产女人18水真多18精品一级做 | 久久影院午夜论| 青青草国产精品97视觉盛宴| 欧美视频一区二区在线观看| 亚洲综合在线免费观看| av午夜一区麻豆| 日韩理论片一区二区| 成人av第一页| 亚洲免费观看视频| 在线视频观看一区| 婷婷综合五月天| 制服丝袜亚洲精品中文字幕| 三级一区在线视频先锋| 韩国视频一区二区| 国产女主播视频一区二区| 国产乱子轮精品视频| 欧美第一区第二区| 狠狠色丁香九九婷婷综合五月| 精品国产乱码久久久久久老虎 | 久久97超碰国产精品超碰| 91精品福利在线一区二区三区| 亚洲sss视频在线视频| 91麻豆精品国产91久久久久| 久久99国内精品| 国产午夜亚洲精品理论片色戒 | 中文成人av在线| 91美女片黄在线| 亚洲成人在线观看视频| 日韩免费高清视频| 成人三级伦理片| 一区二区三区日本| 精品日韩一区二区| 99国产一区二区三精品乱码| 一二三区精品福利视频| 欧美一级xxx| 成人av动漫在线| 偷拍与自拍一区| 国产日韩三级在线| 欧美色网一区二区| 久久99国产精品久久| 亚洲欧美色图小说| 日韩欧美一级精品久久| 91玉足脚交白嫩脚丫在线播放| 亚洲成人综合视频| 欧美高清在线一区| 91精品国产免费| 91视视频在线直接观看在线看网页在线看| 依依成人精品视频| 精品999在线播放| 欧亚洲嫩模精品一区三区| 国产呦萝稀缺另类资源| 亚洲欧美日韩久久| 久久伊人蜜桃av一区二区| 色94色欧美sute亚洲线路二| 国产毛片精品一区| 日韩电影一二三区| 一区二区三区四区高清精品免费观看 | 欧美曰成人黄网| 国产福利视频一区二区三区| 亚洲福利视频一区| 中文字幕日本不卡| 久久嫩草精品久久久久| 91精品国产综合久久久久久 | 午夜视频在线观看一区二区| 久久精品视频免费| 欧美一区二区三区在线电影| 色婷婷av一区二区三区大白胸| 国产一区 二区 三区一级| 日韩精品高清不卡| 亚洲主播在线观看| 最新不卡av在线| 中文字幕一区三区| 中文字幕中文字幕一区| 久久精品夜夜夜夜久久| 日韩精品中文字幕一区二区三区| 欧美日韩一区二区在线观看 | 久久久精品免费观看| 欧美日韩一区二区三区不卡| 91影院在线免费观看| 成人不卡免费av| 成人午夜av影视| 不卡的av电影| 波波电影院一区二区三区| 国产91精品露脸国语对白| 国产成人综合在线播放| 国产一区欧美一区| 国产精品亚洲一区二区三区妖精 | 成人在线视频一区| 国产suv一区二区三区88区| 久久99精品国产91久久来源| 精品午夜久久福利影院| 国产激情偷乱视频一区二区三区 | 亚洲国产成人91porn| 一区二区三区日本| 婷婷久久综合九色国产成人| 日韩高清一级片| 精东粉嫩av免费一区二区三区| 久久国产视频网| 国产精一区二区三区| 99久久精品国产观看| 欧洲亚洲精品在线| 777午夜精品免费视频| 欧美大片日本大片免费观看| 久久亚洲一级片| 国产精品萝li| 亚洲第一搞黄网站| 韩国欧美国产一区| 99精品国产视频| 91精品国产黑色紧身裤美女| 精品福利在线导航| 亚洲私人影院在线观看| 天天综合日日夜夜精品| 久草热8精品视频在线观看| 高清不卡在线观看| 欧美视频三区在线播放| 久久综合久久综合久久综合| 日韩一区在线看| 视频一区二区中文字幕| 成人免费毛片嘿嘿连载视频| 精品视频在线视频| 国产欧美日韩激情| 天天色综合天天| 波多野结衣亚洲一区| 91精品国产综合久久婷婷香蕉| 国产欧美日韩在线看| 污片在线观看一区二区| 99精品视频一区二区三区| 日韩欧美亚洲另类制服综合在线 | 色综合久久中文字幕| 精品国产一区二区三区av性色|