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.

593 lines
13 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. atalktdi.h
  5. Abstract:
  6. This file defines the interface that will be offered to the layers of the
  7. stack
  8. Author:
  9. Nikhil Kamkolkar (NikhilK) 8-Jun-1992
  10. Revision History:
  11. --*/
  12. #ifndef _ATALKTDI_H
  13. #define _ATALKTDI_H
  14. //
  15. // The provider names supported by the Appletalk stack
  16. //
  17. #define ATALKDDP_DEVICENAME L"\\Device\\AtalkDdp"
  18. #define ATALKADSP_DEVICENAME L"\\Device\\AtalkAdsp"
  19. #define ATALKASPS_DEVICENAME L"\\Device\\AtalkAspServer"
  20. #define ATALKASPC_DEVICENAME L"\\Device\\AtalkAspClient"
  21. #define ATALKPAP_DEVICENAME L"\\Device\\AtalkPap"
  22. #define ATALKARAP_DEVICENAME L"\\Device\\AtalkArap"
  23. //
  24. // The following is passed in the TdiAction calls to reaffirm that
  25. // the request is meant for the Appletalk transport.
  26. //
  27. #define MATK (*(ULONG *)"MATK")
  28. //
  29. // Options buffer for all the calls
  30. //
  31. typedef struct _OPTIONS_CONNINF
  32. {
  33. union
  34. {
  35. int ProtocolType;
  36. TRANSPORT_ADDRESS Address;
  37. struct
  38. {
  39. TRANSPORT_ADDRESS RemoteAddress;
  40. USHORT WorkstationQuantum;
  41. USHORT ServerQuantum;
  42. } PapInfo;
  43. };
  44. } OPTIONS_CONNINF, *POPTIONS_CONNINF;
  45. #define OPTIONS_LENGTH sizeof(OPTIONS_CONNINF)
  46. typedef union
  47. {
  48. struct
  49. {
  50. USHORT Network;
  51. UCHAR Node;
  52. UCHAR Socket;
  53. };
  54. ULONG Address;
  55. } ATALK_ADDRESS, *PATALK_ADDRESS;
  56. //
  57. // ACTION CODES:
  58. // The NBP/ZIP primitives are available to all the providers. The action
  59. // codes for those are defined first. Following this are the action
  60. // codes specific to each provider. To insert a new action code, just
  61. // tag it at the end of the action codes for a particular block (common/
  62. // provider specific), and increment the max for that block.
  63. //
  64. // *IMPORTANT*
  65. // These are tightly integrated with the dispatch table for the action
  66. // routines in ATKINIT.C
  67. //
  68. #define COMMON_ACTIONBASE 0
  69. #define MIN_COMMON_ACTIONCODE (COMMON_ACTIONBASE)
  70. #define COMMON_ACTION_NBPLOOKUP (COMMON_ACTIONBASE)
  71. #define COMMON_ACTION_NBPCONFIRM (COMMON_ACTIONBASE+0x01)
  72. #define COMMON_ACTION_NBPREGISTER (COMMON_ACTIONBASE+0x02)
  73. #define COMMON_ACTION_NBPREMOVE (COMMON_ACTIONBASE+0x03)
  74. #define COMMON_ACTION_ZIPGETMYZONE (COMMON_ACTIONBASE+0x04)
  75. #define COMMON_ACTION_ZIPGETZONELIST (COMMON_ACTIONBASE+0x05)
  76. #define COMMON_ACTION_ZIPGETLZONES (COMMON_ACTIONBASE+0x06)
  77. #define COMMON_ACTION_ZIPGETLZONESONADAPTER (COMMON_ACTIONBASE+0x07)
  78. #define COMMON_ACTION_ZIPGETADAPTERDEFAULTS (COMMON_ACTIONBASE+0x08)
  79. #define COMMON_ACTION_GETSTATISTICS (COMMON_ACTIONBASE+0x09)
  80. #define MAX_COMMON_ACTIONCODE (COMMON_ACTIONBASE+0x09)
  81. #define COMMON_ACTIONCODES (MAX_COMMON_ACTIONCODE - MIN_COMMON_ACTIONCODE + 1)
  82. //
  83. // Provider specific action codes
  84. //
  85. //
  86. // DDP
  87. //
  88. // NONE
  89. //
  90. //
  91. // ADSP
  92. //
  93. #define ADSP_ACTIONBASE (MAX_COMMON_ACTIONCODE + 0x01)
  94. #define MIN_ADSPACTIONCODE (ADSP_ACTIONBASE)
  95. #define ACTION_ADSPFORWARDRESET (ADSP_ACTIONBASE)
  96. #define MAX_ADSPACTIONCODE (ADSP_ACTIONBASE)
  97. #define ADSP_SPECIFIC_ACTIONCODES (MAX_ADSPACTIONCODE - MIN_ADSPACTIONCODE + 1)
  98. //
  99. // ASP Client
  100. //
  101. #define ASPC_ACTIONBASE (MAX_ADSPACTIONCODE + 0x01)
  102. #define MIN_ASPCACTIONCODE (ATP_ACTIONBASE)
  103. #define ACTION_ASPCGETSTATUS (ASPC_ACTIONBASE)
  104. #define ACTION_ASPCCOMMAND (ASPC_ACTIONBASE+0x01)
  105. #define ACTION_ASPCWRITE (ASPC_ACTIONBASE+0x02)
  106. // The following 2 are for NBP, stole 2 slots here that were reserved
  107. #define COMMON_ACTION_NBPREGISTER_BY_ADDR (ASPC_ACTIONBASE+0x03)
  108. #define COMMON_ACTION_NBPREMOVE_BY_ADDR (ASPC_ACTIONBASE+0x04)
  109. #define ACTION_ASPCRESERVED3 (ASPC_ACTIONBASE+0x05)
  110. #define MAX_ASPCACTIONCODE (ASPC_ACTIONBASE+0x05)
  111. #define ASPC_SPECIFIC_ACTIONCODES (MAX_ASPCACTIONCODE - MIN_ASPCACTIONCODE + 1)
  112. //
  113. // ASP Server
  114. //
  115. #define ASP_ACTIONBASE (MAX_ASPCACTIONCODE + 0x01)
  116. #define MIN_ASPACTIONCODE (ASP_ACTIONBASE)
  117. #define ACTION_ASP_BIND (ASP_ACTIONBASE)
  118. #define MAX_ASPACTIONCODE (ASP_ACTIONBASE)
  119. #define ASP_SPECIFIC_ACTIONCODES (MAX_ASPACTIONCODE - MIN_ASPACTIONCODE + 1)
  120. //
  121. // PAP
  122. //
  123. #define PAP_ACTIONBASE (MAX_ASPACTIONCODE + 0x01)
  124. #define MIN_PAPACTIONCODE (PAP_ACTIONBASE)
  125. #define ACTION_PAPGETSTATUSSRV (PAP_ACTIONBASE)
  126. #define ACTION_PAPSETSTATUS (PAP_ACTIONBASE+0x01)
  127. #define ACTION_PAPPRIMEREAD (PAP_ACTIONBASE+0x02)
  128. #define MAX_PAPACTIONCODE (PAP_ACTIONBASE+0x02)
  129. #define PAP_SPECIFIC_ACTIONCODES (MAX_PAPACTIONCODE - MIN_PAPACTIONCODE + 1)
  130. #define MAX_ALLACTIONCODES (MAX_PAPACTIONCODE)
  131. //
  132. // STRUCTURE Definitions for the ACTION routines for all the providers
  133. //
  134. //
  135. // NBP Interface
  136. //
  137. //
  138. // **WARNING**
  139. // The structure WSH_NBP_NAME is defined to be exactly like this in atalkwsh.h
  140. // Change both if they ever need to be changed
  141. //
  142. #define MAX_ENTITY 32
  143. typedef struct
  144. {
  145. UCHAR ObjectNameLen;
  146. UCHAR ObjectName[MAX_ENTITY];
  147. UCHAR TypeNameLen;
  148. UCHAR TypeName[MAX_ENTITY];
  149. UCHAR ZoneNameLen;
  150. UCHAR ZoneName[MAX_ENTITY];
  151. } NBP_NAME, *PNBP_NAME;
  152. typedef struct
  153. {
  154. ATALK_ADDRESS Address;
  155. USHORT Enumerator;
  156. NBP_NAME NbpName;
  157. } NBP_TUPLE, *PNBP_TUPLE;
  158. //
  159. // NBP Lookup
  160. //
  161. typedef struct
  162. {
  163. NBP_TUPLE LookupTuple;
  164. USHORT NoTuplesRead;
  165. } NBP_LOOKUP_PARAMS, *PNBP_LOOKUP_PARAMS;
  166. typedef struct
  167. {
  168. TDI_ACTION_HEADER ActionHeader;
  169. NBP_LOOKUP_PARAMS Params;
  170. //
  171. // NBP_TUPLE NbpTuples[]
  172. //
  173. } NBP_LOOKUP_ACTION, *PNBP_LOOKUP_ACTION;
  174. //
  175. // NBP Confirm
  176. //
  177. typedef struct
  178. {
  179. NBP_TUPLE ConfirmTuple;
  180. } NBP_CONFIRM_PARAMS, *PNBP_CONFIRM_PARAMS;
  181. typedef struct
  182. {
  183. TDI_ACTION_HEADER ActionHeader;
  184. NBP_CONFIRM_PARAMS Params;
  185. } NBP_CONFIRM_ACTION, *PNBP_CONFIRM_ACTION;
  186. //
  187. // NBP Register/Deregister- Address Object
  188. // Use the following for both register/deregister on their
  189. // respective objects
  190. //
  191. typedef struct
  192. {
  193. union
  194. {
  195. NBP_TUPLE RegisterTuple;
  196. NBP_TUPLE RegisteredTuple;
  197. };
  198. } NBP_REGDEREG_PARAMS, *PNBP_REGDEREG_PARAMS;
  199. typedef struct
  200. {
  201. TDI_ACTION_HEADER ActionHeader;
  202. NBP_REGDEREG_PARAMS Params;
  203. } NBP_REGDEREG_ACTION, *PNBP_REGDEREG_ACTION;
  204. //
  205. // ZIP Interface
  206. //
  207. //
  208. // ZIP GetMyZone
  209. //
  210. typedef struct
  211. {
  212. TDI_ACTION_HEADER ActionHeader;
  213. //
  214. // CHAR ZoneName[]
  215. // Maximum of MAX_ENTITYNAME+1
  216. //
  217. } ZIP_GETMYZONE_ACTION, *PZIP_GETMYZONE_ACTION;
  218. //
  219. // ZIP GetZoneList
  220. //
  221. typedef struct
  222. {
  223. LONG ZonesAvailable;
  224. } ZIP_GETZONELIST_PARAMS, *PZIP_GETZONELIST_PARAMS;
  225. typedef struct
  226. {
  227. TDI_ACTION_HEADER ActionHeader;
  228. ZIP_GETZONELIST_PARAMS Params;
  229. //
  230. // CHAR ZoneListBuffer[];
  231. //
  232. } ZIP_GETZONELIST_ACTION, *PZIP_GETZONELIST_ACTION;
  233. //
  234. // ZIP GetLocalZones
  235. // This uses the same structure as that for the GetZoneList command
  236. //
  237. //
  238. // ZIP GetLocalZonesOnAdapter
  239. // This uses the same structure as for the GetZoneList command, with the
  240. // condition that the adapter name follows the structure as a null
  241. // terminated double-byte string. It will be overwritten upon return
  242. // by the zone names.
  243. //
  244. //
  245. // ZIP GetAdaptorDefaults (Network Range & Default Zone)
  246. //
  247. // The adapter name follows the structure as a null terminated double-byte
  248. // string. This is replaced by the zone name.
  249. typedef struct
  250. {
  251. USHORT NwRangeLowEnd;
  252. USHORT NwRangeHighEnd;
  253. } ZIP_GETPORTDEF_PARAMS, *PZIP_GETPORTDEF_PARAMS;
  254. typedef struct
  255. {
  256. TDI_ACTION_HEADER ActionHeader;
  257. ZIP_GETPORTDEF_PARAMS Params;
  258. // INPUT:
  259. // WCHAR AdaptorName
  260. // Maximum of MAX_ENTITYNAME+1
  261. //
  262. // OUTPUT:
  263. // BYTE DefZone[MAX_ENTITY+1];
  264. } ZIP_GETPORTDEF_ACTION, *PZIP_GETPORTDEF_ACTION;
  265. typedef struct
  266. {
  267. TDI_ACTION_HEADER ActionHeader;
  268. // OUTPUT:
  269. // Appletalk statistics structure
  270. } GET_STATISTICS_ACTION, *PGET_STATISTICS_ACTION;
  271. //
  272. // DDP Interface
  273. // NONE
  274. //
  275. //
  276. // ADSP Interface- specific action routines for ADSP
  277. //
  278. //
  279. // ADSP Forward Reset
  280. //
  281. typedef struct _ADSP_FORWARDRESET_ACTION
  282. {
  283. TDI_ACTION_HEADER ActionHeader;
  284. } ADSP_FORWARDRESET_ACTION, *PADSP_FORWARDRESET_ACTION;
  285. //
  286. // ASP Client Interface- specific action routines for ASP Client
  287. //
  288. //
  289. // ASP GetStatus
  290. //
  291. typedef struct
  292. {
  293. TA_APPLETALK_ADDRESS ServerAddr;
  294. } ASPC_GETSTATUS_PARAMS, *PASPC_GETSTATUS_PARAMS;
  295. typedef struct
  296. {
  297. TDI_ACTION_HEADER ActionHeader;
  298. ASPC_GETSTATUS_PARAMS Params;
  299. } ASPC_GETSTATUS_ACTION, *PASPC_GETSTATUS_ACTION;
  300. //
  301. // ASP Command or Write
  302. //
  303. typedef struct
  304. {
  305. USHORT CmdSize;
  306. USHORT WriteAndReplySize;
  307. // BYTE CmdBuff[CmdSize];
  308. // BYTE WriteAndReplyBuf[ReplySize];
  309. } ASPC_COMMAND_OR_WRITE_PARAMS, *PASPC_COMMAND_OR_WRITE_PARAMS;
  310. typedef struct
  311. {
  312. TDI_ACTION_HEADER ActionHeader;
  313. ASPC_COMMAND_OR_WRITE_PARAMS Params;
  314. } ASPC_COMMAND_OR_WRITE_ACTION, *PASPC_COMMAND_OR_WRITE_ACTION;
  315. typedef struct
  316. {
  317. TDI_ACTION_HEADER ActionHeader;
  318. } ASPC_RESERVED_ACTION, *PASPC_RESERVED_ACTION;
  319. //
  320. // ASP Server Interface- action routines specific to ASP Server
  321. //
  322. typedef PVOID CONNCTXT;
  323. typedef struct
  324. {
  325. PUCHAR rq_RequestBuf;
  326. LONG rq_RequestSize;
  327. union
  328. {
  329. PMDL rq_WriteMdl;
  330. PMDL rq_ReplyMdl;
  331. };
  332. PVOID rq_CacheMgrContext;
  333. } REQUEST, *PREQUEST;
  334. typedef VOID (FASTCALL *CLIENT_CLOSE_COMPLETION)(
  335. IN NTSTATUS Status,
  336. IN PVOID pCloseCtxt);
  337. typedef VOID (FASTCALL *CLIENT_REPLY_COMPLETION)(
  338. IN NTSTATUS Status,
  339. IN PVOID pReplyCtxt,
  340. IN PREQUEST Request);
  341. // Returns context to associate for this session
  342. typedef CONNCTXT (FASTCALL *CLIENT_SESSION_NOTIFY)(
  343. IN PVOID pConnection,
  344. IN BOOLEAN fOverTcp);
  345. typedef NTSTATUS (FASTCALL *CLIENT_REQUEST_NOTIFY)(
  346. IN NTSTATUS Status,
  347. IN PVOID ConnCtxt,
  348. IN PREQUEST Request);
  349. // Returns MDL describing the buffer
  350. typedef NTSTATUS (FASTCALL *CLIENT_GET_WRITEBUFFER)(
  351. IN PVOID pSda,
  352. IN PREQUEST pRequest);
  353. typedef VOID (FASTCALL *CLIENT_ATTN_COMPLETION)(
  354. IN PVOID pContext);
  355. typedef NTSTATUS (*ASP_CLOSE_CONN)(
  356. IN PVOID pConnection);
  357. typedef NTSTATUS (*ASP_FREE_CONN)(
  358. IN PVOID pConnection);
  359. typedef NTSTATUS (FASTCALL *ASP_LISTEN_CONTROL)( // Synchronous
  360. IN PVOID pAspCtxt,
  361. IN BOOLEAN Active);
  362. typedef NTSTATUS (*ASP_SET_STATUS)( // Synchronous
  363. IN PVOID pAspCtxt,
  364. IN PUCHAR pStatus,
  365. IN USHORT StatusSize);
  366. typedef NTSTATUS (FASTCALL *ASP_WRITE_CONTINUE)(
  367. IN PVOID PREQUEST);
  368. typedef NTSTATUS (FASTCALL *ASP_REPLY)(
  369. IN PREQUEST pRequest,
  370. IN PUCHAR ResultCode);
  371. typedef NTSTATUS (*ASP_SEND_ATTENTION)(
  372. IN PVOID pConnection,
  373. IN USHORT AttentionCode,
  374. IN PVOID pContext);
  375. typedef struct
  376. {
  377. CLIENT_SESSION_NOTIFY clt_SessionNotify; // When a new session is established
  378. CLIENT_REQUEST_NOTIFY clt_RequestNotify; // When a new request comes in
  379. // Also on remote closes
  380. CLIENT_GET_WRITEBUFFER clt_GetWriteBuffer; // For ASP Write command.
  381. CLIENT_REPLY_COMPLETION clt_ReplyCompletion; // Completion routine for a reply
  382. CLIENT_ATTN_COMPLETION clt_AttnCompletion; // Completion routine for send attention
  383. CLIENT_CLOSE_COMPLETION clt_CloseCompletion; // Completion routine for a session close request
  384. } ASP_CLIENT_ENTRIES, *PASP_CLIENT_ENTRIES;
  385. typedef struct
  386. {
  387. ATALK_ADDRESS asp_AtalkAddr; // net addr of default adapter
  388. PVOID asp_AspCtxt;
  389. ASP_SET_STATUS asp_SetStatus;
  390. ASP_CLOSE_CONN asp_CloseConn;
  391. ASP_FREE_CONN asp_FreeConn;
  392. ASP_LISTEN_CONTROL asp_ListenControl;
  393. ASP_WRITE_CONTINUE asp_WriteContinue;
  394. ASP_REPLY asp_Reply;
  395. ASP_SEND_ATTENTION asp_SendAttention;
  396. } ASP_XPORT_ENTRIES, *PASP_XPORT_ENTRIES;
  397. //
  398. // ASP Exchange entries
  399. //
  400. typedef struct
  401. {
  402. PASP_XPORT_ENTRIES pXportEntries;
  403. ASP_CLIENT_ENTRIES ClientEntries;
  404. } ASP_BIND_PARAMS, *PASP_BIND_PARAMS;
  405. typedef struct
  406. {
  407. TDI_ACTION_HEADER ActionHeader;
  408. ASP_BIND_PARAMS Params;
  409. } ASP_BIND_ACTION, *PASP_BIND_ACTION;
  410. //
  411. // PAP Interface
  412. //
  413. //
  414. // PAP GetStatus Using Server Address
  415. //
  416. typedef struct
  417. {
  418. TA_APPLETALK_ADDRESS ServerAddr;
  419. } PAP_GETSTATUSSRV_PARAMS, *PPAP_GETSTATUSSRV_PARAMS;
  420. typedef struct
  421. {
  422. TDI_ACTION_HEADER ActionHeader;
  423. PAP_GETSTATUSSRV_PARAMS Params;
  424. } PAP_GETSTATUSSRV_ACTION, *PPAP_GETSTATUSSRV_ACTION;
  425. //
  426. // PAP SetStatus
  427. //
  428. typedef struct
  429. {
  430. TDI_ACTION_HEADER ActionHeader;
  431. } PAP_SETSTATUS_ACTION, *PPAP_SETSTATUS_ACTION;
  432. //
  433. // PAP PrimeRead
  434. //
  435. typedef struct
  436. {
  437. TDI_ACTION_HEADER ActionHeader;
  438. } PAP_PRIMEREAD_ACTION, *PPAP_PRIMEREAD_ACTION;
  439. #else
  440. ;
  441. #endif
  442.