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.

329 lines
6.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. nteapi.h
  5. Abstract:
  6. Definitions of routines for manipulating dynamic IP Network Table
  7. Entries (NTEs) and NBT devices (interfaces).
  8. Author:
  9. Mike Massa (mikemas) 18-Mar-1996
  10. Environment:
  11. User Mode - Win32
  12. Revision History:
  13. --*/
  14. #ifndef _NTEAPI_INCLUDED_
  15. #define _NTEAPI_INCLUDED_
  16. //
  17. // Types
  18. //
  19. typedef struct {
  20. unsigned long Instance;
  21. IPAddr Address;
  22. IPMask SubnetMask;
  23. unsigned long Flags;
  24. } TCPIP_NTE_INFO, *PTCPIP_NTE_INFO;
  25. #define TCPIP_NTE_DYNAMIC 0x00000010
  26. //
  27. // APIs
  28. //
  29. DWORD
  30. TcpipAddNTE(
  31. IN LPWSTR AdapterName,
  32. IN IPAddr Address,
  33. IN IPMask SubnetMask,
  34. OUT PULONG NTEContext,
  35. OUT PULONG NTEInstance
  36. );
  37. /*++
  38. Routine Description:
  39. Adds a new NTE to a specified IP interface. The target IP interface is
  40. identified by the name of the adapter associated with it.
  41. Arguments:
  42. AdapterName - A unicode string identifying the adapter/interface to which
  43. to add the new NTE.
  44. Address - The IP address to assign to the new NTE.
  45. SubnetMask - The IP subnet mask to assign to the new NTE.
  46. NTEContext - On output, contains the context value identifying the new NTE.
  47. NTEInstance - On output, contains the instance ID of the new NTE.
  48. Return Value:
  49. ERROR_SUCCESS if the operation was successful.
  50. A Windows error code otherwise.
  51. --*/
  52. DWORD
  53. TcpipDeleteNTE(
  54. IN ULONG NTEContext
  55. );
  56. /*++
  57. Routine Description:
  58. Deletes a specified NTE. The target NTE must have been added using
  59. TcpipAddNTE.
  60. Arguments:
  61. NTEContext - The context value identifying the NTE to delete.
  62. Return Value:
  63. ERROR_SUCCESS if the operation was successful.
  64. A Windows error code otherwise.
  65. --*/
  66. DWORD
  67. TcpipSetNTEAddress(
  68. IN DWORD NTEContext,
  69. IN IPAddr Address,
  70. IN IPMask SubnetMask
  71. );
  72. /*++
  73. Routine Description:
  74. Sets the address of a specified NTE.
  75. Arguments:
  76. NTEContext - The context value identifying the target NTE.
  77. Address - The IP address to assign to the NTE. Assigning 0.0.0.0
  78. invalidates the NTE.
  79. SubnetMask - The IP subnet mask to assign to the NTE.
  80. Return Value:
  81. ERROR_SUCCESS if the operation was successful.
  82. A Windows error code otherwise.
  83. --*/
  84. DWORD
  85. TcpipGetNTEInfo(
  86. IN ULONG NTEContext,
  87. OUT PTCPIP_NTE_INFO NTEInfo
  88. );
  89. /*++
  90. Routine Description:
  91. Gathers information about a specified NTE.
  92. Arguments:
  93. NTEContext - The context value identifying the NTE to query.
  94. Return Value:
  95. ERROR_SUCCESS if the operation was successful.
  96. A Windows error code otherwise.
  97. --*/
  98. DWORD
  99. NbtAddInterface(
  100. OUT LPWSTR DeviceName,
  101. IN OUT LPDWORD DeviceNameSize,
  102. OUT PULONG DeviceInstance
  103. );
  104. /*++
  105. Routine Description:
  106. Adds a new NBT interface.
  107. Arguments:
  108. DeviceName - A unicode string identifying the new NBT interface.
  109. DeviceNameSize - On input, the size of theh device name buffer.
  110. On output, the size of the device name string, or
  111. the size needed to accomodate the string.
  112. DeviceInstance - A pointer to a variable into which to place the
  113. instance ID associated with the new interface.
  114. Return Value:
  115. ERROR_SUCCESS if the operation was successful.
  116. A Windows error code otherwise.
  117. --*/
  118. DWORD
  119. NbtDeleteInterface(
  120. IN LPWSTR DeviceName
  121. );
  122. /*++
  123. Routine Description:
  124. Deletes an NBT interface.
  125. Arguments:
  126. DeviceName - A unicode string identifying the target NBT interface.
  127. Return Value:
  128. ERROR_SUCCESS if the operation was successful.
  129. A Windows error code otherwise.
  130. --*/
  131. DWORD
  132. NbtBindInterface(
  133. IN LPWSTR DeviceName,
  134. IN IPAddr Address,
  135. IN IPMask SubnetMask
  136. );
  137. /*++
  138. Routine Description:
  139. Binds a specified NBT interface to a specified IP address.
  140. Arguments:
  141. DeviceName - A unicode string identifying the target NBT interface.
  142. Address - The IP address to which bind the interface. Assigning 0.0.0.0
  143. invalidates the interface.
  144. SubnetMask - The subnet mask of the IP interface.
  145. Return Value:
  146. ERROR_SUCCESS if the operation was successful.
  147. A Windows error code otherwise.
  148. --*/
  149. DWORD
  150. NbtSetWinsAddrInterface(
  151. IN LPWSTR DeviceName,
  152. IN IPAddr PrWinsAddress,
  153. IN IPAddr SecWinsAddress
  154. );
  155. /*++
  156. Routine Description:
  157. Sets the WINS addrs for a given Nbt Interface.
  158. Arguments:
  159. DeviceName - A unicode string identifying the target NBT interface.
  160. PrWinsAddress - Primary WINS addr
  161. SecWinsAddress - Secondary WINS addr
  162. Return Value:
  163. ERROR_SUCCESS if the operation was successful.
  164. A Windows error code otherwise.
  165. --*/
  166. DWORD
  167. NbtGetInterfaceInfo(
  168. IN LPWSTR DeviceName,
  169. OUT IPAddr * Address,
  170. OUT PULONG DeviceInstance
  171. );
  172. /*++
  173. Routine Description:
  174. Returns the IP address to which an NBT interface is bound and the interface
  175. instance ID.
  176. Arguments:
  177. DeviceName - A unicode string identifying the target NBT interface.
  178. Address - A pointer to the location in which to store the address of the
  179. interface.
  180. DeviceInstance - A pointer to the location in which to store the instance ID
  181. associated with the interface.
  182. Return Value:
  183. ERROR_SUCCESS if the operation was successful.
  184. A Windows error code otherwise.
  185. --*/
  186. DWORD
  187. NbtGetWinsAddresses(
  188. IN LPWSTR DeviceName,
  189. OUT IPAddr * PrimaryWinsServer,
  190. OUT IPAddr * SecondaryWinsServer
  191. );
  192. /*++
  193. Routine Description:
  194. Returns the addresses of the WINS servers for which the specified device
  195. is configured.
  196. Arguments:
  197. DeviceName - A unicode string identifying the target NBT interface.
  198. PrimaryWinsServer - A pointer to a variable into which to place the address
  199. of the primary WINS server.
  200. SecondaryWinsServer - A pointer to a variable into which to place the address
  201. of the primary WINS server.
  202. Return Value:
  203. ERROR_SUCCESS if the operation was successful.
  204. A Windows error code otherwise.
  205. --*/
  206. #endif // ifndef _NTEAPI_INCLUDED_
  207.