home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / MacTCP Library 1.1 / Library / LowLevel ƒ / Headers ƒ / Socks.h < prev   
Encoding:
C/C++ Source or Header  |  1995-12-05  |  2.8 KB  |  114 lines  |  [TEXT/SPM ]

  1. /*
  2.     Socks.h
  3.     
  4.     Header file for the Socks.c file, also defines the API for accessing the Socks
  5.     library routines.
  6.     
  7. */
  8.  
  9. #pragma once
  10.  
  11. #ifndef __H_Socks__
  12. #define __H_Socks__
  13.  
  14. #include <MyTCPIncludes.h>
  15.  
  16. enum {
  17.     socksInvalStream=-24010,
  18.     socksConnFail,
  19.     socksConnRefused,
  20.     socksNoIdentd,
  21.     socksBadID
  22. };
  23.  
  24. // Current supported SOCKS protocol version
  25. #define SOCKS_VERSION            4
  26.  
  27. // Response commands/codes
  28. #define SOCKS_ACTIVE_OPEN        1
  29. #define SOCKS_PASSIVE_OPEN        2
  30. #define SOCKS_RESULT            90
  31. #define SOCKS_FAIL                91
  32. #define SOCKS_NO_IDENTD        92    /* Failed to connect to Identd on client machine */
  33. #define SOCKS_BAD_ID            93    /* Client's Identd reported a different user-id */
  34.  
  35. #if defined(powerc) || defined(__powerc)
  36. #pragma options align=mac68k
  37. #endif
  38. struct SOCKSOpenPB {
  39.     SInt8                            ulpTimeoutValue;
  40.     SInt8                            ulpTimeoutAction;
  41.     SInt8                            validityFlags;
  42.     SInt8                            commandTimeoutValue;
  43.     ip_addr                            remoteHost;
  44.     tcp_port                            remotePort;
  45.     ip_addr                            localHost;
  46.     tcp_port                            localPort;
  47.     SInt8                            tosFlags;
  48.     SInt8                            precedence;
  49.     Boolean                            dontFrag;
  50.     SInt8                            timeToLive;
  51.     SInt8                            security;
  52.     SInt8                            optionCnt;
  53.     SInt8                            options[40];
  54.     Ptr                                userDataPtr;
  55.     
  56.     ip_addr                            socksHost;    // addr for the socks daemon
  57.     tcp_port                            socksPort;    // port where the socks daemon lives
  58.     char*                            socksUser;    // null terminated C string with user name
  59. };
  60. typedef struct SOCKSOpenPB SOCKSOpenPB;
  61.  
  62. struct SOCKSiopb {
  63.     SInt8                            fill12[12];
  64.     TCPIOCompletionUPP                    ioCompletion;
  65.     short                            ioResult;
  66.     Ptr                                ioNamePtr;
  67.     short                            ioVRefNum;
  68.     short                            ioCRefNum;
  69.     short                            csCode;
  70.     StreamPtr                        tcpStream;
  71.     union {
  72.         struct TCPCreatePB                create;
  73.         struct SOCKSOpenPB                open;
  74.         struct TCPSendPB                    send;
  75.         struct TCPReceivePB                receive;
  76.         struct TCPClosePB                    close;
  77.         struct TCPAbortPB                    abort;
  78.         struct TCPStatusPB                status;
  79.         struct TCPGlobalInfoPB                globalInfo;
  80.     } csParam;
  81. };
  82.  
  83. typedef struct SOCKSiopb SOCKSiopb,* SOCKSiopbPtr;
  84.  
  85. #if defined(powerc) || defined(__powerc)
  86. #pragma options align=reset
  87. #endif
  88.  
  89. #ifdef __cplusplus
  90. extern "C" {
  91. #endif
  92.  
  93. OSErr SOCKS_Create(SOCKSiopb * pb,Boolean async);
  94. OSErr SOCKS_PassiveOpen(SOCKSiopb * pb,Boolean async);
  95. OSErr SOCKS_ActiveOpen(SOCKSiopb * pb,Boolean async);
  96. OSErr SOCKS_Send(SOCKSiopb * pb,Boolean async);
  97. OSErr SOCKS_NoCopyRcv(SOCKSiopb * pb,Boolean async);
  98. OSErr SOCKS_RcvBfrReturn(SOCKSiopb * pb,Boolean async);
  99. OSErr SOCKS_Rcv(SOCKSiopb * pb,Boolean async);
  100. OSErr SOCKS_Close(SOCKSiopb * pb,Boolean async);
  101. OSErr SOCKS_Abort(SOCKSiopb * pb,Boolean async);
  102. OSErr SOCKS_Status(SOCKSiopb * pb,Boolean async);
  103. OSErr SOCKS_ExtendedStat(SOCKSiopb * pb,Boolean async);
  104. OSErr SOCKS_Release(SOCKSiopb * pb,Boolean async);
  105. OSErr SOCKS_GlobalInfo(SOCKSiopb * pb,Boolean async);
  106.  
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110.  
  111. #endif /* __H_Socks__ */
  112.  
  113.  
  114.