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.

315 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. routing\ip\rtrmgr\if.h
  5. Abstract:
  6. Header for if.c
  7. Revision History:
  8. Gurdeep Singh Pall 6/26/95 Created
  9. --*/
  10. #define ADAPTER_PREFIX_STRING "\\DEVICE\\"
  11. #define ADAPTER_PREFIX_UNICODE_STRING L"\\DEVICE\\"
  12. PICB
  13. CreateIcb(
  14. PWSTR pwszInterfaceName,
  15. HANDLE hDIMInterface,
  16. ROUTER_INTERFACE_TYPE InterfaceType,
  17. DWORD dwAdminState,
  18. DWORD dwIfIndex OPTIONAL
  19. );
  20. DWORD
  21. CreateDefaultIcb(
  22. PWCHAR pwszName,
  23. ICB **ppicb
  24. );
  25. DWORD
  26. AllocateIcb(
  27. PWCHAR pwszName,
  28. ICB **ppicb
  29. );
  30. DWORD
  31. CreateBindingForNewIcb(
  32. PICB pNewIcb
  33. );
  34. VOID
  35. InsertInterfaceInLists(
  36. PICB pNewIcb
  37. );
  38. VOID
  39. RemoveInterfaceFromLists(
  40. PICB picb
  41. );
  42. DWORD
  43. BindInterfaceInAllProtocols(
  44. PICB picb
  45. );
  46. DWORD
  47. BindInterfaceInProtocol(
  48. PICB pIcb,
  49. PPROTO_CB pProto,
  50. PIP_ADAPTER_BINDING_INFO pBindInfo
  51. );
  52. DWORD
  53. UnbindInterfaceInAllProtocols(
  54. PICB picb
  55. );
  56. DWORD
  57. AddInterfaceToAllProtocols(
  58. PICB picb,
  59. PRTR_INFO_BLOCK_HEADER pInfoHdr
  60. );
  61. DWORD
  62. AddInterfaceToProtocol(
  63. IN PICB picb,
  64. IN PPROTO_CB pProtocolCb,
  65. IN PVOID pvProtoInfo,
  66. IN ULONG ulInfoVersion,
  67. IN ULONG ulInfoSize,
  68. IN ULONG ulInfoCount
  69. );
  70. DWORD
  71. DeleteInterfaceFromAllProtocols(
  72. PICB picb
  73. );
  74. DWORD
  75. DisableInterfaceWithAllProtocols(
  76. PICB picb
  77. );
  78. DWORD
  79. EnableInterfaceWithAllProtocols(
  80. PICB picb
  81. );
  82. VOID
  83. DeleteAllInterfaces(
  84. VOID
  85. );
  86. DWORD
  87. DeleteSingleInterface(
  88. PICB picb
  89. );
  90. DWORD
  91. LanEtcInterfaceDownToUp(
  92. PICB picb,
  93. BOOL bAdding
  94. );
  95. DWORD
  96. WanInterfaceInactiveToUp(
  97. PICB picb
  98. );
  99. DWORD
  100. GenericInterfaceComingUp(
  101. PICB picb
  102. );
  103. DWORD
  104. LanEtcInterfaceUpToDown(
  105. PICB picb,
  106. BOOL bDeleted
  107. );
  108. DWORD
  109. WanInterfaceUpToInactive(
  110. PICB picb,
  111. BOOL bDeleted
  112. );
  113. DWORD
  114. GenericInterfaceNoLongerUp(
  115. PICB picb,
  116. BOOL bDeleted
  117. );
  118. DWORD
  119. WanInterfaceInactiveToDown(
  120. PICB picb,
  121. BOOL bDeleted
  122. );
  123. DWORD
  124. WanInterfaceDownToInactive(
  125. PICB picb
  126. );
  127. DWORD
  128. GetInterfaceStatusInfo(
  129. IN PICB picb,
  130. IN PRTR_TOC_ENTRY pToc,
  131. IN PBYTE pbDataPtr,
  132. IN OUT PRTR_INFO_BLOCK_HEADER pInfoHdr,
  133. IN OUT PDWORD pdwInfoSize
  134. );
  135. DWORD
  136. SetInterfaceStatusInfo(
  137. IN PICB picb,
  138. IN PRTR_INFO_BLOCK_HEADER pInfoHdr,
  139. OUT PBOOL pbUpdateDIM
  140. );
  141. VOID
  142. DeAllocateBindings(
  143. PICB picb
  144. );
  145. DWORD
  146. GetInterfaceStatistics(
  147. IN PICB picb,
  148. OUT PMIB_IFROW pOutBuffer
  149. );
  150. DWORD
  151. SetInterfaceStatistics(
  152. IN PICB picb,
  153. IN PMIB_IFROW lpInBuffer,
  154. OUT PBOOL pbUpdateDIM
  155. );
  156. DWORD
  157. SetInterfaceAdminStatus(
  158. IN PICB picb,
  159. IN DWORD dwAdminStatus,
  160. OUT PBOOL pbUpdateDIM
  161. );
  162. DWORD
  163. InterfaceAdminStatusSetToUp(
  164. IN PICB picb,
  165. OUT PBOOL pbUpdateDIM
  166. );
  167. DWORD
  168. InterfaceAdminStatusSetToDown(
  169. IN PICB picb,
  170. OUT PBOOL pbUpdateDIM
  171. );
  172. VOID
  173. HandleAddressChangeNotification(
  174. VOID
  175. );
  176. DWORD
  177. UpdateBindingInformation(
  178. PICB picb
  179. );
  180. DWORD
  181. GetAdapterInfo(
  182. DWORD dwIpAddress,
  183. PDWORD pdwAdapterId,
  184. PDWORD pdwBCastBit,
  185. PDWORD pdwReasmSize
  186. );
  187. DWORD
  188. GetIpInfoForInterface(
  189. IN DWORD dwIfIndex,
  190. OUT PULONG pulNumAddresses,
  191. OUT ICB_BINDING **ppAddresses,
  192. OUT PDWORD pdwBCastBit,
  193. OUT PDWORD pdwReasmSize
  194. );
  195. DWORD
  196. GetBestNextHopMaskGivenICB(
  197. PICB picb,
  198. DWORD dwNextHopAddr
  199. );
  200. DWORD
  201. GetBestNextHopMaskGivenIndex(
  202. DWORD dwIfIndex,
  203. DWORD dwNextHopAddr
  204. );
  205. DWORD
  206. InitializeLoopbackInterface(
  207. PICB picb
  208. );
  209. DWORD
  210. DeleteLoopbackInterface(
  211. VOID
  212. );
  213. DWORD
  214. LanEtcInterfaceInitToDown(
  215. PICB picb
  216. );
  217. DWORD
  218. ReadAddressFromRegistry(
  219. IN PWCHAR pwszIfName,
  220. OUT PDWORD pdwNumAddresses,
  221. OUT ICB_BINDING **ppibAddressInfo,
  222. IN BOOL bInternalIf
  223. );
  224. DWORD
  225. ReadAddressAndMaskValues(
  226. IN HKEY hkeyAdapterSection,
  227. IN PSZ pszRegAddressValue,
  228. IN PSZ pszRegMaskValue,
  229. OUT ICB_BINDING **ppibAddressInfo,
  230. OUT PDWORD pdwNumAddresses
  231. );
  232. DWORD
  233. ParseAddressAndMask(
  234. IN PBYTE pbyAddresses,
  235. IN DWORD dwAddressSize,
  236. IN PBYTE pbyMasks,
  237. IN DWORD dwMaskSize,
  238. OUT ICB_BINDING **ppibAddressInfo,
  239. OUT PDWORD pdwNumAddresses
  240. );
  241. DWORD
  242. SetInterfaceReceiveType(
  243. IN DWORD dwProtocolId,
  244. IN DWORD dwIfIndex,
  245. IN DWORD dwInterfaceReceiveType,
  246. IN BOOL bActivate
  247. );
  248. DWORD
  249. HandleMediaSenseEvent(
  250. IN PICB pIcb,
  251. IN BOOL bSensed
  252. );
  253. #define IS_ROUTABLE(ipAddr) ((ipAddr) != htonl(INADDR_LOOPBACK))
  254. DWORD
  255. GetRouterId(VOID);