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.

440 lines
10 KiB

  1. /*++
  2. Copyright (c) 1995-1999 Microsoft Corporation
  3. Module Name:
  4. ipxrtdef.h
  5. Abstract:
  6. This module contains the definitions of the:
  7. interface management APIs structures
  8. ipx global router management APIs structures
  9. ipx router MIB management APIs structures
  10. Author:
  11. Stefan Solomon 03/03/1995
  12. Revision History:
  13. --*/
  14. #ifndef _IPXRTDEF_
  15. #define _IPXRTDEF_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include <ipxconst.h>
  20. #include <ipxsap.h>
  21. #include <ipxrip.h>
  22. #include <stm.h>
  23. #include <ipxtfflt.h>
  24. //****************************************************************
  25. //*** ***
  26. //*** Global Definitions ***
  27. //*** ***
  28. //****************************************************************
  29. //
  30. // Version of this router
  31. //
  32. #define IPX_ROUTER_VERSION_1 RTR_INFO_BLOCK_VERSION
  33. //
  34. // IPX Protocols
  35. //
  36. #define IPX_PROTOCOL_LOCAL 1
  37. #define IPX_PROTOCOL_STATIC 2
  38. //
  39. // Interface Type Definitions for MIB reporting - these are mapped from the
  40. // DDM interface type
  41. //
  42. #define IF_TYPE_OTHER 1
  43. #define IF_TYPE_LAN 2
  44. #define IF_TYPE_WAN_ROUTER 3
  45. #define IF_TYPE_WAN_WORKSTATION 4 // remote workstation dialing in
  46. #define IF_TYPE_INTERNAL 5 // the internal (virtual) interface
  47. #define IF_TYPE_PERSONAL_WAN_ROUTER 6
  48. #define IF_TYPE_ROUTER_WORKSTATION_DIALOUT 7 // local workstation dialing out
  49. #define IF_TYPE_STANDALONE_WORKSTATION_DIALOUT 8
  50. //
  51. // Definitions for Table of Contents Entries Info Types
  52. //
  53. #define IPX_INTERFACE_INFO_TYPE 1
  54. #define IPX_STATIC_ROUTE_INFO_TYPE 2
  55. #define IPX_STATIC_SERVICE_INFO_TYPE 3
  56. #define IPX_SERVICE_FILTER_INFO_TYPE 4
  57. #define IPX_ROUTE_FILTER_INFO_TYPE 5
  58. #define IPX_IN_TRAFFIC_FILTER_INFO_TYPE 6
  59. #define IPX_ADAPTER_INFO_TYPE 7
  60. #define IPXWAN_INTERFACE_INFO_TYPE 8
  61. #define IPX_GLOBAL_INFO_TYPE 9
  62. #define IPX_STATIC_NETBIOS_NAME_INFO_TYPE 10
  63. #define IPX_IN_TRAFFIC_FILTER_GLOBAL_INFO_TYPE 11
  64. #define IPX_OUT_TRAFFIC_FILTER_INFO_TYPE 12
  65. #define IPX_OUT_TRAFFIC_FILTER_GLOBAL_INFO_TYPE 13
  66. //****************************************************************
  67. //*** ***
  68. //*** Specific Info Structures In The Information Block ***
  69. //*** ***
  70. //****************************************************************
  71. //*** IPX Router Manager Global Info ***
  72. #define IPX_SMALL_ROUTING_TABLE_HASH_SIZE 31
  73. #define IPX_MEDIUM_ROUTING_TABLE_HASH_SIZE 257
  74. #define IPX_LARGE_ROUTING_TABLE_HASH_SIZE 2047
  75. typedef struct _IPX_GLOBAL_INFO {
  76. ULONG RoutingTableHashSize;
  77. ULONG EventLogMask;
  78. } IPX_GLOBAL_INFO, *PIPX_GLOBAL_INFO;
  79. //*** IPX Interface Info ***
  80. typedef struct _IPX_IF_INFO {
  81. ULONG AdminState; // The desired state of the interface
  82. ULONG NetbiosAccept; // Accept Netbios broadcast packets
  83. ULONG NetbiosDeliver; // Deliver Netbios broadcast packets
  84. } IPX_IF_INFO, *PIPX_IF_INFO;
  85. // Interface Device Type Definitions
  86. #define IPX_DEDICATED_LINK 1 // includes LAN, leased lines, frame-relay
  87. #define IPX_DIALED_LINK 2 // dial on demand links
  88. // Default values:
  89. //
  90. // AdminState: enabled - disabling it disables also RIP, SAP and anything else
  91. // NetbiosAccept: enabled
  92. // NetbiosDeliver: enabled on LAN interface, disabled on WAN interface
  93. // IpxWanNegotiation: disabled.
  94. // The interface name corresponds to the local adapter name in the case the
  95. // interface is the local LAN. If the adapter is multiplexed with different
  96. // packet types, there is a unique net number assigned to each pseudo-adapter.
  97. // In this case the NetNumber is used to differentiate which pseudo-adapter gets
  98. // this interface info.
  99. //*** IPXWAN Interface Info ***
  100. typedef struct _IPXWAN_IF_INFO {
  101. ULONG AdminState; // Enable/Disable IPXWAN negotiation
  102. } IPXWAN_IF_INFO, *PIPXWAN_IF_INFO;
  103. //*** Static Route Entry ***
  104. typedef struct _IPX_STATIC_ROUTE_INFO {
  105. union {
  106. ULONG DwordAlign;
  107. UCHAR Network[4]; };
  108. USHORT TickCount;
  109. USHORT HopCount;
  110. UCHAR NextHopMacAddress[6];
  111. } IPX_STATIC_ROUTE_INFO, *PIPX_STATIC_ROUTE_INFO;
  112. //*** Static Service Entry ***
  113. typedef IPX_SERVER_ENTRY IPX_STATIC_SERVICE_INFO, *PIPX_STATIC_SERVICE_INFO;
  114. //*** Static Netbios Name Entry ***
  115. typedef struct _IPX_STATIC_NETBIOS_NAME_INFO {
  116. union {
  117. ULONG DwordAlign;
  118. UCHAR Name[16]; };
  119. } IPX_STATIC_NETBIOS_NAME_INFO, *PIPX_STATIC_NETBIOS_NAME_INFO;
  120. //
  121. // *** IPX LAN ADAPTER INFO ***
  122. //
  123. #define MAX_ADAPTER_NAME_LEN 48
  124. typedef struct _IPX_ADAPTER_INFO {
  125. ULONG PacketType;
  126. WCHAR AdapterName[MAX_ADAPTER_NAME_LEN];
  127. } IPX_ADAPTER_INFO, *PIPX_ADAPTER_INFO;
  128. #define AUTO_DETECT_PACKET_TYPE 0xFFFFFFFF
  129. // ***********************************************************
  130. // *** ***
  131. // *** IPX MIB Table Identifiers ***
  132. // *** ***
  133. // ***********************************************************
  134. #define IPX_BASE_ENTRY 0
  135. #define IPX_INTERFACE_TABLE 1
  136. #define IPX_DEST_TABLE 2 // IPX Best Routes Table
  137. #define IPX_STATIC_ROUTE_TABLE 3 // IPX Static Routes Table
  138. #define IPX_SERV_TABLE 4 // IPX Services Table
  139. #define IPX_STATIC_SERV_TABLE 5 // IPX Static Services Table
  140. #define MAX_IPX_MIB_TABLES 6
  141. //
  142. // Some Global MIB Constants
  143. //
  144. // max size of the interface readable name
  145. #define IPX_INTERFACE_ANSI_NAME_LEN 48
  146. // ***************************************************************************
  147. //
  148. // *** IPX MIB APIs Input/Output Structures For Each Table ***
  149. //
  150. //****************************************************************************
  151. // Global definition of the MIB Identifier (locates the table and the row index)
  152. typedef struct _IF_TABLE_INDEX {
  153. ULONG InterfaceIndex;
  154. } IF_TABLE_INDEX, *PIF_TABLE_INDEX;
  155. typedef struct _ROUTING_TABLE_INDEX {
  156. UCHAR Network[4];
  157. } ROUTING_TABLE_INDEX, *PROUTING_TABLE_INDEX;
  158. typedef struct _STATIC_ROUTES_TABLE_INDEX {
  159. ULONG InterfaceIndex;
  160. UCHAR Network[4];
  161. } STATIC_ROUTES_TABLE_INDEX, *PSTATIC_ROUTES_TABLE_INDEX;
  162. typedef struct _SERVICES_TABLE_INDEX {
  163. USHORT ServiceType;
  164. UCHAR ServiceName[48];
  165. } SERVICES_TABLE_INDEX, *PSERVICES_TABLE_INDEX;
  166. typedef struct _STATIC_SERVICES_TABLE_INDEX {
  167. ULONG InterfaceIndex;
  168. USHORT ServiceType;
  169. UCHAR ServiceName[48];
  170. } STATIC_SERVICES_TABLE_INDEX, *PSTATIC_SERVICES_TABLE_INDEX;
  171. typedef union _IPX_MIB_INDEX {
  172. IF_TABLE_INDEX InterfaceTableIndex;
  173. ROUTING_TABLE_INDEX RoutingTableIndex;
  174. STATIC_ROUTES_TABLE_INDEX StaticRoutesTableIndex;
  175. SERVICES_TABLE_INDEX ServicesTableIndex;
  176. STATIC_SERVICES_TABLE_INDEX StaticServicesTableIndex;
  177. } IPX_MIB_INDEX, *PIPX_MIB_INDEX;
  178. //**********************************************************************
  179. // *
  180. // INPUT DATA For: Get, GetFirst, GetNext *
  181. // *
  182. //**********************************************************************
  183. typedef struct _IPX_MIB_GET_INPUT_DATA {
  184. ULONG TableId;
  185. IPX_MIB_INDEX MibIndex;
  186. } IPX_MIB_GET_INPUT_DATA, *PIPX_MIB_GET_INPUT_DATA;
  187. typedef struct _IPXMIB_BASE {
  188. ULONG OperState;
  189. UCHAR PrimaryNetNumber[4];
  190. UCHAR Node[6];
  191. UCHAR SysName[IPX_INTERFACE_ANSI_NAME_LEN];
  192. ULONG MaxPathSplits;
  193. ULONG IfCount;
  194. ULONG DestCount;
  195. ULONG ServCount;
  196. } IPXMIB_BASE, *PIPXMIB_BASE;
  197. // structure used to gather interface statistics
  198. typedef struct _IPX_IF_STATS {
  199. ULONG IfOperState;
  200. ULONG MaxPacketSize;
  201. ULONG InHdrErrors;
  202. ULONG InFiltered;
  203. ULONG InNoRoutes;
  204. ULONG InDiscards;
  205. ULONG InDelivers;
  206. ULONG OutFiltered;
  207. ULONG OutDiscards;
  208. ULONG OutDelivers;
  209. ULONG NetbiosReceived;
  210. ULONG NetbiosSent;
  211. } IPX_IF_STATS, *PIPX_IF_STATS;
  212. // structure describing the MIB Row for the IPX_INTERFACE_TABLE in the
  213. // IPX_INTERFACE_GROUP
  214. typedef struct _IPX_INTERFACE {
  215. ULONG InterfaceIndex;
  216. ULONG AdminState;
  217. ULONG AdapterIndex;
  218. UCHAR InterfaceName[IPX_INTERFACE_ANSI_NAME_LEN];
  219. ULONG InterfaceType;
  220. ULONG MediaType;
  221. UCHAR NetNumber[4];
  222. UCHAR MacAddress[6];
  223. ULONG Delay;
  224. ULONG Throughput;
  225. ULONG NetbiosAccept;
  226. ULONG NetbiosDeliver;
  227. ULONG EnableIpxWanNegotiation;
  228. IPX_IF_STATS IfStats;
  229. } IPX_INTERFACE, *PIPX_INTERFACE;
  230. typedef struct _IPX_ROUTE {
  231. ULONG InterfaceIndex; // see ipxconst.h for specific indices definitions
  232. ULONG Protocol;
  233. UCHAR Network[4];
  234. USHORT TickCount;
  235. USHORT HopCount;
  236. UCHAR NextHopMacAddress[6];
  237. ULONG Flags;
  238. } IPX_ROUTE, *PIPX_ROUTE;
  239. //
  240. // INPUT DATA For: Create, Delete, Set
  241. //
  242. typedef union _IPX_MIB_ROW {
  243. IPX_INTERFACE Interface;
  244. IPX_ROUTE Route;
  245. IPX_SERVICE Service;
  246. } IPX_MIB_ROW, *PIPX_MIB_ROW;
  247. typedef struct _IPX_MIB_SET_INPUT_DATA {
  248. ULONG TableId;
  249. IPX_MIB_ROW MibRow;
  250. } IPX_MIB_SET_INPUT_DATA, *PIPX_MIB_SET_INPUT_DATA;
  251. //
  252. // *** IPX Base Entry ***
  253. //
  254. // MIB Functions: Get
  255. // INPUT DATA: IPX_MIB_GET_INPUT_DATA and Index is not used
  256. // OUTPUT DATA:
  257. //
  258. // *** IPX Interface Table ***
  259. //
  260. // MIB Functions: Get, GetFirst, GetNext, Set
  261. // INPUT DATA: IPX_MIB_GET_INPUT_DATA and Index is IF_TABLE_INDEX for Get, GetFirst and GetNext
  262. // IPX_MIB_SET_INPUT_DATA and MibRow is IPX_INTERFACE for Set
  263. //
  264. // OUTPUT DATA: described by the IPX_INTERFACE structure below
  265. //
  266. //
  267. // *** IPX Routes Table ***
  268. //
  269. // MIB Functions: Get, GetFirst, GetNext
  270. // INPUT DATA: IPX_MIB_INPUT_DATA with Index ROUTES_TABLE_INDEX
  271. // OUTPUT DATA: IPX_ROUTE
  272. //
  273. //
  274. // *** IPX Static Routes Table ***
  275. //
  276. // MIB Functions: Create, Delete, Get, GetFirst, GetNext, Set
  277. // INPUT DATA: IPX_MIB_GET_INPUT_DATA with Index STATIC_ROUTES_TABLE_INDEX for Get, GetFirst, GetNext
  278. // IPX_MIB_SET_INPUT_DATA and MibRow is IPX_ROUTE for Create, Delete, Set
  279. // OUTPUT DATA: IPX_ROUTE
  280. //
  281. //
  282. // *** IPX Services Table ***
  283. //
  284. // MIB Functions: Get, GetFirst, GetNext
  285. // INPUT DATA: IPX_MIB_INPUT_DATA with Index SERVICES_TABLE_INDEX
  286. // OUTPUT DATA: The output data is the structure IPX_SERVICE
  287. //
  288. // *** IPX Static Services Table ***
  289. //
  290. // MIB Functions: Create, Delete, Get, GetFirst, GetNext
  291. // INPUT DATA: IPX_MIB_GET_INPUT_DATA with Index STATIC_SERVICES_TABLE_INDEX for Get, GetFirst, GetNext
  292. // IPX_MIB_SET_INPUT_DATA and MibRow is IPX_SERVICE for Create, Delete and Set.
  293. // OUTPUT DATA: IPX_SERVICE
  294. #endif // _IPXRTDEF_