Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
5.7 KiB

  1. /********************************************************************/
  2. /** Copyright(c) 1998 Microsoft Corporation. **/
  3. /********************************************************************/
  4. //***
  5. //
  6. // Filename: rasatcp.h
  7. //
  8. // Description: Contains defines for the rasatcp component. This is really
  9. // a thin wrapper layer, so not much happens here!
  10. //
  11. // History: Feb 26, 1998 Shirish Koti Created original version.
  12. //
  13. //***
  14. #ifndef _RASATCP_H_
  15. #define _RASATCP_H_
  16. #define ARAP_DEVICE_NAME L"\\Device\\AtalkArap"
  17. #define ATCP_SIGNATURE 0x08121994
  18. #define ATCP_OPT_APPLETALK_ADDRESS 1
  19. #define ATCP_OPT_ROUTING_PROTOCOL 2
  20. #define ATCP_OPT_SUPPRESS_BROADCAST 3
  21. #define ATCP_OPT_AT_COMPRESSION_PROTOCOL 4
  22. #define ATCP_OPT_RESERVED 5
  23. #define ATCP_OPT_SERVER_INFORMATION 6
  24. #define ATCP_OPT_ZONE_INFORMATION 7
  25. #define ATCP_OPT_DEFAULT_ROUTER_ADDRESS 8
  26. // modify this value appropriately, if Apple ever defines more options
  27. #define ATCP_OPT_MAX_VAL 9
  28. #define ATCP_NOT_REQUESTED 0
  29. #define ATCP_REQ 1
  30. #define ATCP_REJ 2
  31. #define ATCP_NAK 3
  32. #define ATCP_ACK 4
  33. // the only routing option we support is no routing info
  34. #define ATCP_OPT_ROUTING_NONE 0
  35. // we define the Server-Class for "Appletalk PPP Dial-In Server"
  36. #define ATCP_SERVER_CLASS 0x001
  37. // NT5.0: Major version = 05, minor version = 0
  38. #define ATCP_SERVER_IMPLEMENTATION_ID 0x05000000
  39. #define ARAP_BIND_SIZE sizeof(PROTOCOL_CONFIG_INFO)+sizeof(ARAP_BIND_INFO)
  40. #define DDPPROTO_RTMPRESPONSEORDATA 1
  41. typedef struct _ATCPCONN
  42. {
  43. DWORD Signature;
  44. PVOID AtalkContext; // stack's context
  45. HPORT hPort;
  46. HBUNDLE hConnection;
  47. DWORD Flags;
  48. NET_ADDR ClientAddr; // what we give to the client
  49. CRITICAL_SECTION CritSect;
  50. BOOLEAN SuppressRtmp;
  51. BOOLEAN SuppressAllBcast;
  52. BOOLEAN fLineUpDone;
  53. RASMAN_ROUTEINFO RouteInfo;
  54. BOOLEAN fCritSectInitialized;
  55. } ATCPCONN, *PATCPCONN;
  56. #define ATCP_CONFIG_REQ_DONE 0x1
  57. #if DBG
  58. #define ATCP_DBGPRINT(_x) \
  59. { \
  60. DbgPrint("ATCP: "); \
  61. DbgPrint _x; \
  62. }
  63. #define ATCP_ASSERT(_x) \
  64. { \
  65. if (!(_x)) \
  66. { \
  67. DbgPrint("ATCP: Assertion failed File %s, line %ld",__FILE__, __LINE__); \
  68. DbgBreakPoint(); \
  69. } \
  70. }
  71. #define ATCP_DUMP_BYTES(_a,_b,_c) atcpDumpBytes(_a,_b,_c)
  72. #else
  73. #define ATCP_DBGPRINT(_x)
  74. #define ATCP_ASSERT(_x)
  75. #define ATCP_DUMP_BYTES(_a,_b,_c)
  76. #endif
  77. //
  78. // Global externs
  79. //
  80. extern HANDLE AtcpHandle;
  81. extern CRITICAL_SECTION AtcpCritSect;
  82. extern NET_ADDR AtcpServerAddress;
  83. extern NET_ADDR AtcpDefaultRouter;
  84. extern DWORD AtcpNumConnections;
  85. extern UCHAR AtcpServerName[NAMESTR_LEN];
  86. extern UCHAR AtcpZoneName[ZONESTR_LEN];
  87. //
  88. // prototypes from exports.c
  89. //
  90. DWORD
  91. AtcpInit(
  92. IN BOOL fInitialize
  93. );
  94. DWORD
  95. AtcpBegin(
  96. OUT PVOID *ppContext,
  97. IN PVOID pInfo
  98. );
  99. DWORD
  100. AtcpEnd(
  101. IN PVOID pContext
  102. );
  103. DWORD
  104. AtcpReset(
  105. IN PVOID pContext
  106. );
  107. DWORD
  108. AtcpThisLayerUp(
  109. IN PVOID pContext
  110. );
  111. DWORD
  112. AtcpMakeConfigRequest(
  113. IN PVOID pContext,
  114. OUT PPP_CONFIG *pSendBuf,
  115. IN DWORD cbSendBuf
  116. );
  117. DWORD
  118. AtcpMakeConfigResult(
  119. IN PVOID pContext,
  120. IN PPP_CONFIG *pReceiveBuf,
  121. OUT PPP_CONFIG *pSendBuf,
  122. IN DWORD cbSendBuf,
  123. IN BOOL fRejectNaks
  124. );
  125. DWORD
  126. AtcpConfigAckReceived(
  127. IN PVOID pContext,
  128. IN PPP_CONFIG *pReceiveBuf
  129. );
  130. DWORD
  131. AtcpConfigNakReceived(
  132. IN PVOID pContext,
  133. IN PPP_CONFIG *pReceiveBuf
  134. );
  135. DWORD
  136. AtcpConfigRejReceived(
  137. IN PVOID pContext,
  138. IN PPP_CONFIG *pReceiveBuf
  139. );
  140. DWORD
  141. AtcpGetNegotiatedInfo(
  142. IN PVOID pContext,
  143. OUT PPP_ATCP_RESULT *pAtcpResult
  144. );
  145. DWORD
  146. AtcpProjectionNotification(
  147. IN PVOID pContext,
  148. IN PVOID pProjectionResult
  149. );
  150. //
  151. // prototypes from rasatcp.c
  152. //
  153. DWORD
  154. atcpStartup(
  155. IN VOID
  156. );
  157. DWORD
  158. atcpShutdown(
  159. IN VOID
  160. );
  161. VOID
  162. atcpOpenHandle(
  163. IN VOID
  164. );
  165. DWORD
  166. atcpAtkSetup(
  167. IN PATCPCONN pAtcpConn,
  168. IN ULONG IoControlCode
  169. );
  170. VOID
  171. atcpCloseHandle(
  172. IN VOID
  173. );
  174. PATCPCONN
  175. atcpAllocConnection(
  176. IN PPPCP_INIT *pPppInit
  177. );
  178. DWORD
  179. atcpCloseAtalkConnection(
  180. IN PATCPCONN pAtcpConn
  181. );
  182. DWORD
  183. atcpParseRequest(
  184. IN PATCPCONN pAtcpConn,
  185. IN PPP_CONFIG *pReceiveBuf,
  186. OUT PPP_CONFIG *pSendBuf,
  187. IN DWORD cbSendBuf,
  188. OUT BYTE ParseResult[ATCP_OPT_MAX_VAL],
  189. OUT BOOL *pfRejectingSomething
  190. );
  191. DWORD
  192. atcpPrepareResponse(
  193. IN PATCPCONN pAtcpConn,
  194. OUT PPP_CONFIG *pSendBuf,
  195. IN DWORD cbSendBuf,
  196. OUT BYTE ParseResult[ATCP_OPT_MAX_VAL]
  197. );
  198. VOID
  199. atcpDumpBytes(
  200. IN PBYTE Str,
  201. IN PBYTE Packet,
  202. IN DWORD PacketLen
  203. );
  204. #endif // _RASIPCP_H_