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.

247 lines
6.8 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. routing\ip\rtrmgr\proto.h
  5. Abstract:
  6. IP Router Manager code prototypes
  7. Revision History:
  8. Gurdeep Singh Pall 6/8/95 Created
  9. --*/
  10. #ifndef __PROTO_H__
  11. #define __PROTO_H__
  12. //* INIT.C
  13. //
  14. DWORD InitRouter(PRTR_INFO_BLOCK_HEADER pGlobalHdr);
  15. DWORD LoadRoutingProtocols (PRTR_INFO_BLOCK_HEADER pGlobalHdr);
  16. DWORD InitializeMibHandler();
  17. DWORD OpenIPDriver();
  18. DWORD StartDriverAndOpenHandle(PCHAR pszName, PWCHAR pwszDriverName, PHANDLE phDevice);
  19. DWORD OpenFilterDriver();
  20. DWORD OpenMulticastDriver(VOID);
  21. DWORD EnableNetbtBcastForwarding( DWORD dwEnable );
  22. DWORD RestoreNetbtBcastForwardingMode();
  23. DWORD ForceNetbtRegistryRead();
  24. //
  25. // CLOSE.C
  26. //
  27. VOID RouterManagerCleanup();
  28. VOID UnloadRoutingProtocols() ;
  29. VOID CloseIPDriver();
  30. DWORD
  31. StopDriverAndCloseHandle(
  32. PCHAR pszServiceName,
  33. HANDLE hDevice
  34. );
  35. VOID CloseMcastDriver();
  36. DWORD CloseFilterDriver();
  37. VOID MIBCleanup();
  38. //* WORKER.C
  39. //
  40. DWORD WorkerThread (LPVOID pGlobalInfo) ;
  41. DWORD ProcessSaveGlobalConfigInfo() ;
  42. DWORD ProcessSaveInterfaceConfigInfo() ;
  43. DWORD ProcessUpdateComplete (PPROTO_CB proutprot, UPDATE_COMPLETE_MESSAGE *updateresult) ;
  44. DWORD ProcessRouterStopped() ;
  45. VOID WaitForAPIsToExitBeforeStopping() ;
  46. DWORD QueueUpdateEvent (DWORD interfaceindex, DWORD result) ;
  47. // PROTODLL.C
  48. //
  49. DWORD HandleRoutingProtocolNotification () ;
  50. VOID NotifyRoutingProtocolsToStop() ;
  51. BOOL AllRoutingProtocolsStopped() ;
  52. DWORD
  53. LoadProtocol(
  54. IN MPR_PROTOCOL_0 *pmpProtocolInfo,
  55. IN PPROTO_CB pProtocolCb,
  56. IN PVOID pvInfo,
  57. IN ULONG ulGlobalInfoVersion,
  58. IN ULONG ulGlobalInfoSize,
  59. IN ULONG ulGlobalInfoCount
  60. );
  61. VOID RemoveProtocolFromAllInterfaces(PPROTO_CB pProtocolCB);
  62. DWORD StopRoutingProtocol(PPROTO_CB pProtocolCB);
  63. //* RTMOPS.C
  64. //
  65. DWORD
  66. RtmEventCallback (
  67. IN RTM_ENTITY_HANDLE hRtmHandle,
  68. IN RTM_EVENT_TYPE retEvent,
  69. IN PVOID pContext1,
  70. IN PVOID pContext2
  71. );
  72. DWORD
  73. WINAPI
  74. ProcessDefaultRouteChanges(
  75. IN HANDLE hNotifyHandle
  76. );
  77. DWORD
  78. WINAPI
  79. AddNetmgmtDefaultRoutesToForwarder(
  80. PRTM_DEST_INFO pDestInfo
  81. );
  82. DWORD
  83. WINAPI
  84. ProcessChanges (
  85. IN HANDLE hNotifyHandle
  86. );
  87. DWORD
  88. AddRtmRoute (
  89. IN HANDLE hRtmHandle,
  90. IN PINTERFACE_ROUTE_INFO pIpForw,
  91. IN DWORD dwFlags,
  92. IN DWORD dwNextHopMask,
  93. IN DWORD dwTimeToLive,
  94. OUT HANDLE *phRtmRoute
  95. );
  96. DWORD
  97. DeleteRtmRoute (
  98. IN HANDLE hRtmHandle,
  99. IN PINTERFACE_ROUTE_INFO pIpForw
  100. );
  101. DWORD
  102. ConvertRouteInfoToRtm (
  103. IN HANDLE hRtmHandle,
  104. IN PINTERFACE_ROUTE_INFO pIpForw,
  105. IN HANDLE hNextHopHandle,
  106. IN DWORD dwRouteFlags,
  107. OUT PRTM_NET_ADDRESS pDestAddr,
  108. OUT PRTM_ROUTE_INFO pRouteInfo
  109. );
  110. VOID
  111. ConvertRtmToRouteInfo (
  112. IN DWORD ownerProtocol,
  113. IN PRTM_NET_ADDRESS pDestAddr,
  114. IN PRTM_ROUTE_INFO pRoute,
  115. IN PRTM_NEXTHOP_INFO pNextHop,
  116. OUT PINTERFACE_ROUTE_INFO pIpForw
  117. );
  118. PINTERFACE_ROUTE_INFO
  119. ConvertMibRouteToRouteInfo(
  120. IN PMIB_IPFORWARDROW pMibRow
  121. );
  122. //#define ConvertRouteInfoToMibRoute(x) ((PMIB_IPFORWARDROW)(x))
  123. PMIB_IPFORWARDROW
  124. ConvertRouteInfoToMibRoute(
  125. IN PINTERFACE_ROUTE_INFO pRouteInfo
  126. );
  127. VOID
  128. ConvertRouteNotifyOutputToRouteInfo(
  129. IN PIPRouteNotifyOutput pirno,
  130. OUT PINTERFACE_ROUTE_INFO pRtInfo
  131. );
  132. DWORD
  133. BlockConvertRoutesToStatic (
  134. IN HANDLE hRtmHandle,
  135. IN DWORD dwIfIndex,
  136. IN DWORD dwProtocolId
  137. );
  138. DWORD
  139. DeleteRtmRoutes (
  140. IN HANDLE ClientHandle,
  141. IN DWORD dwIfIndex,
  142. IN BOOL fDeleteAll
  143. );
  144. #define DeleteRtmRoutesOnInterface(h, i) DeleteRtmRoutes(h, i, FALSE)
  145. DWORD
  146. DeleteRtmNexthops (
  147. IN HANDLE hRtmHandle,
  148. IN DWORD dwIfIndex,
  149. IN BOOL fDeleteAll
  150. );
  151. #define DeleteRtmNexthopsOnInterface(h, i) DeleteRtmNexthops(h, i, FALSE)
  152. //* RTMIF.C
  153. //
  154. VOID IPRouteChange (DWORD Flags, PVOID CurBestRoute, PVOID PrevBestRoute) ;
  155. INT IPHash (PVOID Net) ;
  156. BOOL IPCompareFamilySpecificData (PVOID Route1, PVOID Route2) ;
  157. INT IPCompareNextHopAddress (PVOID Route1, PVOID Route2) ;
  158. INT IPCompareNetworks (PVOID Net1, PVOID Net2) ;
  159. INT IPCompareMetrics(PVOID Route1, PVOID Route2);
  160. DWORD IPValidateRoute(PVOID Route);
  161. DWORD
  162. ChangeRouteWithForwarder(
  163. IN PRTM_NET_ADDRESS pDestAddr,
  164. IN PRTM_ROUTE_INFO pRoute,
  165. IN BOOL bAddRoute,
  166. IN BOOL bDelOld
  167. );
  168. DWORD
  169. WINAPI
  170. ValidateRouteForProtocol(
  171. IN DWORD dwProtoId,
  172. IN PVOID pRouteInfo,
  173. IN PVOID pDestAddr OPTIONAL
  174. );
  175. DWORD
  176. WINAPI
  177. ValidateRouteForProtocolEx(
  178. IN DWORD dwProtoId,
  179. IN PVOID pRouteInfo,
  180. IN PVOID pDestAddr OPTIONAL
  181. );
  182. // Load.c Functions that load the caches from the stack or elsewhere
  183. DWORD LoadIpAddrTable(VOID);
  184. DWORD LoadIpForwardTable(VOID);
  185. DWORD LoadIpNetTable(VOID);
  186. DWORD LoadTcpTable(VOID);
  187. DWORD LoadUdpTable(VOID);
  188. DWORD LoadArpEntTable(VOID);
  189. LONG UdpCmp(DWORD dwAddr1, DWORD dwPort1, DWORD dwAddr2, DWORD dwPort2);
  190. LONG TcpCmp(DWORD dwLocalAddr1, DWORD dwLocalPort1, DWORD dwRemAddr1, DWORD dwRemPort1,
  191. DWORD dwLocalAddr2, DWORD dwLocalPort2, DWORD dwRemAddr2, DWORD dwRemPort2);
  192. LONG IpForwardCmp(DWORD dwIpDest1, DWORD dwProto1, DWORD dwPolicy1,
  193. DWORD dwIpNextHop1, DWORD dwIpDest2, DWORD dwProto2,
  194. DWORD dwPolicy2, DWORD dwIpNextHop2);
  195. LONG IpNetCmp(DWORD dwIfIndex1, DWORD dwAddr1, DWORD dwIfIndex2, DWORD dwAddr2);
  196. PSZ CacheToA(DWORD dwCache);
  197. DWORD UpdateCache(DWORD dwCache,BOOL *fUpdate);
  198. #endif