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.

310 lines
4.8 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. PICB picb,
  138. PRTR_INFO_BLOCK_HEADER pInfoHdr
  139. );
  140. VOID
  141. DeAllocateBindings(
  142. PICB picb
  143. );
  144. DWORD
  145. GetInterfaceStatistics(
  146. IN PICB picb,
  147. OUT PMIB_IFROW pOutBuffer
  148. );
  149. DWORD
  150. SetInterfaceStatistics(
  151. IN PICB picb,
  152. IN PMIB_IFROW lpInBuffer
  153. );
  154. DWORD
  155. SetInterfaceAdminStatus(
  156. IN PICB picb,
  157. IN DWORD dwAdminStatus
  158. );
  159. DWORD
  160. InterfaceAdminStatusSetToUp(
  161. IN PICB picb
  162. );
  163. DWORD
  164. InterfaceAdminStatusSetToDown(
  165. IN PICB picb
  166. );
  167. VOID
  168. HandleAddressChangeNotification(
  169. VOID
  170. );
  171. DWORD
  172. UpdateBindingInformation(
  173. PICB picb
  174. );
  175. DWORD
  176. GetAdapterInfo(
  177. DWORD dwIpAddress,
  178. PDWORD pdwAdapterId,
  179. PDWORD pdwBCastBit,
  180. PDWORD pdwReasmSize
  181. );
  182. DWORD
  183. GetIpInfoForInterface(
  184. IN DWORD dwIfIndex,
  185. OUT PULONG pulNumAddresses,
  186. OUT ICB_BINDING **ppAddresses,
  187. OUT PDWORD pdwBCastBit,
  188. OUT PDWORD pdwReasmSize
  189. );
  190. DWORD
  191. GetBestNextHopMaskGivenICB(
  192. PICB picb,
  193. DWORD dwNextHopAddr
  194. );
  195. DWORD
  196. GetBestNextHopMaskGivenIndex(
  197. DWORD dwIfIndex,
  198. DWORD dwNextHopAddr
  199. );
  200. DWORD
  201. InitializeLoopbackInterface(
  202. PICB picb
  203. );
  204. DWORD
  205. DeleteLoopbackInterface(
  206. VOID
  207. );
  208. DWORD
  209. LanEtcInterfaceInitToDown(
  210. PICB picb
  211. );
  212. DWORD
  213. ReadAddressFromRegistry(
  214. IN PWCHAR pwszIfName,
  215. OUT PDWORD pdwNumAddresses,
  216. OUT ICB_BINDING **ppibAddressInfo,
  217. IN BOOL bInternalIf
  218. );
  219. DWORD
  220. ReadAddressAndMaskValues(
  221. IN HKEY hkeyAdapterSection,
  222. IN PSZ pszRegAddressValue,
  223. IN PSZ pszRegMaskValue,
  224. OUT ICB_BINDING **ppibAddressInfo,
  225. OUT PDWORD pdwNumAddresses
  226. );
  227. DWORD
  228. ParseAddressAndMask(
  229. IN PBYTE pbyAddresses,
  230. IN DWORD dwAddressSize,
  231. IN PBYTE pbyMasks,
  232. IN DWORD dwMaskSize,
  233. OUT ICB_BINDING **ppibAddressInfo,
  234. OUT PDWORD pdwNumAddresses
  235. );
  236. DWORD
  237. SetInterfaceReceiveType(
  238. IN DWORD dwProtocolId,
  239. IN DWORD dwIfIndex,
  240. IN DWORD dwInterfaceReceiveType,
  241. IN BOOL bActivate
  242. );
  243. DWORD
  244. HandleMediaSenseEvent(
  245. IN PICB pIcb,
  246. IN BOOL bSensed
  247. );
  248. #define IS_ROUTABLE(ipAddr) ((ipAddr) != htonl(INADDR_LOOPBACK))
  249. DWORD
  250. GetRouterId(VOID);