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