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.

720 lines
21 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. D:\nt\private\ntos\tdi\rawwan\core\nltdata.h
  5. Abstract:
  6. All private data structure definitions for Null Transport.
  7. Revision History:
  8. Who When What
  9. -------- -------- ----------------------------------------------
  10. arvindm 04-17-97 Created
  11. Notes:
  12. --*/
  13. #ifndef __TDI_RWANDATA__H
  14. #define __TDI_RWANDATA__H
  15. //
  16. // Forward definitions
  17. //
  18. struct _RWAN_TDI_CONNECTION ;
  19. struct _RWAN_TDI_ADDRESS ;
  20. struct _RWAN_NDIS_VC ;
  21. struct _RWAN_NDIS_SAP ;
  22. struct _RWAN_NDIS_AF ;
  23. struct _RWAN_NDIS_AF_INFO ;
  24. struct _RWAN_TDI_PROTOCOL ;
  25. struct _RWAN_CONN_REQUEST ;
  26. struct _RWAN_RECEIVE_INDICATION ;
  27. typedef UCHAR RWAN_CONN_INSTANCE;
  28. typedef ULONG RWAN_CONN_ID;
  29. //
  30. // Completion routines.
  31. //
  32. typedef
  33. VOID
  34. (*PCOMPLETE_RTN)(PVOID CompletionContext, UINT, UINT);
  35. typedef
  36. VOID
  37. (*PDATA_COMPLETE_RTN)(PVOID CompletionContext, UINT Status, UINT ByteCount);
  38. typedef
  39. VOID
  40. (*PDELETE_COMPLETE_RTN)(PVOID CompletionContext);
  41. //
  42. // A structure to hold a call-back routine and context to
  43. // be called when a structure is dereferenced away.
  44. //
  45. typedef struct _RWAN_DELETE_NOTIFY
  46. {
  47. PCOMPLETE_RTN pDeleteRtn;
  48. PVOID DeleteContext;
  49. } RWAN_DELETE_NOTIFY, *PRWAN_DELETE_NOTIFY;
  50. //
  51. // ***** TDI Connection Object *****
  52. //
  53. // Our context for a TDI Connection Object. This is created during
  54. // TdiOpenConnection(), and deleted during TdiCloseConnection().
  55. //
  56. // Reference Count keeps track of:
  57. // - TdiOpenConnection
  58. // - Linkage to Address Object
  59. // - Linkage to NDIS VC or NDIS Party
  60. // - Each party in list on VC (for C-Root)
  61. // - Each work item queued for this Conn Object
  62. //
  63. typedef struct _RWAN_TDI_CONNECTION
  64. {
  65. #if DBG
  66. ULONG ntc_sig;
  67. #endif
  68. INT RefCount;
  69. USHORT State;
  70. USHORT Flags; // Pending events etc
  71. PVOID ConnectionHandle; // TDI handle
  72. struct _RWAN_TDI_ADDRESS * pAddrObject; // Associated Address Object
  73. LIST_ENTRY ConnLink; // In list of connections on
  74. // address object
  75. RWAN_HANDLE AfSpConnContext; // Media-Sp module's context
  76. RWAN_LOCK Lock; // Mutex
  77. union {
  78. struct _RWAN_NDIS_VC * pNdisVc;
  79. struct _RWAN_NDIS_PARTY *pNdisParty;
  80. } NdisConnection;
  81. struct _RWAN_TDI_CONNECTION * pRootConnObject; // For PMP Calls
  82. RWAN_CONN_INSTANCE ConnInstance; // Used to validate Conn Context
  83. RWAN_DELETE_NOTIFY DeleteNotify; // Things to do on freeing this
  84. struct _RWAN_CONN_REQUEST * pConnReq; // Info about a pended TDI request
  85. NDIS_WORK_ITEM CloseWorkItem; // Used to schedule a Close
  86. struct _RWAN_NDIS_VC * pNdisVcSave;
  87. #if DBG
  88. ULONG ntcd_sig;
  89. USHORT OldState;
  90. USHORT OldFlags;
  91. #endif
  92. } RWAN_TDI_CONNECTION, *PRWAN_TDI_CONNECTION;
  93. #if DBG
  94. #define ntc_signature 'cTwR'
  95. #endif // DBG
  96. #define NULL_PRWAN_TDI_CONNECTION ((PRWAN_TDI_CONNECTION)NULL)
  97. //
  98. // TDI Connection Object states
  99. //
  100. #define RWANS_CO_CREATED 0x0000 // After TdiOpenConnection
  101. #define RWANS_CO_ASSOCIATED 0x0001 // After TdiAssociateAddress
  102. #define RWANS_CO_LISTENING 0x0002 // After TdiListen
  103. #define RWANS_CO_OUT_CALL_INITIATED 0x0003 // TdiConnect in progress
  104. #define RWANS_CO_IN_CALL_INDICATED 0x0004 // Incoming call indicated to user
  105. #define RWANS_CO_IN_CALL_ACCEPTING 0x0005 // TdiAccept in progress
  106. #define RWANS_CO_CONNECTED 0x0006 // Connection established
  107. #define RWANS_CO_DISCON_INDICATED 0x0007 // Incoming release indicated to user
  108. #define RWANS_CO_DISCON_HELD 0x0008 // Incoming release not indicated to user
  109. #define RWANS_CO_DISCON_REQUESTED 0x0009 // TdiDisconnect in progress
  110. #define RWANS_CO_ABORTING 0x000A // Aborting
  111. //
  112. // TDI Connection Object flags
  113. //
  114. #define RWANF_CO_LEAF 0x0001 // This is a PMP leaf conn object
  115. #define RWANF_CO_ROOT 0x0002 // This is a PMP root conn object
  116. #define RWANF_CO_INDICATING_DATA 0x0010 // Receive processing going on
  117. #define RWANF_CO_PAUSE_RECEIVE 0x0020 // The TDI Client has paused receiving
  118. #define RWANF_CO_AFSP_CONTEXT_VALID 0x0040 // AfSpConnContext is valid
  119. #define RWANF_CO_PENDED_DISCON 0x0100 // Pended a DisconInd until data ind is over
  120. #define RWANF_CO_CLOSE_SCHEDULED 0x4000 // Scheduled work item for Closing
  121. #define RWANF_CO_CLOSING 0x8000 // TdiCloseConnection in progress
  122. //
  123. // ***** TDI Address Object *****
  124. //
  125. // This is created on processing TdiOpenAddress, and deleted during
  126. // TdiCloseAddress. If this is a non-NULL (i.e. listening) address object,
  127. // we also register NDIS SAPs on all adapters supporting this address
  128. // family.
  129. //
  130. // Reference Count keeps track of:
  131. // - TdiOpenAddress
  132. // - Each Connection Object associated with this
  133. // - Each NDIS SAP registered for this
  134. //
  135. typedef struct _RWAN_TDI_ADDRESS
  136. {
  137. #if DBG
  138. ULONG nta_sig;
  139. #endif // DBG
  140. INT RefCount;
  141. USHORT State;
  142. USHORT Flags; // Pending events etc
  143. struct _RWAN_TDI_PROTOCOL * pProtocol; // Back ptr to protocol
  144. RWAN_HANDLE AfSpAddrContext; // Media-Sp module's context
  145. struct _RWAN_TDI_CONNECTION * pRootConnObject; // For PMP Calls
  146. LIST_ENTRY AddrLink; // In list of Address Objects
  147. LIST_ENTRY IdleConnList; // After TDI_ASSOCIATE_ADDRESS
  148. LIST_ENTRY ListenConnList; // After TDI_LISTEN
  149. LIST_ENTRY ActiveConnList; // After connection setup
  150. LIST_ENTRY SapList; // List of RWAN_NDIS_SAP structs
  151. RWAN_EVENT Event; // Used for synchronization
  152. RWAN_LOCK Lock; // Mutex
  153. RWAN_DELETE_NOTIFY DeleteNotify; // Things to do on freeing this
  154. PConnectEvent pConnInd; // Connect Indication up-call
  155. PVOID ConnIndContext; // Context for Connect
  156. PDisconnectEvent pDisconInd; // Disconnect Indication up-call
  157. PVOID DisconIndContext; // Context for Disconnect
  158. PErrorEvent pErrorInd; // Error Indication up-call
  159. PVOID ErrorIndContext; // Context for Error
  160. PRcvEvent pRcvInd; // Receive Indication up-call
  161. PVOID RcvIndContext; // Context for Receive
  162. USHORT AddressType; // From TdiOpenAddress
  163. USHORT AddressLength; // From TdiOpenAddress
  164. PVOID pAddress; // Protocol-dependent string
  165. NDIS_STATUS SapStatus; // Failure from RegisterSap
  166. } RWAN_TDI_ADDRESS, *PRWAN_TDI_ADDRESS;
  167. #if DBG
  168. #define nta_signature 'aTwR'
  169. #endif // DBG
  170. #define NULL_PRWAN_TDI_ADDRESS ((PRWAN_TDI_ADDRESS)NULL)
  171. //
  172. // Bit definitions for Flags in RWAN_TDI_ADDRESS
  173. //
  174. #define RWANF_AO_PMP_ROOT 0x0001 // Root of an outgoing PMP call
  175. #define RWANF_AO_CLOSING 0x8000 // TdiCloseAddress() in progress
  176. #define RWANF_AO_AFSP_CONTEXT_VALID 0x0040 // AfSpAddrContext is valid
  177. //
  178. // ***** NDIS VC Block *****
  179. //
  180. // Created during a CoCreateVc operation, and contains our context for
  181. // an NDIS VC. For an outgoing call, creation is initiated by us, by
  182. // calling NdisCoCreateVc. For an incoming call, the Call Manager initiates
  183. // VC creation.
  184. //
  185. typedef struct _RWAN_NDIS_VC
  186. {
  187. #if DBG
  188. ULONG nvc_sig;
  189. #endif
  190. USHORT State;
  191. USHORT Flags; // Pending events etc
  192. NDIS_HANDLE NdisVcHandle; // For all NDIS calls
  193. struct _RWAN_TDI_CONNECTION * pConnObject; // To Connection Object
  194. PCO_CALL_PARAMETERS pCallParameters; // Call setup parameters
  195. struct _RWAN_NDIS_AF * pNdisAf; // Back pointer
  196. struct _RWAN_NDIS_PARTY * pPartyMakeCall; // First party in PMP call
  197. LIST_ENTRY VcLink; // In list of all VCs on AF
  198. LIST_ENTRY NdisPartyList; // List of NDIS Party (PMP only)
  199. ULONG AddingPartyCount; // Pending NdisClAddParty/MakeCall
  200. ULONG ActivePartyCount; // Connected parties
  201. ULONG DroppingPartyCount; // Pending NdisClDropParty
  202. ULONG PendingPacketCount; // Pending send+rcv packets
  203. ULONG MaxSendSize;
  204. struct _RWAN_RECEIVE_INDICATION *pRcvIndHead; // Head of the receive ind queue
  205. struct _RWAN_RECEIVE_INDICATION *pRcvIndTail; // Tail of the receive ind queue
  206. struct _RWAN_RECEIVE_REQUEST * pRcvReqHead; // Head of the receive req queue
  207. struct _RWAN_RECEIVE_REQUEST * pRcvReqTail; // Tail of the receive req queue
  208. #if DBG_LOG_PACKETS
  209. ULONG DataLogSig;
  210. ULONG Index;
  211. struct _RWAND_DATA_LOG_ENTRY DataLog[MAX_RWAND_PKT_LOG];
  212. #endif
  213. } RWAN_NDIS_VC, *PRWAN_NDIS_VC;
  214. #if DBG
  215. #define nvc_signature 'cVwR'
  216. #endif // DBG
  217. #define NULL_PRWAN_NDIS_VC ((PRWAN_NDIS_VC)NULL)
  218. //
  219. // NDIS VC flags
  220. //
  221. #define RWANF_VC_OUTGOING 0x0001 // Created by us.
  222. #define RWANF_VC_PMP 0x0002 // Point to Multipoint call
  223. #define RWANF_VC_CLOSING_CALL 0x8000 // NdisClCloseCall in progress
  224. #define RWANF_VC_NEEDS_CLOSE 0x4000 // Waiting for conditions to be right
  225. // for NdisClCloseCall
  226. //
  227. // Various events seen on the VC
  228. //
  229. #define RWANF_VC_EVT_MAKECALL_OK 0x0010
  230. #define RWANF_VC_EVT_MAKECALL_FAIL 0x0020
  231. #define RWANF_VC_EVT_INCALL 0x0040
  232. #define RWANF_VC_EVT_CALLCONN 0x0080
  233. #define RWANF_VC_EVT_INCLOSE 0x0100
  234. #define RWANF_VC_EVT_CLOSECOMP 0x0200
  235. //
  236. // ***** NDIS Party Block *****
  237. //
  238. // Represents our context for a party of an outgoing point to multipoint
  239. // NDIS call. This is created on processing a Winsock2 JoinLeaf, and deleted
  240. // when the leaf is no longer a member of the connection.
  241. //
  242. typedef struct _RWAN_NDIS_PARTY
  243. {
  244. #if DBG
  245. ULONG npy_sig;
  246. #endif // DBG
  247. USHORT State;
  248. USHORT Flags; // Pending events etc
  249. NDIS_HANDLE NdisPartyHandle; // Supplied by NDIS
  250. struct _RWAN_NDIS_VC * pVc; // Back pointer
  251. struct _RWAN_TDI_CONNECTION * pConnObject; // To Connection Object
  252. LIST_ENTRY PartyLink; // To next party on VC
  253. PCO_CALL_PARAMETERS pCallParameters; // Party setup parameters
  254. } RWAN_NDIS_PARTY, *PRWAN_NDIS_PARTY;
  255. #if DBG
  256. #define npy_signature 'yPwR'
  257. #endif // DBG
  258. #define NULL_PRWAN_NDIS_PARTY ((PRWAN_NDIS_PARTY)NULL)
  259. #define RWANF_PARTY_DROPPING 0x8000
  260. //
  261. // ***** NDIS SAP Block *****
  262. //
  263. // This represents our context for an NDIS Service Access Point (SAP).
  264. // When a new Address Object is created, and it represents a listening
  265. // endpoint, we register SAPs on all adapters that support the bound
  266. // address family. A SAP block contains information for one such SAP.
  267. //
  268. typedef struct _RWAN_NDIS_SAP
  269. {
  270. #if DBG
  271. ULONG nsp_sig;
  272. #endif // DBG
  273. struct _RWAN_TDI_ADDRESS * pAddrObject; // Back pointer
  274. USHORT Flags;
  275. LIST_ENTRY AddrObjLink; // To list of SAPs on addr object
  276. LIST_ENTRY AfLink; // To list of SAPs on AF
  277. NDIS_HANDLE NdisSapHandle; // Supplied by NDIS
  278. struct _RWAN_NDIS_AF * pNdisAf; // Back pointer
  279. PCO_SAP pCoSap;
  280. } RWAN_NDIS_SAP, *PRWAN_NDIS_SAP;
  281. #if DBG
  282. #define nsp_signature 'pSwR'
  283. #endif // DBG
  284. #define NULL_PRWAN_NDIS_SAP ((PRWAN_NDIS_SAP)NULL)
  285. #define RWANF_SAP_CLOSING 0x8000
  286. //
  287. // ***** NDIS AF Block *****
  288. //
  289. // This represents our context for an NDIS Address Family open.
  290. // When we get notified of a Call Manager that supports a protocol
  291. // that is of interest to us, on an adapter that we are bound to,
  292. // we open the AF represented by the Call Manager. This goes away
  293. // when we unbind from the adapter.
  294. //
  295. // Note that there could be multiple Call Managers running over
  296. // a single adapter, each supporting a different NDIS AF.
  297. //
  298. // An NDIS AF supports one or more Winsock2 triples: <Family, Type, Proto>.
  299. //
  300. // Reference Count keeps track of:
  301. // - OpenAf
  302. // - Each VC on this AF open
  303. // - Each SAP on this AF open
  304. //
  305. typedef struct _RWAN_NDIS_AF
  306. {
  307. #if DBG
  308. ULONG naf_sig;
  309. #endif // DBG
  310. INT RefCount; // Reference Count
  311. USHORT State;
  312. USHORT Flags; // Pending events etc
  313. LIST_ENTRY AfLink; // In list of AFs on adapter
  314. NDIS_HANDLE NdisAfHandle; // Supplied by NDIS
  315. LIST_ENTRY NdisVcList; // List of open VCs
  316. LIST_ENTRY NdisSapList; // List of registered SAPs
  317. RWAN_HANDLE AfSpAFContext; // AF-specific module's context
  318. // for this open
  319. struct _RWAN_NDIS_ADAPTER * pAdapter; // Back pointer
  320. struct _RWAN_NDIS_AF_INFO * pAfInfo; // Information about this NDIS AF
  321. LIST_ENTRY AfInfoLink; // In list of AFs with same Info
  322. RWAN_LOCK Lock; // Mutex
  323. ULONG MaxAddrLength; // For this Address Family
  324. RWAN_DELETE_NOTIFY DeleteNotify; // Things to do on freeing this
  325. } RWAN_NDIS_AF, *PRWAN_NDIS_AF;
  326. #if DBG
  327. #define naf_signature 'fAwR'
  328. #endif // DBG
  329. #define NULL_PRWAN_NDIS_AF ((PRWAN_NDIS_AF)NULL)
  330. #define RWANF_AF_CLOSING 0x8000
  331. #define RWANF_AF_IN_ADAPTER_LIST 0x0001 // AfLink is valid
  332. //
  333. // ***** NDIS Adapter Block *****
  334. //
  335. // This is our context for an NDIS Adapter Binding. One of these is
  336. // created for each adapter that we bind to.
  337. //
  338. typedef struct _RWAN_NDIS_ADAPTER
  339. {
  340. #if DBG
  341. ULONG nad_sig;
  342. #endif
  343. USHORT State;
  344. USHORT Flags; // Pending events etc
  345. NDIS_HANDLE NdisAdapterHandle; // Supplied by NDIS
  346. NDIS_MEDIUM Medium; // Supported by adapter
  347. PNDIS_MEDIUM pMediaArray; // Used in NdisOpenAdapter
  348. UINT MediumIndex; // Used in NdisOpenAdapter
  349. PVOID BindContext; // From BindAdapter/UnbindAdapter
  350. RWAN_LOCK Lock; // Mutex
  351. LIST_ENTRY AdapterLink; // In list of all adapters
  352. LIST_ENTRY AfList; // List of opened AFs on adapter
  353. struct _RWAN_RECEIVE_INDICATION *pCompletedReceives; // List of completed rcv indns
  354. NDIS_STRING DeviceName; // Name of adapter
  355. } RWAN_NDIS_ADAPTER, *PRWAN_NDIS_ADAPTER;
  356. #if DBG
  357. #define nad_signature 'dAwR'
  358. #endif // DBG
  359. #define NULL_PRWAN_NDIS_ADAPTER ((PRWAN_NDIS_ADAPTER)NULL)
  360. //
  361. // Adapter states:
  362. //
  363. #define RWANS_AD_CREATED 0x0000
  364. #define RWANS_AD_OPENING 0x0001
  365. #define RWANS_AD_OPENED 0x0002
  366. #define RWANS_AD_CLOSING 0x0003
  367. //
  368. // Adapter flags:
  369. //
  370. #define RWANF_AD_UNBIND_PENDING 0x0001
  371. //
  372. // ***** TDI Protocol Block *****
  373. //
  374. // Maintains information about one Winsock protocol <Family, Protocol, Type>
  375. // supported by NullTrans. On NT, each TDI protocol block is represented
  376. // by a Device Object.
  377. //
  378. typedef struct _RWAN_TDI_PROTOCOL
  379. {
  380. #if DBG
  381. ULONG ntp_sig;
  382. #endif // DBG
  383. UINT TdiProtocol; // Matches TdiOpenAddress
  384. UINT SockAddressFamily;
  385. UINT SockProtocol;
  386. UINT SockType;
  387. PVOID pRWanDeviceObject; // NT: to RWAN_DEVICE_OBJECT
  388. BOOLEAN bAllowAddressObjects;
  389. BOOLEAN bAllowConnObjects;
  390. USHORT MaxAddrLength; // For this TDI protocol
  391. LIST_ENTRY AddrObjList; // List of open AddressObjects
  392. LIST_ENTRY TdiProtocolLink; // In list of all TDI protocols
  393. struct _RWAN_NDIS_AF_INFO * pAfInfo; // NDIS Address Family
  394. LIST_ENTRY AfInfoLink; // List of TDI Protocols on AfInfo
  395. RWAN_EVENT Event; // Used for synchronization
  396. AFSP_DEREG_TDI_PROTO_COMP_HANDLER pAfSpDeregTdiProtocolComplete;
  397. TDI_PROVIDER_INFO ProviderInfo;
  398. TDI_PROVIDER_STATISTICS ProviderStats;
  399. } RWAN_TDI_PROTOCOL, *PRWAN_TDI_PROTOCOL;
  400. #if DBG
  401. #define ntp_signature 'pTwR'
  402. #endif // DBG
  403. #define NULL_PRWAN_TDI_PROTOCOL ((PRWAN_TDI_PROTOCOL)NULL)
  404. //
  405. // ***** NDIS Address-Family Information Block *****
  406. //
  407. // This contains information about a supported <NDIS AF, NDIS Medium> pair.
  408. // Each such pair could support one or more TDI Protocols, each identified by a
  409. // <Family, Protocol, Type> triple.
  410. //
  411. typedef struct _RWAN_NDIS_AF_INFO
  412. {
  413. #if DBG
  414. ULONG nai_sig;
  415. #endif // DBG
  416. USHORT Flags;
  417. LIST_ENTRY AfInfoLink; // In list of supported NDIS AFs
  418. LIST_ENTRY TdiProtocolList; // List of RWAN_TDI_PROTOCOL
  419. LIST_ENTRY NdisAfList; // List of RWAN_NDIS_AF
  420. RWAN_HANDLE AfSpContext; // AF-specific module's context
  421. RWAN_NDIS_AF_CHARS AfChars;
  422. } RWAN_NDIS_AF_INFO, *PRWAN_NDIS_AF_INFO;
  423. #if DBG
  424. #define nai_signature 'iAwR'
  425. #endif // DBG
  426. #define RWANF_AFI_CLOSING 0x8000
  427. //
  428. // ***** Global Information Block *****
  429. //
  430. // Root of all information for NullTrans. One of these structures exists
  431. // per system.
  432. //
  433. typedef struct _RWAN_GLOBALS
  434. {
  435. #if DBG
  436. ULONG nlg_sig;
  437. #endif // DBG
  438. NDIS_HANDLE ProtocolHandle; // from NdisRegisterProtocol
  439. LIST_ENTRY AfInfoList; // All supported NDIS AFs
  440. ULONG AfInfoCount; // Size of above list
  441. LIST_ENTRY ProtocolList; // All supported TDI protocols
  442. ULONG ProtocolCount; // Size of above list
  443. LIST_ENTRY AdapterList; // All bound adapters
  444. ULONG AdapterCount; // Size of above list
  445. RWAN_LOCK GlobalLock; // Mutex
  446. RWAN_LOCK AddressListLock; // Mutex for AddrObject table
  447. RWAN_LOCK ConnTableLock; // Mutex for ConnObject table
  448. RWAN_CONN_INSTANCE ConnInstance; // Counts ConnId's allocated sofar
  449. PRWAN_TDI_CONNECTION * pConnTable; // Pointers to open connections
  450. ULONG ConnTableSize; // Size of above table
  451. ULONG MaxConnections; // Max size of above table
  452. ULONG NextConnIndex; // Starting point for next search
  453. RWAN_EVENT Event; // Used for synchronization
  454. BOOLEAN UnloadDone; // Has our UnloadProtocol run?
  455. #ifdef NT
  456. PDRIVER_OBJECT pDriverObject; // From DriverEntry()
  457. LIST_ENTRY DeviceObjList; // All device objs we've created
  458. #endif // NT
  459. } RWAN_GLOBALS, *PRWAN_GLOBALS;
  460. #if DBG
  461. #define nlg_signature 'lGwR'
  462. #endif // DBG
  463. //
  464. // ***** Request structure *****
  465. //
  466. // This structure keeps context information about each TDI request
  467. // that we pend.
  468. //
  469. typedef struct _RWAN_REQUEST
  470. {
  471. #if DBG
  472. ULONG nrq_sig;
  473. #endif // DBG
  474. PCOMPLETE_RTN pReqComplete; // Call-back routine
  475. PVOID ReqContext; // Context for above
  476. TDI_STATUS Status; // Final status
  477. } RWAN_REQUEST, *PRWAN_REQUEST;
  478. #if DBG
  479. #define nrq_signature 'qRwR'
  480. #endif // DBG
  481. //
  482. // ***** Connect Request structure *****
  483. //
  484. // This structure is used to maintain information about a pended
  485. // TDI_CONNECT or TDI_LISTEN or TDI_ACCEPT or TDI_DISCONNECT.
  486. //
  487. typedef struct _RWAN_CONN_REQUEST
  488. {
  489. #if DBG
  490. ULONG nrc_sig;
  491. #endif // DBG
  492. struct _RWAN_REQUEST Request; // Common stuff
  493. struct _TDI_CONNECTION_INFORMATION * pConnInfo; // Return info
  494. USHORT Flags;
  495. } RWAN_CONN_REQUEST, *PRWAN_CONN_REQUEST;
  496. #if DBG
  497. #define nrc_signature 'cRwR'
  498. #endif // DBG
  499. //
  500. // ***** Data Request structure *****
  501. //
  502. // This is the common part of a send/receive data request.
  503. //
  504. typedef struct _RWAN_DATA_REQUEST
  505. {
  506. PDATA_COMPLETE_RTN pReqComplete;
  507. PVOID ReqContext;
  508. } RWAN_DATA_REQUEST, *PRWAN_DATA_REQUEST;
  509. //
  510. // ***** Send Request structure *****
  511. //
  512. // This structure is used to maintain information about a pended
  513. // TDI_SEND.
  514. //
  515. typedef struct _RWAN_SEND_REQUEST
  516. {
  517. #if DBG
  518. ULONG nrs_sig;
  519. #endif // DBG
  520. struct _RWAN_DATA_REQUEST Request; // Common stuff
  521. USHORT SendFlags;
  522. UINT SendLength;
  523. } RWAN_SEND_REQUEST, *PRWAN_SEND_REQUEST;
  524. #if DBG
  525. #define nrs_signature 'sRwR'
  526. #endif // DBG
  527. //
  528. // ***** Receive Request structure *****
  529. //
  530. // This structure is used to maintain information about a pended
  531. // TDI_RECEIVE.
  532. //
  533. typedef struct _RWAN_RECEIVE_REQUEST
  534. {
  535. #if DBG
  536. ULONG nrr_sig;
  537. #endif // DBG
  538. struct _RWAN_RECEIVE_REQUEST * pNextRcvReq; // For chaining
  539. struct _RWAN_DATA_REQUEST Request; // Common stuff
  540. PUSHORT pUserFlags; // Info about the rcv
  541. UINT TotalBufferLength; // From TdiReceive
  542. UINT AvailableBufferLength; // out of the above
  543. PNDIS_BUFFER pBuffer; // Current buffer in chain
  544. PUCHAR pWriteData; // Write pointer
  545. UINT BytesLeftInBuffer; // Left in current buffer
  546. } RWAN_RECEIVE_REQUEST, *PRWAN_RECEIVE_REQUEST;
  547. #if DBG
  548. #define nrr_signature 'rRwR'
  549. #endif // DBG
  550. //
  551. // ***** Receive Indication structure *****
  552. //
  553. // This structure is used to maintain information about one
  554. // indicated NDIS packet.
  555. //
  556. typedef struct _RWAN_RECEIVE_INDICATION
  557. {
  558. #if DBG
  559. ULONG nri_sig;
  560. #endif // DBG
  561. struct _RWAN_RECEIVE_INDICATION * pNextRcvInd; // For chaining
  562. PNDIS_BUFFER pBuffer; // Next byte is read from
  563. // this buffer:
  564. PUCHAR pReadData; // Points to next byte
  565. // to be read
  566. UINT BytesLeftInBuffer;
  567. UINT TotalBytesLeft; // Within this packet
  568. PNDIS_PACKET pPacket;
  569. UINT PacketLength;
  570. BOOLEAN bIsMiniportPacket; // Does this packet
  571. // belong to the miniport
  572. PRWAN_NDIS_VC pVc; // back-pointer
  573. } RWAN_RECEIVE_INDICATION, *PRWAN_RECEIVE_INDICATION;
  574. #if DBG
  575. #define nri_signature 'iRwR'
  576. #endif // DBG
  577. //
  578. // Saved context for an NDIS Request sent to the miniport on behalf of
  579. // an AF/media specific module.
  580. //
  581. typedef struct _RWAN_NDIS_REQ_CONTEXT
  582. {
  583. struct _RWAN_NDIS_AF * pAf;
  584. RWAN_HANDLE AfSpReqContext;
  585. } RWAN_NDIS_REQ_CONTEXT, *PRWAN_NDIS_REQ_CONTEXT;
  586. #endif // __TDI_RWANDATA__H