home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / IPXRTDEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  10.8 KB  |  439 lines

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