home *** CD-ROM | disk | FTP | other *** search
- /*
- Socks.h
-
- Header file for the Socks.c file, also defines the API for accessing the Socks
- library routines.
-
- */
-
- #pragma once
-
- #ifndef __H_Socks__
- #define __H_Socks__
-
- #include <MyTCPIncludes.h>
-
- enum {
- socksInvalStream=-24010,
- socksConnFail,
- socksConnRefused,
- socksNoIdentd,
- socksBadID
- };
-
- // Current supported SOCKS protocol version
- #define SOCKS_VERSION 4
-
- // Response commands/codes
- #define SOCKS_ACTIVE_OPEN 1
- #define SOCKS_PASSIVE_OPEN 2
- #define SOCKS_RESULT 90
- #define SOCKS_FAIL 91
- #define SOCKS_NO_IDENTD 92 /* Failed to connect to Identd on client machine */
- #define SOCKS_BAD_ID 93 /* Client's Identd reported a different user-id */
-
- #if defined(powerc) || defined(__powerc)
- #pragma options align=mac68k
- #endif
- struct SOCKSOpenPB {
- SInt8 ulpTimeoutValue;
- SInt8 ulpTimeoutAction;
- SInt8 validityFlags;
- SInt8 commandTimeoutValue;
- ip_addr remoteHost;
- tcp_port remotePort;
- ip_addr localHost;
- tcp_port localPort;
- SInt8 tosFlags;
- SInt8 precedence;
- Boolean dontFrag;
- SInt8 timeToLive;
- SInt8 security;
- SInt8 optionCnt;
- SInt8 options[40];
- Ptr userDataPtr;
-
- ip_addr socksHost; // addr for the socks daemon
- tcp_port socksPort; // port where the socks daemon lives
- char* socksUser; // null terminated C string with user name
- };
- typedef struct SOCKSOpenPB SOCKSOpenPB;
-
- struct SOCKSiopb {
- SInt8 fill12[12];
- TCPIOCompletionUPP ioCompletion;
- short ioResult;
- Ptr ioNamePtr;
- short ioVRefNum;
- short ioCRefNum;
- short csCode;
- StreamPtr tcpStream;
- union {
- struct TCPCreatePB create;
- struct SOCKSOpenPB open;
- struct TCPSendPB send;
- struct TCPReceivePB receive;
- struct TCPClosePB close;
- struct TCPAbortPB abort;
- struct TCPStatusPB status;
- struct TCPGlobalInfoPB globalInfo;
- } csParam;
- };
-
- typedef struct SOCKSiopb SOCKSiopb,* SOCKSiopbPtr;
-
- #if defined(powerc) || defined(__powerc)
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- OSErr SOCKS_Create(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_PassiveOpen(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_ActiveOpen(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_Send(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_NoCopyRcv(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_RcvBfrReturn(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_Rcv(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_Close(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_Abort(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_Status(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_ExtendedStat(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_Release(SOCKSiopb * pb,Boolean async);
- OSErr SOCKS_GlobalInfo(SOCKSiopb * pb,Boolean async);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __H_Socks__ */
-
-
-