1 /* 2 ** 3 ** Classification: UNCLASSIFIED 4 ** 5 ** Copyright: (c) Copyright 1995 IBM Corporation 6 ** This program is protected by the copyright law as an 7 ** unpublished work. 8 ** 9 ** RCS Info: $Date: 1995/11/27 15:27:46 $ $Revision: 1.1 $ 10 ** 11 ** $Id: Header.h,v 1.1 1995/11/27 15:27:46 baseline Exp $ 12 ** 13 ** Filename: $Source: /Minerva/testing/minerva/src/templates/RCS/Header.h,v $ 14 ** 15 ** Originator: Craig Knudsen 16 ** t/l 335-6068 17 ** knudsen@dev.infomkt.ibm.com 18 ** 19 ** Organization: IBM Corporation / infoMarket 20 ** 3190 Fairview Park Drive 21 ** Falls Church, VA 22042 22 ** Ph: (703)205-5600 FAX: (703)205-5691 23 ** 24 ** Description: 25 ** 26 ** NewsTicker include file. 27 ** Include file for using tcpt routines. 28 ** Attempt to resolve some of the issues with dealing with 29 ** winsock. See tcpt.c for more info on usage. 30 ** Define sockfd to be an int on UNIX and SOCKET on Win32. 31 ** 32 ** Limitations: 33 ** 34 ** 1. None. 35 ** 36 ** Modification History: 37 ** 38 ** 12-Mar-96 cek Created 39 ** 40 ******************************************************************************/ 41 42 #ifndef _TCPT_H 43 #define _TCPT_H 44 45 /* 46 ** Define some handy definitions. 47 */ 48 #ifdef WIN32 49 #define sockfd SOCKET 50 #else 51 #define closesocket close 52 #define sockfd int 53 #endif 54 55 /* 56 ** Error values 57 */ 58 typedef enum { 59 TCPT_NO_ERROR = 0, 60 TCPT_INIT_ERROR = 1, 61 TCPT_SOCKET_ERROR = 2, 62 TCPT_CONNECT_ERROR = 3, 63 TCPT_SOCKS_CONNECT_ERROR = 4, 64 TCPT_SOCKS_CONNECT_REFUSED = 5, 65 TCPT_INVALID_SOCKS_HOST = 6, 66 TCPT_SOCKS_CONNECT_TIMEOUT = 7, 67 TCPT_SOCKS_CONNECTION_REFUSED = 8, 68 TCPT_CONNECTION_REFUSED = 9 69 } tcptError; 70 71 72 /* 73 ** tcptErrorString - Translate a tcptError into a text string. 74 */ 75 char *tcptErrorString ( 76 #ifndef _NO_PROTO 77 tcptError error_num 78 #endif 79 ); 80 81 /* 82 ** tcptInit - Initialize the TCP/IP stack. Not needed in UNIX. 83 */ 84 tcptError tcptInit (); 85 86 /* 87 ** tcptConnect - Connect a TCP/IP socket. Uses SOCKS if enabled. 88 */ 89 /*tcptError tcptConnect ( int sock, struct sockaddr *server, int size );*/ 90 91 /* 92 ** tcptCleanup - Shutdown the TCP/IP stack. Does nothing in UNIX. 93 */ 94 tcptError tcptCleanup (); 95 96 /* 97 ** tcptEnableSocks - Enable the SOCKS server 98 */ 99 tcptError tcptEnableSocks ( 100 #ifndef _NO_PROTO 101 char *server, int port 102 #endif 103 ); 104 105 /* 106 ** tcptDisableSocks - Disable the SOCKS server 107 */ 108 tcptError tcptDisableSocks (); 109 110 #endif /* _TCPT_H */ 111