home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / ipxrtdef.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  10.8 KB  |  443 lines

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