JwaIpRtrMib.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:41k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Management Information Base API interface Unit for Object Pascal             }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: iprtrmib.h, released August 2001. The original Pascal  }
  9. { code is: IpRtrMib.pas, released September 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Contributor(s): John C. Penman (jcp@craiglockhart.com)                       }
  16. {                 Vladimir Vassiliev (voldemarv@hotpop.com)                    }
  17. {                 }
  18. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  19. {                }
  20. { You may retrieve the latest version of this file at the Project JEDI home    }
  21. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  22. { http://members.chello.nl/m.vanbrakel2                                        }
  23. {                }
  24. { The contents of this file are used with permission, subject to the Mozilla   }
  25. { Public License Version 1.1 (the "License"); you may not use this file except }
  26. { in compliance with the License. You may obtain a copy of the License at      }
  27. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  28. {                                                                              }
  29. { Software distributed under the License is distributed on an "AS IS" basis,   }
  30. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  31. { the specific language governing rights and limitations under the License.    }
  32. {                                                                              }
  33. { Alternatively, the contents of this file may be used under the terms of the  }
  34. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  35. { provisions of the LGPL License are applicable instead of those above.        }
  36. { If you wish to allow use of your version of this file only under the terms   }
  37. { of the LGPL License and not to allow others to use your version of this file }
  38. { under the MPL, indicate your decision by deleting  the provisions above and  }
  39. { replace  them with the notice and other provisions required by the LGPL      }
  40. { License.  If you do not delete the provisions above, a recipient may use     }
  41. { your version of this file under either the MPL or the LGPL License.          }
  42. {                 }
  43. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  44. {                 }
  45. {******************************************************************************}
  46. unit JwaIpRtrMib;
  47. {$WEAKPACKAGEUNIT}
  48. {$HPPEMIT ''}
  49. {$HPPEMIT '#include "iprtrmib.h"'}
  50. {$HPPEMIT ''}
  51. {$I WINDEFINES.INC}
  52. interface
  53. uses
  54.   JwaWinType;
  55. //////////////////////////////////////////////////////////////////////////////
  56. //                                                                          //
  57. // Included to get the value of MAX_INTERFACE_NAME_LEN                      //
  58. //                                                                          //
  59. //////////////////////////////////////////////////////////////////////////////
  60. // #include <mprapi.h>
  61. //////////////////////////////////////////////////////////////////////////////
  62. //                                                                          //
  63. // Included to get the necessary constants                                  //
  64. //                                                                          //
  65. //////////////////////////////////////////////////////////////////////////////
  66. // #include <ipifcons.h>
  67. //////////////////////////////////////////////////////////////////////////////
  68. //                                                                          //
  69. // This is the Id for IP Router Manager.  The Router Manager handles        //
  70. // MIB-II, Forwarding MIB and some enterprise specific information.         //
  71. // Calls made with any other ID are passed on to the corresponding protocol //
  72. // For example, an MprAdminMIBXXX call with a protocol ID of PID_IP and    //
  73. // a routing Id of 0xD will be sent to the IP Router Manager and then       //
  74. // forwarded to OSPF                                                        //
  75. // This lives in the same number space as the protocol Ids of RIP, OSPF     //
  76. // etc, so any change made to it should be done keeping this in mind        //
  77. //                                                                          //
  78. //////////////////////////////////////////////////////////////////////////////
  79. const
  80.   MAX_INTERFACE_NAME_LEN = 256; // MPRAPI.H
  81.   {$EXTERNALSYM MAX_INTERFACE_NAME_LEN}
  82.   
  83.   IPRTRMGR_PID = 10000;
  84.   {$EXTERNALSYM IPRTRMGR_PID}
  85.   ANY_SIZE = 1;
  86.   {$EXTERNALSYM ANY_SIZE}
  87. //////////////////////////////////////////////////////////////////////////////
  88. //                                                                          //
  89. // The following #defines are the Ids of the MIB variables made accessible  //
  90. // to the user via MprAdminMIBXXX Apis.  It will be noticed that these are  //
  91. // not the same as RFC 1213, since the MprAdminMIBXXX APIs work on rows and //
  92. // groups instead of scalar variables                                       //
  93. //                                                                          //
  94. //////////////////////////////////////////////////////////////////////////////
  95.   IF_NUMBER        = 0;
  96.   {$EXTERNALSYM IF_NUMBER}
  97.   IF_TABLE         = IF_NUMBER + 1;
  98.   {$EXTERNALSYM IF_TABLE}
  99.   IF_ROW           = IF_TABLE + 1;
  100.   {$EXTERNALSYM IF_ROW}
  101.   IP_STATS         = IF_ROW + 1;
  102.   {$EXTERNALSYM IP_STATS}
  103.   IP_ADDRTABLE     = IP_STATS + 1;
  104.   {$EXTERNALSYM IP_ADDRTABLE}
  105.   IP_ADDRROW       = IP_ADDRTABLE + 1;
  106.   {$EXTERNALSYM IP_ADDRROW}
  107.   IP_FORWARDNUMBER = IP_ADDRROW + 1;
  108.   {$EXTERNALSYM IP_FORWARDNUMBER}
  109.   IP_FORWARDTABLE  = IP_FORWARDNUMBER + 1;
  110.   {$EXTERNALSYM IP_FORWARDTABLE}
  111.   IP_FORWARDROW    = IP_FORWARDTABLE + 1;
  112.   {$EXTERNALSYM IP_FORWARDROW}
  113.   IP_NETTABLE      = IP_FORWARDROW + 1;
  114.   {$EXTERNALSYM IP_NETTABLE}
  115.   IP_NETROW        = IP_NETTABLE + 1;
  116.   {$EXTERNALSYM IP_NETROW}
  117.   ICMP_STATS       = IP_NETROW + 1;
  118.   {$EXTERNALSYM ICMP_STATS}
  119.   TCP_STATS        = ICMP_STATS + 1;
  120.   {$EXTERNALSYM TCP_STATS}
  121.   TCP_TABLE        = TCP_STATS + 1;
  122.   {$EXTERNALSYM TCP_TABLE}
  123.   TCP_ROW          = TCP_TABLE + 1;
  124.   {$EXTERNALSYM TCP_ROW}
  125.   UDP_STATS        = TCP_ROW + 1;
  126.   {$EXTERNALSYM UDP_STATS}
  127.   UDP_TABLE        = UDP_STATS + 1;
  128.   {$EXTERNALSYM UDP_TABLE}
  129.   UDP_ROW          = UDP_TABLE + 1;
  130.   {$EXTERNALSYM UDP_ROW}
  131.   MCAST_MFE        = UDP_ROW + 1;
  132.   {$EXTERNALSYM MCAST_MFE}
  133.   MCAST_MFE_STATS  = MCAST_MFE + 1;
  134.   {$EXTERNALSYM MCAST_MFE_STATS}
  135.   BEST_IF          = MCAST_MFE_STATS + 1;
  136.   {$EXTERNALSYM BEST_IF}
  137.   BEST_ROUTE       = BEST_IF + 1;
  138.   {$EXTERNALSYM BEST_ROUTE}
  139.   PROXY_ARP        = BEST_ROUTE + 1;
  140.   {$EXTERNALSYM PROXY_ARP}
  141.   MCAST_IF_ENTRY   = PROXY_ARP + 1;
  142.   {$EXTERNALSYM MCAST_IF_ENTRY}
  143.   MCAST_GLOBAL     = MCAST_IF_ENTRY + 1;
  144.   {$EXTERNALSYM MCAST_GLOBAL}
  145.   IF_STATUS        = MCAST_GLOBAL + 1;
  146.   {$EXTERNALSYM IF_STATUS}
  147.   MCAST_BOUNDARY   = IF_STATUS + 1;
  148.   {$EXTERNALSYM MCAST_BOUNDARY}
  149.   MCAST_SCOPE      = MCAST_BOUNDARY + 1;
  150.   {$EXTERNALSYM MCAST_SCOPE}
  151.   DEST_MATCHING    = MCAST_SCOPE + 1;
  152.   {$EXTERNALSYM DEST_MATCHING}
  153.   DEST_LONGER      = DEST_MATCHING + 1;
  154.   {$EXTERNALSYM DEST_LONGER}
  155.   DEST_SHORTER     = DEST_LONGER + 1;
  156.   {$EXTERNALSYM DEST_SHORTER}
  157.   ROUTE_MATCHING   = DEST_SHORTER + 1;
  158.   {$EXTERNALSYM ROUTE_MATCHING}
  159.   ROUTE_LONGER     = ROUTE_MATCHING + 1;
  160.   {$EXTERNALSYM ROUTE_LONGER}
  161.   ROUTE_SHORTER    = ROUTE_LONGER + 1;
  162.   {$EXTERNALSYM ROUTE_SHORTER}
  163.   ROUTE_STATE      = ROUTE_SHORTER + 1;
  164.   {$EXTERNALSYM ROUTE_STATE}
  165.   MCAST_MFE_STATS_EX = ROUTE_STATE + 1;
  166.   {$EXTERNALSYM MCAST_MFE_STATS_EX}
  167.   IP6_STATS          = MCAST_MFE_STATS_EX + 1;
  168.   {$EXTERNALSYM IP6_STATS}
  169.   UDP6_STATS         = IP6_STATS + 1;
  170.   {$EXTERNALSYM UDP6_STATS}
  171.   TCP6_STATS         = UDP6_STATS + 1;
  172.   {$EXTERNALSYM TCP6_STATS}
  173.   NUMBER_OF_EXPORTED_VARIABLES = TCP6_STATS + 1;
  174.   {$EXTERNALSYM NUMBER_OF_EXPORTED_VARIABLES}
  175. //////////////////////////////////////////////////////////////////////////////
  176. //                                                                          //
  177. // MIB_OPAQUE_QUERY is the structure filled in by the user to identify a    //
  178. // MIB variable                                                             //
  179. //                                                                          //
  180. //  dwVarId     ID of MIB Variable (One of the Ids #defined above)          //
  181. //  dwVarIndex  Variable sized array containing the indices needed to       //
  182. //              identify a variable. NOTE: Unlike SNMP we dont require that //
  183. //              a scalar variable be indexed by 0                           //
  184. //                                                                          //
  185. //////////////////////////////////////////////////////////////////////////////
  186. type
  187.   PMIB_OPAQUE_QUERY = ^MIB_OPAQUE_QUERY;
  188.   {$EXTERNALSYM PMIB_OPAQUE_QUERY}
  189.   _MIB_OPAQUE_QUERY = record
  190.     dwVarId: DWORD;
  191.     rgdwVarIndex: array [0..ANY_SIZE - 1] of DWORD;
  192.   end;
  193.   {$EXTERNALSYM _MIB_OPAQUE_QUERY}
  194.   MIB_OPAQUE_QUERY = _MIB_OPAQUE_QUERY;
  195.   {$EXTERNALSYM MIB_OPAQUE_QUERY}
  196.   TMibOpaqueQuery = MIB_OPAQUE_QUERY;
  197.   PMibOpaqueQuery = PMIB_OPAQUE_QUERY;
  198. //////////////////////////////////////////////////////////////////////////////
  199. //                                                                          //
  200. // The following are the structures which are filled in and returned to the //
  201. // user when a query is made, OR  are filled in BY THE USER when a set is   //
  202. // done                                                                     //
  203. //                                                                          //
  204. //////////////////////////////////////////////////////////////////////////////
  205. type
  206.   PMIB_IFNUMBER = ^MIB_IFNUMBER;
  207.   {$EXTERNALSYM PMIB_IFNUMBER}
  208.   _MIB_IFNUMBER = record
  209.     dwValue: DWORD;
  210.   end;
  211.   {$EXTERNALSYM _MIB_IFNUMBER}
  212.   MIB_IFNUMBER = _MIB_IFNUMBER;
  213.   {$EXTERNALSYM MIB_IFNUMBER}
  214.   TMibIfnumber = MIB_IFNUMBER;
  215.   PMibIfnumber = PMIB_IFNUMBER;
  216. const
  217.   MAXLEN_IFDESCR  = 256;
  218.   {$EXTERNALSYM MAXLEN_IFDESCR}
  219.   MAXLEN_PHYSADDR = 8;
  220.   {$EXTERNALSYM MAXLEN_PHYSADDR}
  221. type
  222.   PMIB_IFROW = ^MIB_IFROW;
  223.   {$EXTERNALSYM PMIB_IFROW}
  224.   _MIB_IFROW = record
  225.     wszName: array [0..MAX_INTERFACE_NAME_LEN - 1] of WCHAR;
  226.     dwIndex: DWORD;
  227.     dwType: DWORD;
  228.     dwMtu: DWORD;
  229.     dwSpeed: DWORD;
  230.     dwPhysAddrLen: DWORD;
  231.     bPhysAddr: array [0..MAXLEN_PHYSADDR - 1] of BYTE;
  232.     dwAdminStatus: DWORD;
  233.     dwOperStatus: DWORD;
  234.     dwLastChange: DWORD;
  235.     dwInOctets: DWORD;
  236.     dwInUcastPkts: DWORD;
  237.     dwInNUcastPkts: DWORD;
  238.     dwInDiscards: DWORD;
  239.     dwInErrors: DWORD;
  240.     dwInUnknownProtos: DWORD;
  241.     dwOutOctets: DWORD;
  242.     dwOutUcastPkts: DWORD;
  243.     dwOutNUcastPkts: DWORD;
  244.     dwOutDiscards: DWORD;
  245.     dwOutErrors: DWORD;
  246.     dwOutQLen: DWORD;
  247.     dwDescrLen: DWORD;
  248.     bDescr: array[0..MAXLEN_IFDESCR - 1] of BYTE;
  249.   end;
  250.   {$EXTERNALSYM _MIB_IFROW}
  251.   MIB_IFROW = _MIB_IFROW;
  252.   {$EXTERNALSYM MIB_IFROW}
  253.   TMibIfRow = MIB_IFROW;
  254.   PMibIfRow = PMIB_IFROW;
  255.   PMIB_IFTABLE = ^MIB_IFTABLE;
  256.   {$EXTERNALSYM PMIB_IFTABLE}
  257.   _MIB_IFTABLE = record
  258.     dwNumEntries: DWORD;
  259.     table: array [0..ANY_SIZE - 1] of MIB_IFROW;
  260.   end;
  261.   {$EXTERNALSYM _MIB_IFTABLE}
  262.   MIB_IFTABLE = _MIB_IFTABLE;
  263.   {$EXTERNALSYM MIB_IFTABLE}
  264.   TMibIftable = MIB_IFTABLE;
  265.   PMibIftable = PMIB_IFTABLE;
  266. // #define SIZEOF_IFTABLE(X) (FIELD_OFFSET(MIB_IFTABLE,table[0]) + ((X) * sizeof(MIB_IFROW)) + ALIGN_SIZE)
  267. type
  268.   PMibIcmpStats = ^TMibIcmpStats;
  269.   _MIBICMPSTATS = record
  270.     dwMsgs: DWORD;
  271.     dwErrors: DWORD;
  272.     dwDestUnreachs: DWORD;
  273.     dwTimeExcds: DWORD;
  274.     dwParmProbs: DWORD;
  275.     dwSrcQuenchs: DWORD;
  276.     dwRedirects: DWORD;
  277.     dwEchos: DWORD;
  278.     dwEchoReps: DWORD;
  279.     dwTimestamps: DWORD;
  280.     dwTimestampReps: DWORD;
  281.     dwAddrMasks: DWORD;
  282.     dwAddrMaskReps: DWORD;
  283.   end;
  284.   {$EXTERNALSYM _MIBICMPSTATS}
  285.   MIBICMPSTATS = _MIBICMPSTATS;
  286.   {$EXTERNALSYM MIBICMPSTATS}
  287.   TMibIcmpStats = _MIBICMPSTATS;
  288.   _MIBICMPINFO = record
  289.     icmpInStats: MIBICMPSTATS;
  290.     icmpOutStats: MIBICMPSTATS;
  291.   end;
  292.   {$EXTERNALSYM _MIBICMPINFO}
  293.   MIBICMPINFO = _MIBICMPINFO;
  294.   {$EXTERNALSYM MIBICMPINFO}
  295.   PMIBICMPINFO = ^MIBICMPINFO;
  296.   {$EXTERNALSYM PMIBICMPINFO}
  297.   TMibIcmpInfo = MIBICMPINFO;
  298.   PMIB_ICMP = ^MIB_ICMP;
  299.   {$EXTERNALSYM PMIB_ICMP}
  300.   _MIB_ICMP = record
  301.     stats: MIBICMPINFO;
  302.   end;
  303.   {$EXTERNALSYM _MIB_ICMP}
  304.   MIB_ICMP = _MIB_ICMP;
  305.   {$EXTERNALSYM MIB_ICMP}
  306.   TMibIcmp = MIB_ICMP;
  307.   PMibIcmp = PMIB_ICMP;
  308. //
  309. // ICMPv6 Type Values from RFC 2292.
  310. //
  311. const
  312.   ICMP6_DST_UNREACH          = 1;
  313.   {$EXTERNALSYM ICMP6_DST_UNREACH}
  314.   ICMP6_PACKET_TOO_BIG       = 2;
  315.   {$EXTERNALSYM ICMP6_PACKET_TOO_BIG}
  316.   ICMP6_TIME_EXCEEDED        = 3;
  317.   {$EXTERNALSYM ICMP6_TIME_EXCEEDED}
  318.   ICMP6_PARAM_PROB           = 4;
  319.   {$EXTERNALSYM ICMP6_PARAM_PROB}
  320.   ICMP6_ECHO_REQUEST         = 128;
  321.   {$EXTERNALSYM ICMP6_ECHO_REQUEST}
  322.   ICMP6_ECHO_REPLY           = 129;
  323.   {$EXTERNALSYM ICMP6_ECHO_REPLY}
  324.   ICMP6_MEMBERSHIP_QUERY     = 130;
  325.   {$EXTERNALSYM ICMP6_MEMBERSHIP_QUERY}
  326.   ICMP6_MEMBERSHIP_REPORT    = 131;
  327.   {$EXTERNALSYM ICMP6_MEMBERSHIP_REPORT}
  328.   ICMP6_MEMBERSHIP_REDUCTION = 132;
  329.   {$EXTERNALSYM ICMP6_MEMBERSHIP_REDUCTION}
  330.   ND_ROUTER_SOLICIT          = 133;
  331.   {$EXTERNALSYM ND_ROUTER_SOLICIT}
  332.   ND_ROUTER_ADVERT           = 134;
  333.   {$EXTERNALSYM ND_ROUTER_ADVERT}
  334.   ND_NEIGHBOR_SOLICIT        = 135;
  335.   {$EXTERNALSYM ND_NEIGHBOR_SOLICIT}
  336.   ND_NEIGHBOR_ADVERT         = 136;
  337.   {$EXTERNALSYM ND_NEIGHBOR_ADVERT}
  338.   ND_REDIRECT                = 137;
  339.   {$EXTERNALSYM ND_REDIRECT}
  340. type
  341.   ICMP6_TYPE = DWORD;
  342.   {$EXTERNALSYM ICMP6_TYPE}
  343.   PICMP6_TYPE = ^ICMP6_TYPE;
  344.   {$EXTERNALSYM PICMP6_TYPE}
  345.   TIcmp6Type = ICMP6_TYPE;
  346.   PIcmp6Type = PICMP6_TYPE;
  347. //
  348. // There are no RFC-specified defines for ICMPv4 message types, so we try to
  349. // use the ICMP6 values from RFC 2292 modified to be prefixed with ICMP4.
  350. //
  351. const
  352.   ICMP4_ECHO_REPLY        = 0;  // Echo Reply
  353.   {$EXTERNALSYM ICMP4_ECHO_REPLY}
  354.   ICMP4_DST_UNREACH       = 3;  // Destination Unreachable
  355.   {$EXTERNALSYM ICMP4_DST_UNREACH}
  356.   ICMP4_SOURCE_QUENCH     = 4;  // Source Quench
  357.   {$EXTERNALSYM ICMP4_SOURCE_QUENCH}
  358.   ICMP4_REDIRECT          = 5;  // Redirect
  359.   {$EXTERNALSYM ICMP4_REDIRECT}
  360.   ICMP4_ECHO_REQUEST      = 8;  // Echo Request
  361.   {$EXTERNALSYM ICMP4_ECHO_REQUEST}
  362.   ICMP4_ROUTER_ADVERT     = 9;  // Router Advertisement
  363.   {$EXTERNALSYM ICMP4_ROUTER_ADVERT}
  364.   ICMP4_ROUTER_SOLICIT    = 10; // Router Solicitation
  365.   {$EXTERNALSYM ICMP4_ROUTER_SOLICIT}
  366.   ICMP4_TIME_EXCEEDED     = 11; // Time Exceeded
  367.   {$EXTERNALSYM ICMP4_TIME_EXCEEDED}
  368.   ICMP4_PARAM_PROB        = 12; // Parameter Problem
  369.   {$EXTERNALSYM ICMP4_PARAM_PROB}
  370.   ICMP4_TIMESTAMP_REQUEST = 13; // Timestamp Request
  371.   {$EXTERNALSYM ICMP4_TIMESTAMP_REQUEST}
  372.   ICMP4_TIMESTAMP_REPLY   = 14; // Timestamp Reply
  373.   {$EXTERNALSYM ICMP4_TIMESTAMP_REPLY}
  374.   ICMP4_MASK_REQUEST      = 17; // Address Mask Request
  375.   {$EXTERNALSYM ICMP4_MASK_REQUEST}
  376.   ICMP4_MASK_REPLY        = 18; // Address Mask Reply
  377.   {$EXTERNALSYM ICMP4_MASK_REPLY}
  378. type
  379.   ICMP4_TYPE = DWORD;
  380.   {$EXTERNALSYM ICMP4_TYPE}
  381.   PICMP4_TYPE = ^ICMP4_TYPE;
  382.   {$EXTERNALSYM PICMP4_TYPE}
  383.   TIcmp4Type = ICMP4_TYPE;
  384.   PIcmp4Type = PICMP4_TYPE;
  385.   _MIBICMPSTATS_EX = record
  386.     dwMsgs: DWORD;
  387.     dwErrors: DWORD;
  388.     rgdwTypeCount: array [0..255] of DWORD;
  389.   end;
  390.   {$EXTERNALSYM _MIBICMPSTATS_EX}
  391.   MIBICMPSTATS_EX = _MIBICMPSTATS_EX;
  392.   {$EXTERNALSYM MIBICMPSTATS_EX}
  393.   PMIBICMPSTATS_EX = ^MIBICMPSTATS_EX;
  394.   {$EXTERNALSYM PMIBICMPSTATS_EX}
  395.   TMibIcmpStatsEx = MIBICMPSTATS_EX;
  396.   PMibIcmpStatsEx = PMIBICMPSTATS_EX;
  397.   _MIB_ICMP_EX = record
  398.     icmpInStats: MIBICMPSTATS_EX;
  399.     icmpOutStats: MIBICMPSTATS_EX;
  400.   end;
  401.   {$EXTERNALSYM _MIB_ICMP_EX}
  402.   MIB_ICMP_EX = _MIB_ICMP_EX;
  403.   {$EXTERNALSYM MIB_ICMP_EX}
  404.   PMIB_ICMP_EX = ^MIB_ICMP_EX;
  405.   {$EXTERNALSYM PMIB_ICMP_EX}
  406.   TMibIcmpEx = MIB_ICMP_EX;
  407.   PMibIcmpEx = PMIB_ICMP_EX;  
  408.   PMIB_UDPSTATS = ^MIB_UDPSTATS;
  409.   {$EXTERNALSYM PMIB_UDPSTATS}
  410.   _MIB_UDPSTATS = record
  411.     dwInDatagrams: DWORD;
  412.     dwNoPorts: DWORD;
  413.     dwInErrors: DWORD;
  414.     dwOutDatagrams: DWORD;
  415.     dwNumAddrs: DWORD;
  416.   end;
  417.   {$EXTERNALSYM _MIB_UDPSTATS}
  418.   MIB_UDPSTATS = _MIB_UDPSTATS;
  419.   {$EXTERNALSYM MIB_UDPSTATS}
  420.   TMibUdpStats = MIB_UDPSTATS;
  421.   PMibUdpStats = PMIB_UDPSTATS;
  422.   PMIB_UDPROW = ^MIB_UDPROW;
  423.   {$EXTERNALSYM PMIB_UDPROW}
  424.   _MIB_UDPROW = record
  425.     dwLocalAddr: DWORD;
  426.     dwLocalPort: DWORD;
  427.   end;
  428.   {$EXTERNALSYM _MIB_UDPROW}
  429.   MIB_UDPROW = _MIB_UDPROW;
  430.   {$EXTERNALSYM MIB_UDPROW}
  431.   TMibUdpRow = MIB_UDPROW;
  432.   PMibUdpRow = PMIB_UDPROW;
  433.   PMIB_UDPTABLE = ^MIB_UDPTABLE;
  434.   {$EXTERNALSYM PMIB_UDPTABLE}
  435.   _MIB_UDPTABLE = record
  436.     dwNumEntries: DWORD;
  437.     table: array [0..ANY_SIZE - 1] of MIB_UDPROW;
  438.   end;
  439.   {$EXTERNALSYM _MIB_UDPTABLE}
  440.   MIB_UDPTABLE = _MIB_UDPTABLE;
  441.   {$EXTERNALSYM MIB_UDPTABLE}
  442.   TMibUdpTable = MIB_UDPTABLE;
  443.   PMibUdpTable = PMIB_UDPTABLE;
  444. // #define SIZEOF_UDPTABLE(X) (FIELD_OFFSET(MIB_UDPTABLE, table[0]) + ((X) * sizeof(MIB_UDPROW)) + ALIGN_SIZE)
  445.   PMIB_TCPSTATS = ^MIB_TCPSTATS;
  446.   {$EXTERNALSYM PMIB_TCPSTATS}
  447.   _MIB_TCPSTATS = record
  448.     dwRtoAlgorithm: DWORD;
  449.     dwRtoMin: DWORD;
  450.     dwRtoMax: DWORD;
  451.     dwMaxConn: DWORD;
  452.     dwActiveOpens: DWORD;
  453.     dwPassiveOpens: DWORD;
  454.     dwAttemptFails: DWORD;
  455.     dwEstabResets: DWORD;
  456.     dwCurrEstab: DWORD;
  457.     dwInSegs: DWORD;
  458.     dwOutSegs: DWORD;
  459.     dwRetransSegs: DWORD;
  460.     dwInErrs: DWORD;
  461.     dwOutRsts: DWORD;
  462.     dwNumConns: DWORD;
  463.   end;
  464.   {$EXTERNALSYM _MIB_TCPSTATS}
  465.   MIB_TCPSTATS = _MIB_TCPSTATS;
  466.   {$EXTERNALSYM MIB_TCPSTATS}
  467.   TMibTcpStats = MIB_TCPSTATS;
  468.   PMibTcpStats = PMIB_TCPSTATS;
  469. const
  470.   MIB_TCP_RTO_OTHER    = 1;
  471.   {$EXTERNALSYM MIB_TCP_RTO_OTHER}
  472.   MIB_TCP_RTO_CONSTANT = 2;
  473.   {$EXTERNALSYM MIB_TCP_RTO_CONSTANT}
  474.   MIB_TCP_RTO_RSRE     = 3;
  475.   {$EXTERNALSYM MIB_TCP_RTO_RSRE}
  476.   MIB_TCP_RTO_VANJ     = 4;
  477.   {$EXTERNALSYM MIB_TCP_RTO_VANJ}
  478.   MIB_TCP_MAXCONN_DYNAMIC = DWORD(-1);
  479.   {$EXTERNALSYM MIB_TCP_MAXCONN_DYNAMIC}
  480. type
  481.   PMIB_TCPROW = ^MIB_TCPROW;
  482.   {$EXTERNALSYM PMIB_TCPROW}
  483.   _MIB_TCPROW = record
  484.     dwState: DWORD;
  485.     dwLocalAddr: DWORD;
  486.     dwLocalPort: DWORD;
  487.     dwRemoteAddr: DWORD;
  488.     dwRemotePort: DWORD;
  489.   end;
  490.   {$EXTERNALSYM _MIB_TCPROW}
  491.   MIB_TCPROW = _MIB_TCPROW;
  492.   {$EXTERNALSYM MIB_TCPROW}
  493.   TMibTcpRow = MIB_TCPROW;
  494.   PMibTcpRow = PMIB_TCPROW;
  495. const
  496.   MIB_TCP_STATE_CLOSED     = 1;
  497.   {$EXTERNALSYM MIB_TCP_STATE_CLOSED}
  498.   MIB_TCP_STATE_LISTEN     = 2;
  499.   {$EXTERNALSYM MIB_TCP_STATE_LISTEN}
  500.   MIB_TCP_STATE_SYN_SENT   = 3;
  501.   {$EXTERNALSYM MIB_TCP_STATE_SYN_SENT}
  502.   MIB_TCP_STATE_SYN_RCVD   = 4;
  503.   {$EXTERNALSYM MIB_TCP_STATE_SYN_RCVD}
  504.   MIB_TCP_STATE_ESTAB      = 5;
  505.   {$EXTERNALSYM MIB_TCP_STATE_ESTAB}
  506.   MIB_TCP_STATE_FIN_WAIT1  = 6;
  507.   {$EXTERNALSYM MIB_TCP_STATE_FIN_WAIT1}
  508.   MIB_TCP_STATE_FIN_WAIT2  = 7;
  509.   {$EXTERNALSYM MIB_TCP_STATE_FIN_WAIT2}
  510.   MIB_TCP_STATE_CLOSE_WAIT = 8;
  511.   {$EXTERNALSYM MIB_TCP_STATE_CLOSE_WAIT}
  512.   MIB_TCP_STATE_CLOSING    = 9;
  513.   {$EXTERNALSYM MIB_TCP_STATE_CLOSING}
  514.   MIB_TCP_STATE_LAST_ACK   = 10;
  515.   {$EXTERNALSYM MIB_TCP_STATE_LAST_ACK}
  516.   MIB_TCP_STATE_TIME_WAIT  = 11;
  517.   {$EXTERNALSYM MIB_TCP_STATE_TIME_WAIT}
  518.   MIB_TCP_STATE_DELETE_TCB = 12;
  519.   {$EXTERNALSYM MIB_TCP_STATE_DELETE_TCB}
  520. type
  521.   PMIB_TCPTABLE = ^MIB_TCPTABLE;
  522.   {$EXTERNALSYM PMIB_TCPTABLE}
  523.   _MIB_TCPTABLE = record
  524.     dwNumEntries: DWORD;
  525.     table: array [0..ANY_SIZE - 1] of MIB_TCPROW;
  526.   end;
  527.   {$EXTERNALSYM _MIB_TCPTABLE}
  528.   MIB_TCPTABLE = _MIB_TCPTABLE;
  529.   {$EXTERNALSYM MIB_TCPTABLE}
  530.   TMibTcpTable = MIB_TCPTABLE;
  531.   PMibTcpTable = PMIB_TCPTABLE;
  532. // #define SIZEOF_TCPTABLE(X) (FIELD_OFFSET(MIB_TCPTABLE,table[0]) + ((X) * sizeof(MIB_TCPROW)) + ALIGN_SIZE)
  533. const
  534.   MIB_USE_CURRENT_TTL        = DWORD(-1);
  535.   {$EXTERNALSYM MIB_USE_CURRENT_TTL}
  536.   MIB_USE_CURRENT_FORWARDING = DWORD(-1);
  537.   {$EXTERNALSYM MIB_USE_CURRENT_FORWARDING}
  538. type
  539.   PMIB_IPSTATS = ^MIB_IPSTATS;
  540.   {$EXTERNALSYM PMIB_IPSTATS}
  541.   _MIB_IPSTATS = record
  542.     dwForwarding: DWORD;
  543.     dwDefaultTTL: DWORD;
  544.     dwInReceives: DWORD;
  545.     dwInHdrErrors: DWORD;
  546.     dwInAddrErrors: DWORD;
  547.     dwForwDatagrams: DWORD;
  548.     dwInUnknownProtos: DWORD;
  549.     dwInDiscards: DWORD;
  550.     dwInDelivers: DWORD;
  551.     dwOutRequests: DWORD;
  552.     dwRoutingDiscards: DWORD;
  553.     dwOutDiscards: DWORD;
  554.     dwOutNoRoutes: DWORD;
  555.     dwReasmTimeout: DWORD;
  556.     dwReasmReqds: DWORD;
  557.     dwReasmOks: DWORD;
  558.     dwReasmFails: DWORD;
  559.     dwFragOks: DWORD;
  560.     dwFragFails: DWORD;
  561.     dwFragCreates: DWORD;
  562.     dwNumIf: DWORD;
  563.     dwNumAddr: DWORD;
  564.     dwNumRoutes: DWORD;
  565.   end;
  566.   {$EXTERNALSYM _MIB_IPSTATS}
  567.   MIB_IPSTATS = _MIB_IPSTATS;
  568.   {$EXTERNALSYM MIB_IPSTATS}
  569.   TMibIpStats = MIB_IPSTATS;
  570.   PMibIpStats = PMIB_IPSTATS;
  571. const
  572.   MIB_IP_FORWARDING     = 1;
  573.   {$EXTERNALSYM MIB_IP_FORWARDING}
  574.   MIB_IP_NOT_FORWARDING = 2;
  575.   {$EXTERNALSYM MIB_IP_NOT_FORWARDING}
  576. // Note: These addr types have dependency on ipdef.h
  577.   MIB_IPADDR_PRIMARY      = $0001;  // Primary ipaddr
  578.   {$EXTERNALSYM MIB_IPADDR_PRIMARY}
  579.   MIB_IPADDR_DYNAMIC      = $0004;  // Dynamic ipaddr
  580.   {$EXTERNALSYM MIB_IPADDR_DYNAMIC}
  581.   MIB_IPADDR_DISCONNECTED = $0008;  // Address is on disconnected interface
  582.   {$EXTERNALSYM MIB_IPADDR_DISCONNECTED}
  583.   MIB_IPADDR_DELETED      = $0040;  // Address being deleted
  584.   {$EXTERNALSYM MIB_IPADDR_DELETED}
  585.   MIB_IPADDR_TRANSIENT    = $0080;  // Transient address
  586.   {$EXTERNALSYM MIB_IPADDR_TRANSIENT}
  587. type
  588.   PMIB_IPADDRROW = ^MIB_IPADDRROW;
  589.   {$EXTERNALSYM PMIB_IPADDRROW}
  590.   _MIB_IPADDRROW = record
  591.     dwAddr: DWORD;
  592.     dwIndex: DWORD;
  593.     dwMask: DWORD;
  594.     dwBCastAddr: DWORD;
  595.     dwReasmSize: DWORD;
  596.     unused1: Word;
  597.     wType: Word;
  598.   end;
  599.   {$EXTERNALSYM _MIB_IPADDRROW}
  600.   MIB_IPADDRROW = _MIB_IPADDRROW;
  601.   {$EXTERNALSYM MIB_IPADDRROW}
  602.   TMibIpAddrRow = MIB_IPADDRROW;
  603.   PMibIpAddrRow = PMIB_IPADDRROW;
  604.   PMIB_IPADDRTABLE = ^MIB_IPADDRTABLE;
  605.   {$EXTERNALSYM PMIB_IPADDRTABLE}
  606.   _MIB_IPADDRTABLE = record
  607.     dwNumEntries: DWORD;
  608.     table: array [0..ANY_SIZE - 1] of MIB_IPADDRROW;
  609.   end;
  610.   {$EXTERNALSYM _MIB_IPADDRTABLE}
  611.   MIB_IPADDRTABLE = _MIB_IPADDRTABLE;
  612.   {$EXTERNALSYM MIB_IPADDRTABLE}
  613.   TMibIpAddrTable = _MIB_IPADDRTABLE;
  614.   PMibIpAddrTable = PMIB_IPADDRTABLE;
  615. // #define SIZEOF_IPADDRTABLE(X) (FIELD_OFFSET(MIB_IPADDRTABLE,table[0]) + ((X) * sizeof(MIB_IPADDRROW)) + ALIGN_SIZE)
  616. type
  617.   PMIB_IPFORWARDNUMBER = ^MIB_IPFORWARDNUMBER;
  618.   {$EXTERNALSYM PMIB_IPFORWARDNUMBER}
  619.   _MIB_IPFORWARDNUMBER = record
  620.     dwValue: DWORD;
  621.   end;
  622.   {$EXTERNALSYM _MIB_IPFORWARDNUMBER}
  623.   MIB_IPFORWARDNUMBER = _MIB_IPFORWARDNUMBER;
  624.   {$EXTERNALSYM MIB_IPFORWARDNUMBER}
  625.   TMibIpForwardNumber = MIB_IPFORWARDNUMBER;
  626.   PMibIpForwardNumber = PMIB_IPFORWARDNUMBER;
  627.   PMIB_IPFORWARDROW = ^MIB_IPFORWARDROW;
  628.   {$EXTERNALSYM PMIB_IPFORWARDROW}
  629.   _MIB_IPFORWARDROW = record
  630.     dwForwardDest: DWORD;
  631.     dwForwardMask: DWORD;
  632.     dwForwardPolicy: DWORD;
  633.     dwForwardNextHop: DWORD;
  634.     dwForwardIfIndex: DWORD;
  635.     dwForwardType: DWORD;
  636.     dwForwardProto: DWORD;
  637.     dwForwardAge: DWORD;
  638.     dwForwardNextHopAS: DWORD;
  639.     dwForwardMetric1: DWORD;
  640.     dwForwardMetric2: DWORD;
  641.     dwForwardMetric3: DWORD;
  642.     dwForwardMetric4: DWORD;
  643.     dwForwardMetric5: DWORD;
  644.   end;
  645.   {$EXTERNALSYM _MIB_IPFORWARDROW}
  646.   MIB_IPFORWARDROW = _MIB_IPFORWARDROW;
  647.   {$EXTERNALSYM MIB_IPFORWARDROW}
  648.   TMibIpForwardRow = MIB_IPFORWARDROW;
  649.   PMibIpForwardRow = PMIB_IPFORWARDROW;
  650. const
  651.   MIB_IPROUTE_TYPE_OTHER    = 1;
  652.   {$EXTERNALSYM MIB_IPROUTE_TYPE_OTHER}
  653.   MIB_IPROUTE_TYPE_INVALID  = 2;
  654.   {$EXTERNALSYM MIB_IPROUTE_TYPE_INVALID}
  655.   MIB_IPROUTE_TYPE_DIRECT   = 3;
  656.   {$EXTERNALSYM MIB_IPROUTE_TYPE_DIRECT}
  657.   MIB_IPROUTE_TYPE_INDIRECT = 4;
  658.   {$EXTERNALSYM MIB_IPROUTE_TYPE_INDIRECT}
  659.   MIB_IPROUTE_METRIC_UNUSED = DWORD(-1);
  660.   {$EXTERNALSYM MIB_IPROUTE_METRIC_UNUSED}
  661. //
  662. // THESE MUST MATCH the ids in routprot.h
  663. //
  664. const
  665.   MIB_IPPROTO_OTHER   = 1;
  666.   {$EXTERNALSYM MIB_IPPROTO_OTHER}
  667.   MIB_IPPROTO_LOCAL   = 2;
  668.   {$EXTERNALSYM MIB_IPPROTO_LOCAL}
  669.   MIB_IPPROTO_NETMGMT = 3;
  670.   {$EXTERNALSYM MIB_IPPROTO_NETMGMT}
  671.   MIB_IPPROTO_ICMP    = 4;
  672.   {$EXTERNALSYM MIB_IPPROTO_ICMP}
  673.   MIB_IPPROTO_EGP     = 5;
  674.   {$EXTERNALSYM MIB_IPPROTO_EGP}
  675.   MIB_IPPROTO_GGP     = 6;
  676.   {$EXTERNALSYM MIB_IPPROTO_GGP}
  677.   MIB_IPPROTO_HELLO   = 7;
  678.   {$EXTERNALSYM MIB_IPPROTO_HELLO}
  679.   MIB_IPPROTO_RIP     = 8;
  680.   {$EXTERNALSYM MIB_IPPROTO_RIP}
  681.   MIB_IPPROTO_IS_IS   = 9;
  682.   {$EXTERNALSYM MIB_IPPROTO_IS_IS}
  683.   MIB_IPPROTO_ES_IS   = 10;
  684.   {$EXTERNALSYM MIB_IPPROTO_ES_IS}
  685.   MIB_IPPROTO_CISCO   = 11;
  686.   {$EXTERNALSYM MIB_IPPROTO_CISCO}
  687.   MIB_IPPROTO_BBN     = 12;
  688.   {$EXTERNALSYM MIB_IPPROTO_BBN}
  689.   MIB_IPPROTO_OSPF    = 13;
  690.   {$EXTERNALSYM MIB_IPPROTO_OSPF}
  691.   MIB_IPPROTO_BGP     = 14;
  692.   {$EXTERNALSYM MIB_IPPROTO_BGP}
  693.   MIB_IPPROTO_NT_AUTOSTATIC     = 10002;
  694.   {$EXTERNALSYM MIB_IPPROTO_NT_AUTOSTATIC}
  695.   MIB_IPPROTO_NT_STATIC         = 10006;
  696.   {$EXTERNALSYM MIB_IPPROTO_NT_STATIC}
  697.   MIB_IPPROTO_NT_STATIC_NON_DOD = 10007;
  698.   {$EXTERNALSYM MIB_IPPROTO_NT_STATIC_NON_DOD}
  699. type
  700.   PMIB_IPFORWARDTABLE = ^MIB_IPFORWARDTABLE;
  701.   {$EXTERNALSYM PMIB_IPFORWARDTABLE}
  702.   _MIB_IPFORWARDTABLE = record
  703.     dwNumEntries: DWORD;
  704.     table: array [0..ANY_SIZE - 1] of MIB_IPFORWARDROW;
  705.   end;
  706.   {$EXTERNALSYM _MIB_IPFORWARDTABLE}
  707.   MIB_IPFORWARDTABLE = _MIB_IPFORWARDTABLE;
  708.   {$EXTERNALSYM MIB_IPFORWARDTABLE}
  709.   TMibIpForwardTable = MIB_IPFORWARDTABLE;
  710.   PMibIpForwardTable = PMIB_IPFORWARDTABLE;
  711. // #define SIZEOF_IPFORWARDTABLE(X) (FIELD_OFFSET(MIB_IPFORWARDTABLE,table[0]) + ((X) * sizeof(MIB_IPFORWARDROW)) + ALIGN_SIZE)
  712. type
  713.   PMIB_IPNETROW = ^MIB_IPNETROW;
  714.   {$EXTERNALSYM PMIB_IPNETROW}
  715.   _MIB_IPNETROW = record
  716.     dwIndex: DWORD;
  717.     dwPhysAddrLen: DWORD;
  718.     bPhysAddr: array [0..MAXLEN_PHYSADDR - 1] of BYTE;
  719.     dwAddr: DWORD;
  720.     dwType: DWORD;
  721.   end;
  722.   {$EXTERNALSYM _MIB_IPNETROW}
  723.   MIB_IPNETROW = _MIB_IPNETROW;
  724.   {$EXTERNALSYM MIB_IPNETROW}
  725.   TMibIpNetRow = MIB_IPNETROW;
  726.   PMibIpNetRow = PMIB_IPNETROW;
  727. const
  728.   MIB_IPNET_TYPE_OTHER   = 1;
  729.   {$EXTERNALSYM MIB_IPNET_TYPE_OTHER}
  730.   MIB_IPNET_TYPE_INVALID = 2;
  731.   {$EXTERNALSYM MIB_IPNET_TYPE_INVALID}
  732.   MIB_IPNET_TYPE_DYNAMIC = 3;
  733.   {$EXTERNALSYM MIB_IPNET_TYPE_DYNAMIC}
  734.   MIB_IPNET_TYPE_STATIC  = 4;
  735.   {$EXTERNALSYM MIB_IPNET_TYPE_STATIC}
  736. type
  737.   PMIB_IPNETTABLE = ^MIB_IPNETTABLE;
  738.   {$EXTERNALSYM PMIB_IPNETTABLE}
  739.   _MIB_IPNETTABLE = record
  740.     dwNumEntries: DWORD;
  741.     table: array [0..ANY_SIZE - 1] of MIB_IPNETROW;
  742.   end;
  743.   {$EXTERNALSYM _MIB_IPNETTABLE}
  744.   MIB_IPNETTABLE = _MIB_IPNETTABLE;
  745.   {$EXTERNALSYM MIB_IPNETTABLE}
  746.   TMibIpNetTable = MIB_IPNETTABLE;
  747.   PMibIpNetTable = PMIB_IPNETTABLE;
  748. // #define SIZEOF_IPNETTABLE(X) (FIELD_OFFSET(MIB_IPNETTABLE, table[0]) + ((X) * sizeof(MIB_IPNETROW)) + ALIGN_SIZE)
  749. type
  750.   PMIB_IPMCAST_OIF = ^MIB_IPMCAST_OIF;
  751.   {$EXTERNALSYM PMIB_IPMCAST_OIF}
  752.   _MIB_IPMCAST_OIF = record
  753.     dwOutIfIndex: DWORD;
  754.     dwNextHopAddr: DWORD;
  755.     dwReserved: DWORD;
  756.     dwReserved1: DWORD;
  757.   end;
  758.   {$EXTERNALSYM _MIB_IPMCAST_OIF}
  759.   MIB_IPMCAST_OIF = _MIB_IPMCAST_OIF;
  760.   {$EXTERNALSYM MIB_IPMCAST_OIF}
  761.   TMibIpmCastOif = MIB_IPMCAST_OIF;
  762.   PMibIpmCastOif = PMIB_IPMCAST_OIF;
  763.   PMIB_IPMCAST_MFE = ^MIB_IPMCAST_MFE;
  764.   {$EXTERNALSYM PMIB_IPMCAST_MFE}
  765.   _MIB_IPMCAST_MFE = record
  766.     dwGroup: DWORD;
  767.     dwSource: DWORD;
  768.     dwSrcMask: DWORD;
  769.     dwUpStrmNgbr: DWORD;
  770.     dwInIfIndex: DWORD;
  771.     dwInIfProtocol: DWORD;
  772.     dwRouteProtocol: DWORD;
  773.     dwRouteNetwork: DWORD;
  774.     dwRouteMask: DWORD;
  775.     ulUpTime: ULONG;
  776.     ulExpiryTime: ULONG;
  777.     ulTimeOut: ULONG;
  778.     ulNumOutIf: ULONG;
  779.     fFlags: DWORD;
  780.     dwReserved: DWORD;
  781.     rgmioOutInfo: array [0..ANY_SIZE - 1] of MIB_IPMCAST_OIF;
  782.   end;
  783.   {$EXTERNALSYM _MIB_IPMCAST_MFE}
  784.   MIB_IPMCAST_MFE = _MIB_IPMCAST_MFE;
  785.   {$EXTERNALSYM MIB_IPMCAST_MFE}
  786.   TMibIpmCastMfe = MIB_IPMCAST_MFE;
  787.   PMibIpmCastMfe = PMIB_IPMCAST_MFE;
  788.   PMIB_MFE_TABLE = ^MIB_MFE_TABLE;
  789.   {$EXTERNALSYM PMIB_MFE_TABLE}
  790.   _MIB_MFE_TABLE = record
  791.     dwNumEntries: DWORD;
  792.     table: array [0..ANY_SIZE - 1] of MIB_IPMCAST_MFE;
  793.   end;
  794.   {$EXTERNALSYM _MIB_MFE_TABLE}
  795.   MIB_MFE_TABLE = _MIB_MFE_TABLE;
  796.   {$EXTERNALSYM MIB_MFE_TABLE}
  797.   TMibMfeTable = MIB_MFE_TABLE;
  798.   PMibMfeTable = PMIB_MFE_TABLE;
  799. // #define SIZEOF_BASIC_MIB_MFE          
  800. //    (ULONG)(FIELD_OFFSET(MIB_IPMCAST_MFE, rgmioOutInfo[0]))
  801. // #define SIZEOF_MIB_MFE(X)             
  802. //    (SIZEOF_BASIC_MIB_MFE + ((X) * sizeof(MIB_IPMCAST_OIF)))
  803. type
  804.   PMIB_IPMCAST_OIF_STATS = ^MIB_IPMCAST_OIF_STATS;
  805.   {$EXTERNALSYM PMIB_IPMCAST_OIF_STATS}
  806.   _MIB_IPMCAST_OIF_STATS = record
  807.     dwOutIfIndex: DWORD;
  808.     dwNextHopAddr: DWORD;
  809.     dwDialContext: DWORD;
  810.     ulTtlTooLow: ULONG;
  811.     ulFragNeeded: ULONG;
  812.     ulOutPackets: ULONG;
  813.     ulOutDiscards: ULONG;
  814.   end;
  815.   {$EXTERNALSYM _MIB_IPMCAST_OIF_STATS}
  816.   MIB_IPMCAST_OIF_STATS = _MIB_IPMCAST_OIF_STATS;
  817.   {$EXTERNALSYM MIB_IPMCAST_OIF_STATS}
  818.   TMibIpmCastOifStats = MIB_IPMCAST_OIF_STATS;
  819.   PMibIpmCastOifStats = PMIB_IPMCAST_OIF_STATS;
  820.   PMIB_IPMCAST_MFE_STATS = ^MIB_IPMCAST_MFE_STATS;
  821.   {$EXTERNALSYM PMIB_IPMCAST_MFE_STATS}
  822.   _MIB_IPMCAST_MFE_STATS = record
  823.     dwGroup: DWORD;
  824.     dwSource: DWORD;
  825.     dwSrcMask: DWORD;
  826.     dwUpStrmNgbr: DWORD;
  827.     dwInIfIndex: DWORD;
  828.     dwInIfProtocol: DWORD;
  829.     dwRouteProtocol: DWORD;
  830.     dwRouteNetwork: DWORD;
  831.     dwRouteMask: DWORD;
  832.     ulUpTime: ULONG;
  833.     ulExpiryTime: ULONG;
  834.     ulNumOutIf: ULONG;
  835.     ulInPkts: ULONG;
  836.     ulInOctets: ULONG;
  837.     ulPktsDifferentIf: ULONG;
  838.     ulQueueOverflow: ULONG;
  839.     rgmiosOutStats: array [0..ANY_SIZE - 1] of MIB_IPMCAST_OIF_STATS;
  840.   end;
  841.   {$EXTERNALSYM _MIB_IPMCAST_MFE_STATS}
  842.   MIB_IPMCAST_MFE_STATS = _MIB_IPMCAST_MFE_STATS;
  843.   {$EXTERNALSYM MIB_IPMCAST_MFE_STATS}
  844.   TMibIpmCastMfeStats = MIB_IPMCAST_MFE_STATS;
  845.   PMibIpmCastMfeStats = PMIB_IPMCAST_MFE_STATS;
  846.   PMIB_MFE_STATS_TABLE = ^MIB_MFE_STATS_TABLE;
  847.   {$EXTERNALSYM PMIB_MFE_STATS_TABLE}
  848.   _MIB_MFE_STATS_TABLE = record
  849.     dwNumEntries: DWORD;
  850.     table: array [0..ANY_SIZE - 1] of MIB_IPMCAST_MFE_STATS;
  851.   end;
  852.   {$EXTERNALSYM _MIB_MFE_STATS_TABLE}
  853.   MIB_MFE_STATS_TABLE = _MIB_MFE_STATS_TABLE;
  854.   {$EXTERNALSYM MIB_MFE_STATS_TABLE}
  855.   TMibMfeStatsTable = MIB_MFE_STATS_TABLE;
  856.   PMibMfeStatsTable = PMIB_MFE_STATS_TABLE;
  857. // #define SIZEOF_BASIC_MIB_MFE_STATS    
  858. //    (ULONG)(FIELD_OFFSET(MIB_IPMCAST_MFE_STATS, rgmiosOutStats[0]))
  859. // #define SIZEOF_MIB_MFE_STATS(X)       
  860. //    (SIZEOF_BASIC_MIB_MFE_STATS + ((X) * sizeof(MIB_IPMCAST_OIF_STATS)))
  861. type
  862.   _MIB_IPMCAST_MFE_STATS_EX = record
  863.     dwGroup: DWORD;
  864.     dwSource: DWORD;
  865.     dwSrcMask: DWORD;
  866.     dwUpStrmNgbr: DWORD;
  867.     dwInIfIndex: DWORD;
  868.     dwInIfProtocol: DWORD;
  869.     dwRouteProtocol: DWORD;
  870.     dwRouteNetwork: DWORD;
  871.     dwRouteMask: DWORD;
  872.     ulUpTime: ULONG;
  873.     ulExpiryTime: ULONG;
  874.     ulNumOutIf: ULONG;
  875.     ulInPkts: ULONG;
  876.     ulInOctets: ULONG;
  877.     ulPktsDifferentIf: ULONG;
  878.     ulQueueOverflow: ULONG;
  879.     ulUninitMfe: ULONG;
  880.     ulNegativeMfe: ULONG;
  881.     ulInDiscards: ULONG;
  882.     ulInHdrErrors: ULONG;
  883.     ulTotalOutPackets: ULONG;
  884.     rgmiosOutStats: array [0..ANY_SIZE - 1] of MIB_IPMCAST_OIF_STATS;
  885.   end;
  886.   {$EXTERNALSYM _MIB_IPMCAST_MFE_STATS_EX}
  887.   MIB_IPMCAST_MFE_STATS_EX = _MIB_IPMCAST_MFE_STATS_EX;
  888.   {$EXTERNALSYM MIB_IPMCAST_MFE_STATS_EX}
  889.   PMIB_IPMCAST_MFE_STATS_EX = ^MIB_IPMCAST_MFE_STATS_EX;
  890.   {$EXTERNALSYM PMIB_IPMCAST_MFE_STATS_EX}
  891.   TMibIpMCastMfeStatsEx = MIB_IPMCAST_MFE_STATS_EX;
  892.   PMibIpMCastMfeStatsEx = PMIB_IPMCAST_MFE_STATS_EX;  
  893.   _MIB_MFE_STATS_TABLE_EX = record
  894.     dwNumEntries: DWORD;
  895.     table: array [0..ANY_SIZE - 1] of MIB_IPMCAST_MFE_STATS_EX;
  896.   end;
  897.   {$EXTERNALSYM _MIB_MFE_STATS_TABLE_EX}
  898.   MIB_MFE_STATS_TABLE_EX = _MIB_MFE_STATS_TABLE_EX;
  899.   {$EXTERNALSYM MIB_MFE_STATS_TABLE_EX}
  900.   PMIB_MFE_STATS_TABLE_EX = ^MIB_MFE_STATS_TABLE_EX;
  901.   {$EXTERNALSYM PMIB_MFE_STATS_TABLE_EX}
  902.   TMibMfeStatsTableEx = MIB_MFE_STATS_TABLE_EX;
  903.   PMibMfeStatsTableEx = PMIB_MFE_STATS_TABLE_EX;
  904. //#define SIZEOF_BASIC_MIB_MFE_STATS_EX    
  905. //    (ULONG)(FIELD_OFFSET(MIB_IPMCAST_MFE_STATS_EX, rgmiosOutStats[0]))
  906. //#define SIZEOF_MIB_MFE_STATS_EX(X)       
  907. //    (SIZEOF_BASIC_MIB_MFE_STATS_EX + ((X) * sizeof(MIB_IPMCAST_OIF_STATS)))
  908. type
  909.   PMIB_IPMCAST_GLOBAL = ^MIB_IPMCAST_GLOBAL;
  910.   {$EXTERNALSYM PMIB_IPMCAST_GLOBAL}
  911.   _MIB_IPMCAST_GLOBAL = record
  912.     dwEnable: DWORD;
  913.   end;
  914.   {$EXTERNALSYM _MIB_IPMCAST_GLOBAL}
  915.   MIB_IPMCAST_GLOBAL = _MIB_IPMCAST_GLOBAL;
  916.   {$EXTERNALSYM MIB_IPMCAST_GLOBAL}
  917.   TMibIpmCastGlobal = MIB_IPMCAST_GLOBAL;
  918.   PMibIpmCastGlobal = PMIB_IPMCAST_GLOBAL;
  919.   PMIB_IPMCAST_IF_ENTRY = ^MIB_IPMCAST_IF_ENTRY;
  920.   {$EXTERNALSYM PMIB_IPMCAST_IF_ENTRY}
  921.   _MIB_IPMCAST_IF_ENTRY = record
  922.     dwIfIndex: DWORD;
  923.     dwTtl: DWORD;
  924.     dwProtocol: DWORD;
  925.     dwRateLimit: DWORD;
  926.     ulInMcastOctets: ULONG;
  927.     ulOutMcastOctets: ULONG;
  928.   end;
  929.   {$EXTERNALSYM _MIB_IPMCAST_IF_ENTRY}
  930.   MIB_IPMCAST_IF_ENTRY = _MIB_IPMCAST_IF_ENTRY;
  931.   {$EXTERNALSYM MIB_IPMCAST_IF_ENTRY}
  932.   TMibIpmCastIfEntry = MIB_IPMCAST_IF_ENTRY;
  933.   PMibIpmCastIfEntry = PMIB_IPMCAST_IF_ENTRY;
  934.   PMIB_IPMCAST_IF_TABLE = ^MIB_IPMCAST_IF_TABLE;
  935.   {$EXTERNALSYM PMIB_IPMCAST_IF_TABLE}
  936.   _MIB_IPMCAST_IF_TABLE = record
  937.     dwNumEntries: DWORD;
  938.     table: array [0..ANY_SIZE - 1] of MIB_IPMCAST_IF_ENTRY;
  939.   end;
  940.   {$EXTERNALSYM _MIB_IPMCAST_IF_TABLE}
  941.   MIB_IPMCAST_IF_TABLE = _MIB_IPMCAST_IF_TABLE;
  942.   {$EXTERNALSYM MIB_IPMCAST_IF_TABLE}
  943.   TMibIpmCastIfTable = MIB_IPMCAST_IF_TABLE;
  944.   PMibIpmCastIfTable = PMIB_IPMCAST_IF_TABLE;
  945. // #define SIZEOF_MCAST_IF_TABLE(X) (FIELD_OFFSET(MIB_IPMCAST_IF_TABLE,table[0]) + ((X) * sizeof(MIB_IPMCAST_IF_ENTRY)) + ALIGN_SIZE)
  946. type
  947.   PMIB_IPMCAST_BOUNDARY = ^MIB_IPMCAST_BOUNDARY;
  948.   {$EXTERNALSYM PMIB_IPMCAST_BOUNDARY}
  949.   _MIB_IPMCAST_BOUNDARY = record
  950.     dwIfIndex: DWORD;
  951.     dwGroupAddress: DWORD;
  952.     dwGroupMask: DWORD;
  953.     dwStatus: DWORD;
  954.   end;
  955.   {$EXTERNALSYM _MIB_IPMCAST_BOUNDARY}
  956.   MIB_IPMCAST_BOUNDARY = _MIB_IPMCAST_BOUNDARY;
  957.   {$EXTERNALSYM MIB_IPMCAST_BOUNDARY}
  958.   TMibIpmCastBoundary = MIB_IPMCAST_BOUNDARY;
  959.   PMibIpmCastBoundary = PMIB_IPMCAST_BOUNDARY;
  960.   PMIB_IPMCAST_BOUNDARY_TABLE = ^MIB_IPMCAST_BOUNDARY_TABLE;
  961.   {$EXTERNALSYM PMIB_IPMCAST_BOUNDARY_TABLE}
  962.   _MIB_IPMCAST_BOUNDARY_TABLE = record
  963.     dwNumEntries: DWORD;
  964.     table: array [0..ANY_SIZE - 1] of MIB_IPMCAST_BOUNDARY;
  965.   end;
  966.   {$EXTERNALSYM _MIB_IPMCAST_BOUNDARY_TABLE}
  967.   MIB_IPMCAST_BOUNDARY_TABLE = _MIB_IPMCAST_BOUNDARY_TABLE;
  968.   {$EXTERNALSYM MIB_IPMCAST_BOUNDARY_TABLE}
  969.   TMibIpmCastBoundaryTable = MIB_IPMCAST_BOUNDARY_TABLE;
  970.   PMibIpmCastBoundaryTable = PMIB_IPMCAST_BOUNDARY_TABLE;
  971. // #define SIZEOF_BOUNDARY_TABLE(X) (FIELD_OFFSET(MIB_IPMCAST_BOUNDARY_TABLE,table[0]) + ((X) * sizeof(MIB_IPMCAST_BOUNDARY)) + ALIGN_SIZE)
  972. type
  973.   PMIB_BOUNDARYROW = ^MIB_BOUNDARYROW;
  974.   {$EXTERNALSYM PMIB_BOUNDARYROW}
  975.   MIB_BOUNDARYROW = record
  976.     dwGroupAddress: DWORD;
  977.     dwGroupMask: DWORD;
  978.   end;
  979.   {$EXTERNALSYM MIB_BOUNDARYROW}
  980.   TMibBoundaryRow = MIB_BOUNDARYROW;
  981.   PMibBoundaryRow = PMIB_BOUNDARYROW;
  982. // Structure matching what goes in the registry in a block of type
  983. // IP_MCAST_LIMIT_INFO.  This contains the fields of
  984. // MIB_IPMCAST_IF_ENTRY which are configurable.
  985.   PMIB_MCAST_LIMIT_ROW = ^MIB_MCAST_LIMIT_ROW;
  986.   {$EXTERNALSYM PMIB_MCAST_LIMIT_ROW}
  987.   MIB_MCAST_LIMIT_ROW = record
  988.     dwTtl: DWORD;
  989.     dwRateLimit: DWORD;
  990.   end;
  991.   {$EXTERNALSYM MIB_MCAST_LIMIT_ROW}
  992.   TMibMcastLimitRow = MIB_MCAST_LIMIT_ROW;
  993.   PMibMcastLimitRow = PMIB_MCAST_LIMIT_ROW;
  994. const
  995.   MAX_SCOPE_NAME_LEN = 255;
  996.   {$EXTERNALSYM MAX_SCOPE_NAME_LEN}
  997. //
  998. // Scope names are unicode.  SNMP and MZAP use UTF-8 encoding.
  999. //
  1000. type
  1001.   SN_CHAR = WCHAR;
  1002.   {$EXTERNALSYM SN_CHAR}
  1003.   SCOPE_NAME_BUFFER = array [0..MAX_SCOPE_NAME_LEN] of SN_CHAR;
  1004.   {$EXTERNALSYM SCOPE_NAME_BUFFER}
  1005.   SCOPE_NAME = ^SN_CHAR;
  1006.   {$EXTERNALSYM SCOPE_NAME}
  1007.   PMIB_IPMCAST_SCOPE = ^MIB_IPMCAST_SCOPE;
  1008.   {$EXTERNALSYM PMIB_IPMCAST_SCOPE}
  1009.   _MIB_IPMCAST_SCOPE = record
  1010.     dwGroupAddress: DWORD;
  1011.     dwGroupMask: DWORD;
  1012.     snNameBuffer: SCOPE_NAME_BUFFER;
  1013.     dwStatus: DWORD;
  1014.   end;
  1015.   {$EXTERNALSYM _MIB_IPMCAST_SCOPE}
  1016.   MIB_IPMCAST_SCOPE = _MIB_IPMCAST_SCOPE;
  1017.   {$EXTERNALSYM MIB_IPMCAST_SCOPE}
  1018.   TMibIpmCastScope = MIB_IPMCAST_SCOPE;
  1019.   PMibIpmCastScope = PMIB_IPMCAST_SCOPE;
  1020.   PMIB_IPDESTROW = ^MIB_IPDESTROW;
  1021.   {$EXTERNALSYM PMIB_IPDESTROW}
  1022.   _MIB_IPDESTROW = record
  1023.     ForwardRow: MIB_IPFORWARDROW;
  1024.     dwForwardPreference: DWORD;
  1025.     dwForwardViewSet: DWORD;
  1026.   end;
  1027.   {$EXTERNALSYM _MIB_IPDESTROW}
  1028.   MIB_IPDESTROW = _MIB_IPDESTROW;
  1029.   {$EXTERNALSYM MIB_IPDESTROW}
  1030.   TMibIpDestRow = MIB_IPDESTROW;
  1031.   PMibIpDestRow = PMIB_IPDESTROW;
  1032.   PMIB_IPDESTTABLE = ^MIB_IPDESTTABLE;
  1033.   {$EXTERNALSYM PMIB_IPDESTTABLE}
  1034.   _MIB_IPDESTTABLE = record
  1035.     dwNumEntries: DWORD;
  1036.     table: array [0..ANY_SIZE - 1] of MIB_IPDESTROW;
  1037.   end;
  1038.   {$EXTERNALSYM _MIB_IPDESTTABLE}
  1039.   MIB_IPDESTTABLE = _MIB_IPDESTTABLE;
  1040.   {$EXTERNALSYM MIB_IPDESTTABLE}
  1041.   TMibIpDestTable = MIB_IPDESTTABLE;
  1042.   PMibIpDestTable = PMIB_IPDESTTABLE;
  1043.   PMIB_BEST_IF = ^MIB_BEST_IF;
  1044.   {$EXTERNALSYM PMIB_BEST_IF}
  1045.   _MIB_BEST_IF = record
  1046.     dwDestAddr: DWORD;
  1047.     dwIfIndex: DWORD;
  1048.   end;
  1049.   {$EXTERNALSYM _MIB_BEST_IF}
  1050.   MIB_BEST_IF = _MIB_BEST_IF;
  1051.   {$EXTERNALSYM MIB_BEST_IF}
  1052.   TMibBestIf = MIB_BEST_IF;
  1053.   PMibBestIf = PMIB_BEST_IF;
  1054.   PMIB_PROXYARP = ^MIB_PROXYARP;
  1055.   {$EXTERNALSYM PMIB_PROXYARP}
  1056.   _MIB_PROXYARP = record
  1057.     dwAddress: DWORD;
  1058.     dwMask: DWORD;
  1059.     dwIfIndex: DWORD;
  1060.   end;
  1061.   {$EXTERNALSYM _MIB_PROXYARP}
  1062.   MIB_PROXYARP = _MIB_PROXYARP;
  1063.   {$EXTERNALSYM MIB_PROXYARP}
  1064.   TMibProxyArp = MIB_PROXYARP;
  1065.   PMibProxyArp = PMIB_PROXYARP;
  1066.   PMIB_IFSTATUS = ^MIB_IFSTATUS;
  1067.   {$EXTERNALSYM PMIB_IFSTATUS}
  1068.   _MIB_IFSTATUS = record
  1069.     dwIfIndex: DWORD;
  1070.     dwAdminStatus: DWORD;
  1071.     dwOperationalStatus: DWORD;
  1072.     bMHbeatActive: BOOL;
  1073.     bMHbeatAlive: BOOL;
  1074.   end;
  1075.   {$EXTERNALSYM _MIB_IFSTATUS}
  1076.   MIB_IFSTATUS = _MIB_IFSTATUS;
  1077.   {$EXTERNALSYM MIB_IFSTATUS}
  1078.   TMibIfStatus = MIB_IFSTATUS;
  1079.   PMibIfStatus = PMIB_IFSTATUS;
  1080.   PMIB_ROUTESTATE = ^MIB_ROUTESTATE;
  1081.   {$EXTERNALSYM PMIB_ROUTESTATE}
  1082.   _MIB_ROUTESTATE = record
  1083.     bRoutesSetToStack: BOOL;
  1084.   end;
  1085.   {$EXTERNALSYM _MIB_ROUTESTATE}
  1086.   MIB_ROUTESTATE = _MIB_ROUTESTATE;
  1087.   {$EXTERNALSYM MIB_ROUTESTATE}
  1088.   TMibRouteState = MIB_ROUTESTATE;
  1089.   PMibRouteState = PMIB_ROUTESTATE;
  1090. //////////////////////////////////////////////////////////////////////////////
  1091. //                                                                          //
  1092. // All the info passed to (SET/CREATE) and from (GET/GETNEXT/GETFIRST)      //
  1093. // IP Router Manager is encapsulated in the following "discriminated"       //
  1094. // union.  To pass, say MIB_IFROW, use the following code                   //
  1095. //                                                                          //
  1096. //  PMIB_OPAQUE_INFO    pInfo;                                              //
  1097. //  PMIB_IFROW          pIfRow;                                             //
  1098. //  DWORD rgdwBuff[(MAX_MIB_OFFSET + sizeof(MIB_IFROW))/sizeof(DWORD) + 1]; //
  1099. //                                                                          //
  1100. //  pInfo   = (PMIB_OPAQUE_INFO)rgdwBuffer;                                 //
  1101. //  pIfRow  = (MIB_IFROW *)(pInfo->rgbyData);                               //
  1102. //                                                                          //
  1103. //  This can also be accomplished by using the following macro              //
  1104. //                                                                          //
  1105. //  DEFINE_MIB_BUFFER(pInfo,MIB_IFROW, pIfRow);                             //
  1106. //                                                                          //
  1107. //////////////////////////////////////////////////////////////////////////////
  1108. type
  1109.   PMibOpaqueInfo = ^TMibOpaqueInfo;
  1110.   _MIB_OPAQUE_INFO = record
  1111.     dwId: DWORD;
  1112.     case Integer of
  1113.       0: (ullAlign: Int64); // ULONGLONG (unsigned!)
  1114.       1: (rgbyData: array [0..0] of BYTE);
  1115.   end;
  1116.   {$EXTERNALSYM _MIB_OPAQUE_INFO}
  1117.   MIB_OPAQUE_INFO = _MIB_OPAQUE_INFO;
  1118.   {$EXTERNALSYM MIB_OPAQUE_INFO}
  1119.   TMibOpaqueInfo = MIB_OPAQUE_INFO;
  1120. const
  1121.   MAX_MIB_OFFSET = 8;
  1122.   {$EXTERNALSYM MAX_MIB_OFFSET}
  1123. // #define MIB_INFO_SIZE(S)    (MAX_MIB_OFFSET + sizeof(S))
  1124. // #define MIB_INFO_SIZE_IN_DWORDS(S)      
  1125. //    ((MIB_INFO_SIZE(S))/sizeof(DWORD) + 1)
  1126. // #define DEFINE_MIB_BUFFER(X,Y,Z)                                        
  1127. //    DWORD __rgdwBuff[MIB_INFO_SIZE_IN_DWORDS(Y)]; 
  1128. //    PMIB_OPAQUE_INFO    X = (PMIB_OPAQUE_INFO)__rgdwBuff;               
  1129. //    Y *                 Z = (Y *)(X->rgbyData)
  1130. // #define CAST_MIB_INFO(X,Y,Z)    Z = (Y)(X->rgbyData)
  1131. implementation
  1132. end.