Source code of Windows XP (NT5)
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.

254 lines
5.3 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. } ATCPCONN, *PATCPCONN;
  55. #define ATCP_CONFIG_REQ_DONE 0x1
  56. #if DBG
  57. #define ATCP_DBGPRINT(_x) \
  58. { \
  59. DbgPrint("ATCP: "); \
  60. DbgPrint _x; \
  61. }
  62. #define ATCP_ASSERT(_x) \
  63. { \
  64. if (!(_x)) \
  65. { \
  66. DbgPrint("ATCP: Assertion failed File %s, line %ld",__FILE__, __LINE__); \
  67. DbgBreakPoint(); \
  68. } \
  69. }
  70. #define ATCP_DUMP_BYTES(_a,_b,_c) atcpDumpBytes(_a,_b,_c)
  71. #else
  72. #define ATCP_DBGPRINT(_x)
  73. #define ATCP_ASSERT(_x)
  74. #define ATCP_DUMP_BYTES(_a,_b,_c)
  75. #endif
  76. //
  77. // Global externs
  78. //
  79. extern HANDLE AtcpHandle;
  80. extern CRITICAL_SECTION AtcpCritSect;
  81. extern NET_ADDR AtcpServerAddress;
  82. extern NET_ADDR AtcpDefaultRouter;
  83. extern DWORD AtcpNumConnections;
  84. extern UCHAR AtcpServerName[NAMESTR_LEN];
  85. extern UCHAR AtcpZoneName[ZONESTR_LEN];
  86. //
  87. // prototypes from exports.c
  88. //
  89. DWORD
  90. AtcpInit(
  91. IN BOOL fInitialize
  92. );
  93. DWORD
  94. AtcpBegin(
  95. OUT PVOID *ppContext,
  96. IN PVOID pInfo
  97. );
  98. DWORD
  99. AtcpEnd(
  100. IN PVOID pContext
  101. );
  102. DWORD
  103. AtcpReset(
  104. IN PVOID pContext
  105. );
  106. DWORD
  107. AtcpThisLayerUp(
  108. IN PVOID pContext
  109. );
  110. DWORD
  111. AtcpMakeConfigRequest(
  112. IN PVOID pContext,
  113. OUT PPP_CONFIG *pSendBuf,
  114. IN DWORD cbSendBuf
  115. );
  116. DWORD
  117. AtcpMakeConfigResult(
  118. IN PVOID pContext,
  119. IN PPP_CONFIG *pReceiveBuf,
  120. OUT PPP_CONFIG *pSendBuf,
  121. IN DWORD cbSendBuf,
  122. IN BOOL fRejectNaks
  123. );
  124. DWORD
  125. AtcpConfigAckReceived(
  126. IN PVOID pContext,
  127. IN PPP_CONFIG *pReceiveBuf
  128. );
  129. DWORD
  130. AtcpConfigNakReceived(
  131. IN PVOID pContext,
  132. IN PPP_CONFIG *pReceiveBuf
  133. );
  134. DWORD
  135. AtcpConfigRejReceived(
  136. IN PVOID pContext,
  137. IN PPP_CONFIG *pReceiveBuf
  138. );
  139. DWORD
  140. AtcpGetNegotiatedInfo(
  141. IN PVOID pContext,
  142. OUT PPP_ATCP_RESULT *pAtcpResult
  143. );
  144. DWORD
  145. AtcpProjectionNotification(
  146. IN PVOID pContext,
  147. IN PVOID pProjectionResult
  148. );
  149. //
  150. // prototypes from rasatcp.c
  151. //
  152. DWORD
  153. atcpStartup(
  154. IN VOID
  155. );
  156. VOID
  157. atcpOpenHandle(
  158. IN VOID
  159. );
  160. DWORD
  161. atcpAtkSetup(
  162. IN PATCPCONN pAtcpConn,
  163. IN ULONG IoControlCode
  164. );
  165. VOID
  166. atcpCloseHandle(
  167. IN VOID
  168. );
  169. PATCPCONN
  170. atcpAllocConnection(
  171. IN PPPCP_INIT *pPppInit
  172. );
  173. DWORD
  174. atcpCloseAtalkConnection(
  175. IN PATCPCONN pAtcpConn
  176. );
  177. DWORD
  178. atcpParseRequest(
  179. IN PATCPCONN pAtcpConn,
  180. IN PPP_CONFIG *pReceiveBuf,
  181. OUT PPP_CONFIG *pSendBuf,
  182. IN DWORD cbSendBuf,
  183. OUT BYTE ParseResult[ATCP_OPT_MAX_VAL],
  184. OUT BOOL *pfRejectingSomething
  185. );
  186. DWORD
  187. atcpPrepareResponse(
  188. IN PATCPCONN pAtcpConn,
  189. OUT PPP_CONFIG *pSendBuf,
  190. IN DWORD cbSendBuf,
  191. OUT BYTE ParseResult[ATCP_OPT_MAX_VAL]
  192. );
  193. VOID
  194. atcpDumpBytes(
  195. IN PBYTE Str,
  196. IN PBYTE Packet,
  197. IN DWORD PacketLen
  198. );
  199. #endif // _RASIPCP_H_
  200.