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.

185 lines
5.3 KiB

  1. /*****************************************************************************
  2. *
  3. * Copyright (c) 1998-1999 Microsoft Corporation
  4. *
  5. * CTDI.H - Common TDI API and data types.
  6. *
  7. * Author: Stan Adermann (stana)
  8. *
  9. * Created: 8/4/1998
  10. *
  11. *****************************************************************************/
  12. #ifndef CTDI_H
  13. #define CTDI_H
  14. #include "ctdios.h"
  15. #define CTDI_FLAG_ENABLE_ROUTING 0x00000001
  16. #define CTDI_FLAG_NETWORK_HEADER 0x00000002
  17. #define IPADDR(x) (x & 0x000000ff),((x>>8) & 0x000000ff), ((x>>16) & 0x000000ff), ((x>>24) & 0x000000ff)
  18. typedef NDIS_STATUS
  19. (*CTDI_EVENT_DISCONNECT)(
  20. IN PVOID pContext,
  21. IN BOOLEAN Abortive
  22. );
  23. typedef NDIS_STATUS
  24. (*CTDI_EVENT_CONNECT_QUERY)(
  25. IN PVOID pContext,
  26. IN PTRANSPORT_ADDRESS pAddress,
  27. IN HANDLE hNewCtdi,
  28. OUT PVOID *pNewContext
  29. );
  30. typedef NDIS_STATUS
  31. (*CTDI_EVENT_CONNECT_COMPLETE)(
  32. IN PVOID pContext,
  33. IN HANDLE hNewCtdi,
  34. IN NDIS_STATUS ConnectStatus
  35. );
  36. typedef NDIS_STATUS
  37. (*CTDI_EVENT_RECEIVE)(
  38. IN PVOID pContext,
  39. IN PUCHAR pBuffer,
  40. IN ULONG ulLength
  41. );
  42. typedef NDIS_STATUS
  43. (*CTDI_EVENT_RECEIVE_DATAGRAM)(
  44. IN PVOID pContext,
  45. IN PTRANSPORT_ADDRESS pAddress,
  46. IN PUCHAR pBuffer,
  47. IN ULONG ulLength
  48. );
  49. typedef VOID
  50. (*CTDI_EVENT_SEND_COMPLETE)(
  51. IN PVOID pContext,
  52. IN PVOID pDatagramContext,
  53. IN PUCHAR pBuffer,
  54. IN NDIS_STATUS Result
  55. );
  56. typedef VOID
  57. (*CTDI_EVENT_QUERY_COMPLETE)(
  58. IN PVOID pContext,
  59. IN PVOID pData,
  60. IN NDIS_STATUS Result
  61. );
  62. typedef VOID
  63. (*CTDI_EVENT_SET_COMPLETE)(
  64. IN PVOID pContext,
  65. IN PVOID pData,
  66. IN NDIS_STATUS Result
  67. );
  68. NDIS_STATUS
  69. CtdiInitialize(
  70. IN ULONG ulFlags
  71. );
  72. NDIS_STATUS
  73. CtdiClose(
  74. IN HANDLE hCtdi
  75. );
  76. NDIS_STATUS
  77. CtdiListen(
  78. IN HANDLE hCtdi,
  79. IN ULONG_PTR NumListen,
  80. IN CTDI_EVENT_CONNECT_QUERY pConnectQueryHandler,
  81. IN CTDI_EVENT_RECEIVE pReceiveHandler,
  82. IN CTDI_EVENT_DISCONNECT pDisconnectHandler,
  83. IN PVOID pContext
  84. );
  85. NDIS_STATUS
  86. CtdiConnect(
  87. IN HANDLE hCtdi,
  88. IN PTRANSPORT_ADDRESS pAddress,
  89. IN CTDI_EVENT_CONNECT_COMPLETE pConnectCompleteHandler,
  90. IN CTDI_EVENT_RECEIVE pReceiveHandler,
  91. IN CTDI_EVENT_DISCONNECT pDisconnectHandler,
  92. IN PVOID pContext
  93. );
  94. NDIS_STATUS
  95. CtdiDisconnect(
  96. IN HANDLE hCtdi,
  97. IN BOOLEAN Abort
  98. );
  99. NDIS_STATUS
  100. CtdiReceiveComplete(
  101. IN HANDLE hCtdi,
  102. IN PUCHAR pBuffer
  103. );
  104. NDIS_STATUS
  105. CtdiSend(
  106. IN HANDLE hCtdi,
  107. IN CTDI_EVENT_SEND_COMPLETE pSendCompleteHandler,
  108. IN PVOID pContext,
  109. IN PVOID pvBuffer,
  110. IN ULONG ulLength
  111. );
  112. NDIS_STATUS
  113. CtdiSendDatagram(
  114. IN HANDLE hCtdi,
  115. IN CTDI_EVENT_SEND_COMPLETE pSendCompleteHandler,
  116. IN PVOID pContext,
  117. IN PVOID pDatagramContext,
  118. IN PTRANSPORT_ADDRESS pDestination,
  119. IN PUCHAR pBuffer,
  120. IN ULONG ulLength
  121. );
  122. NDIS_STATUS
  123. CtdiCreateEndpoint(
  124. OUT PHANDLE phCtdi,
  125. IN ULONG_PTR ulAddressFamily,
  126. IN ULONG_PTR ulType,
  127. IN PTRANSPORT_ADDRESS pAddress,
  128. IN ULONG_PTR ulRxPadding
  129. );
  130. NDIS_STATUS
  131. CtdiSetEventHandler(
  132. IN HANDLE hCtdi,
  133. IN ULONG ulEventType,
  134. IN PVOID pEventHandler,
  135. IN PVOID pContext
  136. );
  137. NDIS_STATUS
  138. CtdiSetInformation(
  139. IN HANDLE hCtdi,
  140. IN ULONG_PTR ulSetType,
  141. IN PTDI_CONNECTION_INFORMATION pConnectionInformation,
  142. IN CTDI_EVENT_SET_COMPLETE pSetCompleteHandler,
  143. IN PVOID pContext
  144. );
  145. NDIS_STATUS
  146. CtdiQueryInformation(
  147. IN HANDLE hCtdi,
  148. IN ULONG ulQueryType,
  149. IN OUT PVOID pBuffer,
  150. IN ULONG Length,
  151. IN CTDI_EVENT_QUERY_COMPLETE pQueryCompleteHandler,
  152. IN PVOID pContext
  153. );
  154. VOID CtdiShutdown();
  155. VOID CtdiSetRequestPending(
  156. IN HANDLE hCtdi
  157. );
  158. #endif // CTDI_H