1 /* ========================================================================
2  * Copyright 1988-2006 University of Washington
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *
11  * ========================================================================
12  */
13 
14 /*
15  * Program:	Winsock TCP/IP routines
16  *
17  * Author:	Mike Seibel from Unix version by Mark Crispin
18  *		Computing & Communications
19  *		University of Washington
20  *		Administration Building, AG-44
21  *		Seattle, WA  98195
22  *		Internet: MRC@CAC.Washington.EDU
23  *
24  * Date:	11 April 1989
25  * Last Edited:	30 August 2006
26  */
27 
28 /* TCP input buffer -- must be large enough to prevent overflow */
29 
30 #define BUFLEN 16384		/* 32768 causes stdin read() to barf */
31 
32 #include <windows.h>
33 #define _INC_WINDOWS
34 #include <winsock.h>
35 
36 
37 /* TCP I/O stream (must be before osdep.h is included) */
38 
39 #define TCPSTREAM struct tcp_stream
40 TCPSTREAM {
41   char *host;			/* host name */
42   char *remotehost;		/* remote host name */
43   unsigned long port;		/* port number */
44   char *localhost;		/* local host name */
45   SOCKET tcpsi;			/* tcp socket */
46   SOCKET tcpso;			/* tcp socket */
47   long ictr;			/* input counter */
48   char *iptr;			/* input pointer */
49   char ibuf[BUFLEN];		/* input buffer */
50 };
51