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.

308 lines
9.7 KiB

  1. /********************************************************************/
  2. /** Copyright(c) 1995 Microsoft Corporation. **/
  3. /********************************************************************/
  4. //***
  5. //
  6. // Filename: dim.h
  7. //
  8. // Description: Contains all definitions related to the interface between
  9. // the Dynamic Interface Manager and other components like
  10. // the router managers.
  11. //
  12. // History: March 24,1995 NarenG Created original version.
  13. //
  14. #ifndef _DIM_
  15. #define _DIM_
  16. #include <mprapi.h>
  17. typedef enum _UNREACHABILITY_REASON
  18. {
  19. INTERFACE_OUT_OF_RESOURCES,
  20. INTERFACE_CONNECTION_FAILURE,
  21. INTERFACE_DISABLED,
  22. INTERFACE_SERVICE_IS_PAUSED,
  23. INTERFACE_DIALOUT_HOURS_RESTRICTION,
  24. INTERFACE_NO_MEDIA_SENSE,
  25. INTERFACE_NO_DEVICE
  26. } UNREACHABILITY_REASON;
  27. //
  28. // This data structure represents the interface between the DIM and the various
  29. // router managers. Each router manager will be a user-mode DLL that will
  30. // export the following call:
  31. //
  32. typedef struct _DIM_ROUTER_INTERFACE
  33. {
  34. //
  35. // Protocol Id of the Router Manager
  36. //
  37. OUT DWORD dwProtocolId;
  38. //
  39. // The StopRouter call should not block. It should return
  40. // PENDING if it needs to block and then call the RouterStopped call.
  41. //
  42. OUT DWORD
  43. (APIENTRY *StopRouter)( VOID );
  44. //
  45. // Called once by DIM after all interfaces read from the registry are
  46. // loaded after router startup
  47. //
  48. OUT DWORD
  49. (APIENTRY *RouterBootComplete)( VOID );
  50. //
  51. // Called when an interface is connected
  52. //
  53. OUT DWORD
  54. (APIENTRY *InterfaceConnected)(
  55. IN HANDLE hInterface,
  56. IN PVOID pFilter,
  57. IN PVOID pPppProjectionResult );
  58. //
  59. // Will be called once for each router or each client that connects.
  60. // For a client, the pInterfaceInfo will be NULL. INTERFACE_TYPE
  61. // identified the type of the interface is being added.
  62. // hDIMInterface is the handle that should be used by
  63. // the various router managers when making calls into DIM.
  64. //
  65. OUT DWORD
  66. (APIENTRY *AddInterface)(
  67. IN LPWSTR lpwsInterfaceName,
  68. IN LPVOID pInterfaceInfo,
  69. IN ROUTER_INTERFACE_TYPE InterfaceType,
  70. IN HANDLE hDIMInterface,
  71. IN OUT HANDLE * phInterface );
  72. OUT DWORD
  73. (APIENTRY *DeleteInterface)(
  74. IN HANDLE hInterface );
  75. OUT DWORD
  76. (APIENTRY *GetInterfaceInfo)(
  77. IN HANDLE hInterface,
  78. OUT LPVOID pInterfaceInfo,
  79. IN OUT LPDWORD lpdwInterfaceInfoSize );
  80. //
  81. // pInterfaceInfo may be NULL if there was no change
  82. //
  83. OUT DWORD
  84. (APIENTRY *SetInterfaceInfo)(
  85. IN HANDLE hInterface,
  86. IN LPVOID pInterfaceInfo );
  87. OUT DWORD
  88. (APIENTRY *DisableInterface)(
  89. IN HANDLE hInterface,
  90. IN DWORD dwProtocolId
  91. );
  92. OUT DWORD
  93. (APIENTRY *EnableInterface)(
  94. IN HANDLE hInterface,
  95. IN DWORD dwProtocolId
  96. );
  97. //
  98. // Notification that the interface is not reachable at this time.
  99. // This is in response to a previos call to ConnectInterface.
  100. // (All WAN links are busy at this time or remote destination is busy etc).
  101. //
  102. OUT DWORD
  103. (APIENTRY *InterfaceNotReachable)(
  104. IN HANDLE hInterface,
  105. IN UNREACHABILITY_REASON Reason );
  106. //
  107. // Notification that a previously unreachable interface may be reachable
  108. // at this time.
  109. //
  110. OUT DWORD
  111. (APIENTRY *InterfaceReachable)(
  112. IN HANDLE hInterface );
  113. OUT DWORD
  114. (APIENTRY *UpdateRoutes)(
  115. IN HANDLE hInterface,
  116. IN HANDLE hEvent );
  117. //
  118. // When the hEvent is signaled, the caller of UpdateRoutes will call
  119. // this function. If the update succeeded then *lpdwUpdateResult will
  120. // be NO_ERROR otherwise it will be non-zero.
  121. //
  122. OUT DWORD
  123. (APIENTRY *GetUpdateRoutesResult)(
  124. IN HANDLE hInterface,
  125. OUT LPDWORD lpdwUpdateResult );
  126. OUT DWORD
  127. (APIENTRY *SetGlobalInfo)(
  128. IN LPVOID pGlobalInfo );
  129. OUT DWORD
  130. (APIENTRY *GetGlobalInfo)(
  131. OUT LPVOID pGlobalInfo,
  132. IN OUT LPDWORD lpdwGlobalInfoSize );
  133. //
  134. // The MIBEntryGetXXX APIs should return ERROR_INSUFFICIENT_BUFFER
  135. // and the size of the required output buffer if the size of the output
  136. // buffer passed in is 0.
  137. //
  138. OUT DWORD
  139. (APIENTRY *MIBEntryCreate)(
  140. IN DWORD dwRoutingPid,
  141. IN DWORD dwEntrySize,
  142. IN LPVOID lpEntry );
  143. OUT DWORD
  144. (APIENTRY *MIBEntryDelete)(
  145. IN DWORD dwRoutingPid,
  146. IN DWORD dwEntrySize,
  147. IN LPVOID lpEntry );
  148. OUT DWORD
  149. (APIENTRY *MIBEntrySet)(
  150. IN DWORD dwRoutingPid,
  151. IN DWORD dwEntrySize,
  152. IN LPVOID lpEntry );
  153. OUT DWORD
  154. (APIENTRY *MIBEntryGet)(
  155. IN DWORD dwRoutingPid,
  156. IN DWORD dwInEntrySize,
  157. IN LPVOID lpInEntry,
  158. IN OUT LPDWORD lpOutEntrySize,
  159. OUT LPVOID lpOutEntry );
  160. OUT DWORD
  161. (APIENTRY *MIBEntryGetFirst)(
  162. IN DWORD dwRoutingPid,
  163. IN DWORD dwInEntrySize,
  164. IN LPVOID lpInEntry,
  165. IN OUT LPDWORD lpOutEntrySize,
  166. OUT LPVOID lpOutEntry );
  167. OUT DWORD
  168. (APIENTRY *MIBEntryGetNext)(
  169. IN DWORD dwRoutingPid,
  170. IN DWORD dwInEntrySize,
  171. IN LPVOID lpInEntry,
  172. IN OUT LPDWORD lpOutEntrySize,
  173. OUT LPVOID lpOutEntry );
  174. OUT DWORD
  175. (APIENTRY *MIBGetTrapInfo)(
  176. IN DWORD dwRoutingPid,
  177. IN DWORD dwInDataSize,
  178. IN LPVOID lpInData,
  179. IN OUT LPDWORD lpOutDataSize,
  180. OUT LPVOID lpOutData );
  181. OUT DWORD
  182. (APIENTRY *MIBSetTrapInfo)(
  183. IN DWORD dwRoutingPid,
  184. IN HANDLE hEvent,
  185. IN DWORD dwInDataSize,
  186. IN LPVOID lpInData,
  187. IN OUT LPDWORD lpOutDataSize,
  188. OUT LPVOID lpOutData );
  189. OUT DWORD
  190. (APIENTRY *SetRasAdvEnable)(
  191. IN BOOL bEnable );
  192. //
  193. // The following calls will be called by the various router managers.
  194. // The addresses of these entry points into the DIM will be filled in by DIM
  195. // before the StartRouter call. The router managers should not call any of
  196. // these calls within the context of a call from DIM into the router
  197. // manager.
  198. //
  199. IN DWORD
  200. (APIENTRY *ConnectInterface)(
  201. IN HANDLE hDIMInterface,
  202. IN DWORD dwProtocolId );
  203. IN DWORD
  204. (APIENTRY *DisconnectInterface)(
  205. IN HANDLE hDIMInterface,
  206. IN DWORD dwProtocolId );
  207. //
  208. // This call will make DIM store the interface information into the
  209. // Site Object for this interface.
  210. //
  211. IN DWORD
  212. (APIENTRY *SaveInterfaceInfo)(
  213. IN HANDLE hDIMInterface,
  214. IN DWORD dwProtocolId,
  215. IN LPVOID pInterfaceInfo,
  216. IN DWORD cbInterfaceInfoSize );
  217. //
  218. // This will make DIM get interface information from the Site object.
  219. //
  220. IN DWORD
  221. (APIENTRY *RestoreInterfaceInfo)(
  222. IN HANDLE hDIMInterface,
  223. IN DWORD dwProtocolId,
  224. IN LPVOID lpInterfaceInfo,
  225. IN LPDWORD lpcbInterfaceInfoSize );
  226. IN DWORD
  227. (APIENTRY *SaveGlobalInfo)(
  228. IN DWORD dwProtocolId,
  229. IN LPVOID pGlobalInfo,
  230. IN DWORD cbGlobalInfoSize );
  231. IN VOID
  232. (APIENTRY *RouterStopped)(
  233. IN DWORD dwProtocolId,
  234. IN DWORD dwError );
  235. IN VOID
  236. (APIENTRY *InterfaceEnabled)(
  237. IN HANDLE hDIMInterface,
  238. IN DWORD dwProtocolId,
  239. IN BOOL fEnabled );
  240. } DIM_ROUTER_INTERFACE, *PDIM_ROUTER_INTERFACE;
  241. //
  242. // This will be called, once for each available router manager DLL, when the
  243. // DIM service is initializing. This will by a synchronous call.
  244. // If it returns NO_ERROR then it is assumed that the router manager has
  245. // started. Otherwise it is an error.
  246. //
  247. DWORD APIENTRY
  248. StartRouter(
  249. IN OUT DIM_ROUTER_INTERFACE * pDimRouterIf,
  250. IN BOOL fLANModeOnly,
  251. IN LPVOID pGlobalInfo
  252. );
  253. #endif