1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  *
  21  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  22  */
  23 /* Copyright (c) 1990 Mentat Inc. */
  24 
  25 #ifndef _INET_MIB2_H
  26 #define _INET_MIB2_H
  27 
  28 #include <netinet/in.h>   /* For in6_addr_t */
  29 #include <sys/tsol/label.h> /* For brange_t */
  30 #include <sys/tsol/label_macro.h> /* For brange_t */
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 /*
  37  * The IPv6 parts of this are derived from:
  38  *      RFC 2465
  39  *      RFC 2466
  40  *      RFC 2452
  41  *      RFC 2454
  42  */
  43 
  44 /*
  45  * SNMP set/get via M_PROTO T_OPTMGMT_REQ.  Structure is that used
  46  * for [gs]etsockopt() calls.  get uses T_CURRENT, set uses T_NEOGTIATE
  47  * MGMT_flags value.  The following definition of opthdr is taken from
  48  * socket.h:
  49  *
  50  * An option specification consists of an opthdr, followed by the value of
  51  * the option.  An options buffer contains one or more options.  The len
  52  * field of opthdr specifies the length of the option value in bytes.  This
  53  * length must be a multiple of sizeof(long) (use OPTLEN macro).
  54  *
  55  * struct opthdr {
  56  *      long    level;  protocol level affected
  57  *      long    name;   option to modify
  58  *      long    len;    length of option value
  59  * };
  60  *
  61  * #define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
  62  * #define OPTVAL(opt) ((char *)(opt + 1))
  63  *
  64  * For get requests (T_CURRENT), any MIB2_xxx value can be used (only
  65  * "get all" is supported, so all modules get a copy of the request to
  66  * return everything it knows.   In general, we use MIB2_IP.  There is
  67  * one exception: in general, IP will not report information related to
  68  * ire_testhidden and IRE_IF_CLONE routes (e.g., in the MIB2_IP_ROUTE
  69  * table). However, using the special value EXPER_IP_AND_ALL_IRES will cause
  70  * all information to be reported.  This special value should only be
  71  * used by IPMP-aware low-level utilities (e.g. in.mpathd).
  72  *
  73  * IMPORTANT:  some fields are grouped in a different structure than
  74  * suggested by MIB-II, e.g., checksum error counts.  The original MIB-2
  75  * field name has been retained.  Field names beginning with "mi" are not
  76  * defined in the MIB but contain important & useful information maintained
  77  * by the corresponding module.
  78  */
  79 #ifndef IPPROTO_MAX
  80 #define IPPROTO_MAX     256
  81 #endif
  82 
  83 #define MIB2_SYSTEM             (IPPROTO_MAX+1)
  84 #define MIB2_INTERFACES         (IPPROTO_MAX+2)
  85 #define MIB2_AT                 (IPPROTO_MAX+3)
  86 #define MIB2_IP                 (IPPROTO_MAX+4)
  87 #define MIB2_ICMP               (IPPROTO_MAX+5)
  88 #define MIB2_TCP                (IPPROTO_MAX+6)
  89 #define MIB2_UDP                (IPPROTO_MAX+7)
  90 #define MIB2_EGP                (IPPROTO_MAX+8)
  91 #define MIB2_CMOT               (IPPROTO_MAX+9)
  92 #define MIB2_TRANSMISSION       (IPPROTO_MAX+10)
  93 #define MIB2_SNMP               (IPPROTO_MAX+11)
  94 #define MIB2_IP6                (IPPROTO_MAX+12)
  95 #define MIB2_ICMP6              (IPPROTO_MAX+13)
  96 #define MIB2_TCP6               (IPPROTO_MAX+14)
  97 #define MIB2_UDP6               (IPPROTO_MAX+15)
  98 #define MIB2_SCTP               (IPPROTO_MAX+16)
  99 #define MIB2_DCCP               (IPPROTO_MAX+17)
 100 #define MIB2_DCCP6              (IPPROTO_MAX+18)
 101 
 102 /*
 103  * Define range of levels for use with MIB2_*
 104  */
 105 #define MIB2_RANGE_START        (IPPROTO_MAX+1)
 106 #define MIB2_RANGE_END          (IPPROTO_MAX+18)
 107 
 108 
 109 #define EXPER                   1024    /* experimental - not part of mib */
 110 #define EXPER_IGMP              (EXPER+1)
 111 #define EXPER_DVMRP             (EXPER+2)
 112 #define EXPER_RAWIP             (EXPER+3)
 113 #define EXPER_IP_AND_ALL_IRES   (EXPER+4)
 114 
 115 /*
 116  * Define range of levels for experimental use
 117  */
 118 #define EXPER_RANGE_START       (EXPER+1)
 119 #define EXPER_RANGE_END         (EXPER+4)
 120 
 121 #define BUMP_MIB(s, x)          {                               \
 122         extern void __dtrace_probe___mib_##x(int, void *);      \
 123         void *stataddr = &((s)->x);                              \
 124         __dtrace_probe___mib_##x(1, stataddr);                  \
 125         (s)->x++;                                            \
 126 }
 127 
 128 #define UPDATE_MIB(s, x, y)     {                               \
 129         extern void __dtrace_probe___mib_##x(int, void *);      \
 130         void *stataddr = &((s)->x);                              \
 131         __dtrace_probe___mib_##x(y, stataddr);                  \
 132         (s)->x += (y);                                               \
 133 }
 134 
 135 #define SET_MIB(x, y)           x = y
 136 #define BUMP_LOCAL(x)           (x)++
 137 #define UPDATE_LOCAL(x, y)      (x) += (y)
 138 #define SYNC32_MIB(s, m32, m64) SET_MIB((s)->m32, (s)->m64 & 0xffffffff)
 139 
 140 /*
 141  * Each struct that has been extended have a macro (MIB_FIRST_NEW_ELM_type)
 142  * that is set to the first new element of the extended struct.
 143  * The LEGACY_MIB_SIZE macro can be used to determine the size of MIB
 144  * objects that needs to be returned to older applications unaware of
 145  * these extensions.
 146  */
 147 #define MIB_PTRDIFF(s, e)       (caddr_t)e - (caddr_t)s
 148 #define LEGACY_MIB_SIZE(s, t)   MIB_PTRDIFF(s, &(s)->MIB_FIRST_NEW_ELM_##t)
 149 
 150 #define OCTET_LENGTH    32      /* Must be at least LIFNAMSIZ */
 151 typedef struct Octet_s {
 152         int     o_length;
 153         char    o_bytes[OCTET_LENGTH];
 154 } Octet_t;
 155 
 156 typedef uint32_t        Counter;
 157 typedef uint32_t        Counter32;
 158 typedef uint64_t        Counter64;
 159 typedef uint32_t        Gauge;
 160 typedef uint32_t        IpAddress;
 161 typedef struct in6_addr Ip6Address;
 162 typedef Octet_t         DeviceName;
 163 typedef Octet_t         PhysAddress;
 164 typedef uint32_t        DeviceIndex;    /* Interface index */
 165 
 166 #define MIB2_UNKNOWN_INTERFACE  0
 167 #define MIB2_UNKNOWN_PROCESS    0
 168 
 169 /*
 170  *  IP group
 171  */
 172 #define MIB2_IP_ADDR            20      /* ipAddrEntry */
 173 #define MIB2_IP_ROUTE           21      /* ipRouteEntry */
 174 #define MIB2_IP_MEDIA           22      /* ipNetToMediaEntry */
 175 #define MIB2_IP6_ROUTE          23      /* ipv6RouteEntry */
 176 #define MIB2_IP6_MEDIA          24      /* ipv6NetToMediaEntry */
 177 #define MIB2_IP6_ADDR           25      /* ipv6AddrEntry */
 178 #define MIB2_IP_TRAFFIC_STATS   31      /* ipIfStatsEntry (IPv4) */
 179 #define EXPER_IP_GROUP_MEMBERSHIP       100
 180 #define EXPER_IP6_GROUP_MEMBERSHIP      101
 181 #define EXPER_IP_GROUP_SOURCES          102
 182 #define EXPER_IP6_GROUP_SOURCES         103
 183 #define EXPER_IP_RTATTR                 104
 184 #define EXPER_IP_DCE                    105
 185 
 186 /*
 187  * There can be one of each of these tables per transport (MIB2_* above).
 188  */
 189 #define EXPER_XPORT_MLP         105     /* transportMLPEntry */
 190 
 191 /* Old names retained for compatibility */
 192 #define MIB2_IP_20      MIB2_IP_ADDR
 193 #define MIB2_IP_21      MIB2_IP_ROUTE
 194 #define MIB2_IP_22      MIB2_IP_MEDIA
 195 
 196 typedef struct mib2_ip {
 197                 /* forwarder?  1 gateway, 2 NOT gateway {ip 1} RW */
 198         int     ipForwarding;
 199                 /* default Time-to-Live for iph         {ip 2} RW */
 200         int     ipDefaultTTL;
 201                 /* # of input datagrams                 {ip 3} */
 202         Counter ipInReceives;
 203                 /* # of dg discards for iph error       {ip 4} */
 204         Counter ipInHdrErrors;
 205                 /* # of dg discards for bad addr        {ip 5} */
 206         Counter ipInAddrErrors;
 207                 /* # of dg being forwarded              {ip 6} */
 208         Counter ipForwDatagrams;
 209                 /* # of dg discards for unk protocol    {ip 7} */
 210         Counter ipInUnknownProtos;
 211                 /* # of dg discards of good dg's        {ip 8} */
 212         Counter ipInDiscards;
 213                 /* # of dg sent upstream                {ip 9} */
 214         Counter ipInDelivers;
 215                 /* # of outdgs recv'd from upstream     {ip 10} */
 216         Counter ipOutRequests;
 217                 /* # of good outdgs discarded           {ip 11} */
 218         Counter ipOutDiscards;
 219                 /* # of outdg discards: no route found  {ip 12} */
 220         Counter ipOutNoRoutes;
 221                 /* sec's recv'd frags held for reass.   {ip 13} */
 222         int     ipReasmTimeout;
 223                 /* # of ip frags needing reassembly     {ip 14} */
 224         Counter ipReasmReqds;
 225                 /* # of dg's reassembled                {ip 15} */
 226         Counter ipReasmOKs;
 227                 /* # of reassembly failures (not dg cnt){ip 16} */
 228         Counter ipReasmFails;
 229                 /* # of dg's fragged                    {ip 17} */
 230         Counter ipFragOKs;
 231                 /* # of dg discards for no frag set     {ip 18} */
 232         Counter ipFragFails;
 233                 /* # of dg frags from fragmentation     {ip 19} */
 234         Counter ipFragCreates;
 235                 /* {ip 20} */
 236         int     ipAddrEntrySize;
 237                 /* {ip 21} */
 238         int     ipRouteEntrySize;
 239                 /* {ip 22} */
 240         int     ipNetToMediaEntrySize;
 241                 /* # of valid route entries discarded   {ip 23} */
 242         Counter ipRoutingDiscards;
 243 /*
 244  * following defined in MIB-II as part of TCP & UDP groups:
 245  */
 246                 /* total # of segments recv'd with error        { tcp 14 } */
 247         Counter tcpInErrs;
 248                 /* # of recv'd dg's not deliverable (no appl.)  { udp 2 } */
 249         Counter udpNoPorts;
 250 /*
 251  * In addition to MIB-II
 252  */
 253                 /* # of bad IP header checksums */
 254         Counter ipInCksumErrs;
 255                 /* # of complete duplicates in reassembly */
 256         Counter ipReasmDuplicates;
 257                 /* # of partial duplicates in reassembly */
 258         Counter ipReasmPartDups;
 259                 /* # of packets not forwarded due to adminstrative reasons */
 260         Counter ipForwProhibits;
 261                 /* # of UDP packets with bad UDP checksums */
 262         Counter udpInCksumErrs;
 263                 /* # of UDP packets droped due to queue overflow */
 264         Counter udpInOverflows;
 265                 /*
 266                  * # of RAW IP packets (all IP protocols except UDP, TCP
 267                  * and ICMP) droped due to queue overflow
 268                  */
 269         Counter rawipInOverflows;
 270 
 271         /*
 272          * Folowing are private IPSEC MIB.
 273          */
 274         /* # of incoming packets that succeeded policy checks */
 275         Counter ipsecInSucceeded;
 276         /* # of incoming packets that failed policy checks */
 277         Counter ipsecInFailed;
 278 /* Compatible extensions added here */
 279         int     ipMemberEntrySize;      /* Size of ip_member_t */
 280         int     ipGroupSourceEntrySize; /* Size of ip_grpsrc_t */
 281 
 282         Counter ipInIPv6; /* # of IPv6 packets received by IPv4 and dropped */
 283         Counter ipOutIPv6;              /* No longer used */
 284         Counter ipOutSwitchIPv6;        /* No longer used */
 285 
 286         int     ipRouteAttributeSize;   /* Size of mib2_ipAttributeEntry_t */
 287         int     transportMLPSize;       /* Size of mib2_transportMLPEntry_t */
 288         int     ipDestEntrySize;        /* Size of dest_cache_entry_t */
 289 } mib2_ip_t;
 290 
 291 /*
 292  *      ipv6IfStatsEntry OBJECT-TYPE
 293  *              SYNTAX     Ipv6IfStatsEntry
 294  *              MAX-ACCESS not-accessible
 295  *              STATUS     current
 296  *              DESCRIPTION
 297  *                      "An interface statistics entry containing objects
 298  *                      at a particular IPv6 interface."
 299  *              AUGMENTS { ipv6IfEntry }
 300  *              ::= { ipv6IfStatsTable 1 }
 301  *
 302  * Per-interface IPv6 statistics table
 303  */
 304 
 305 typedef struct mib2_ipv6IfStatsEntry {
 306         /* Local ifindex to identify the interface */
 307         DeviceIndex     ipv6IfIndex;
 308 
 309                 /* forwarder?  1 gateway, 2 NOT gateway {ipv6MIBObjects 1} RW */
 310         int     ipv6Forwarding;
 311                 /* default Hoplimit for IPv6            {ipv6MIBObjects 2} RW */
 312         int     ipv6DefaultHopLimit;
 313 
 314         int     ipv6IfStatsEntrySize;
 315         int     ipv6AddrEntrySize;
 316         int     ipv6RouteEntrySize;
 317         int     ipv6NetToMediaEntrySize;
 318         int     ipv6MemberEntrySize;            /* Size of ipv6_member_t */
 319         int     ipv6GroupSourceEntrySize;       /* Size of ipv6_grpsrc_t */
 320 
 321         /* # input datagrams (incl errors)      { ipv6IfStatsEntry 1 } */
 322         Counter ipv6InReceives;
 323         /* # errors in IPv6 headers and options { ipv6IfStatsEntry 2 } */
 324         Counter ipv6InHdrErrors;
 325         /* # exceeds outgoing link MTU          { ipv6IfStatsEntry 3 } */
 326         Counter ipv6InTooBigErrors;
 327         /* # discarded due to no route to dest  { ipv6IfStatsEntry 4 } */
 328         Counter ipv6InNoRoutes;
 329         /* # invalid or unsupported addresses   { ipv6IfStatsEntry 5 } */
 330         Counter ipv6InAddrErrors;
 331         /* # unknown next header                { ipv6IfStatsEntry 6 } */
 332         Counter ipv6InUnknownProtos;
 333         /* # too short packets                  { ipv6IfStatsEntry 7 } */
 334         Counter ipv6InTruncatedPkts;
 335         /* # discarded e.g. due to no buffers   { ipv6IfStatsEntry 8 } */
 336         Counter ipv6InDiscards;
 337         /* # delivered to upper layer protocols { ipv6IfStatsEntry 9 } */
 338         Counter ipv6InDelivers;
 339         /* # forwarded out interface            { ipv6IfStatsEntry 10 } */
 340         Counter ipv6OutForwDatagrams;
 341         /* # originated out interface           { ipv6IfStatsEntry 11 } */
 342         Counter ipv6OutRequests;
 343         /* # discarded e.g. due to no buffers   { ipv6IfStatsEntry 12 } */
 344         Counter ipv6OutDiscards;
 345         /* # sucessfully fragmented packets     { ipv6IfStatsEntry 13 } */
 346         Counter ipv6OutFragOKs;
 347         /* # fragmentation failed               { ipv6IfStatsEntry 14 } */
 348         Counter ipv6OutFragFails;
 349         /* # fragments created                  { ipv6IfStatsEntry 15 } */
 350         Counter ipv6OutFragCreates;
 351         /* # fragments to reassemble            { ipv6IfStatsEntry 16 } */
 352         Counter ipv6ReasmReqds;
 353         /* # packets after reassembly           { ipv6IfStatsEntry 17 } */
 354         Counter ipv6ReasmOKs;
 355         /* # reassembly failed                  { ipv6IfStatsEntry 18 } */
 356         Counter ipv6ReasmFails;
 357         /* # received multicast packets         { ipv6IfStatsEntry 19 } */
 358         Counter ipv6InMcastPkts;
 359         /* # transmitted multicast packets      { ipv6IfStatsEntry 20 } */
 360         Counter ipv6OutMcastPkts;
 361 /*
 362  * In addition to defined MIBs
 363  */
 364                 /* # discarded due to no route to dest */
 365         Counter ipv6OutNoRoutes;
 366                 /* # of complete duplicates in reassembly */
 367         Counter ipv6ReasmDuplicates;
 368                 /* # of partial duplicates in reassembly */
 369         Counter ipv6ReasmPartDups;
 370                 /* # of packets not forwarded due to adminstrative reasons */
 371         Counter ipv6ForwProhibits;
 372                 /* # of UDP packets with bad UDP checksums */
 373         Counter udpInCksumErrs;
 374                 /* # of UDP packets droped due to queue overflow */
 375         Counter udpInOverflows;
 376                 /*
 377                  * # of RAW IPv6 packets (all IPv6 protocols except UDP, TCP
 378                  * and ICMPv6) droped due to queue overflow
 379                  */
 380         Counter rawipInOverflows;
 381 
 382                 /* # of IPv4 packets received by IPv6 and dropped */
 383         Counter ipv6InIPv4;
 384                 /* # of IPv4 packets transmitted by ip_wput_wput */
 385         Counter ipv6OutIPv4;
 386                 /* # of times ip_wput_v6 has switched to become ip_wput */
 387         Counter ipv6OutSwitchIPv4;
 388 } mib2_ipv6IfStatsEntry_t;
 389 
 390 /*
 391  * Per interface IP statistics, both v4 and v6.
 392  *
 393  * Some applications expect to get mib2_ipv6IfStatsEntry_t structs back when
 394  * making a request. To ensure backwards compatability, the first
 395  * sizeof(mib2_ipv6IfStatsEntry_t) bytes of the structure is identical to
 396  * mib2_ipv6IfStatsEntry_t. This should work as long the application is
 397  * written correctly (i.e., using ipv6IfStatsEntrySize to get the size of
 398  * the struct)
 399  *
 400  * RFC4293 introduces several new counters, as well as defining 64-bit
 401  * versions of existing counters. For a new counters, if they have both 32-
 402  * and 64-bit versions, then we only added the latter. However, for already
 403  * existing counters, we have added the 64-bit versions without removing the
 404  * old (32-bit) ones. The 64- and 32-bit counters will only be synchronized
 405  * when the structure contains IPv6 statistics, which is done to ensure
 406  * backwards compatibility.
 407  */
 408 
 409 /* The following are defined in RFC 4001 and are used for ipIfStatsIPVersion */
 410 #define MIB2_INETADDRESSTYPE_unknown    0
 411 #define MIB2_INETADDRESSTYPE_ipv4       1
 412 #define MIB2_INETADDRESSTYPE_ipv6       2
 413 
 414 /*
 415  * On amd64, the alignment requirements for long long's is different for
 416  * 32 and 64 bits. If we have a struct containing long long's that is being
 417  * passed between a 64-bit kernel to a 32-bit application, then it is very
 418  * likely that the size of the struct will differ due to padding. Therefore, we
 419  * pack the data to ensure that the struct size is the same for 32- and
 420  * 64-bits.
 421  */
 422 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
 423 #pragma pack(4)
 424 #endif
 425 
 426 typedef struct mib2_ipIfStatsEntry {
 427 
 428         /* Local ifindex to identify the interface */
 429         DeviceIndex     ipIfStatsIfIndex;
 430 
 431         /* forwarder?  1 gateway, 2 NOT gateway { ipv6MIBObjects 1} RW */
 432         int     ipIfStatsForwarding;
 433         /* default Hoplimit for IPv6            { ipv6MIBObjects 2} RW */
 434         int     ipIfStatsDefaultHopLimit;
 435 #define ipIfStatsDefaultTTL     ipIfStatsDefaultHopLimit
 436 
 437         int     ipIfStatsEntrySize;
 438         int     ipIfStatsAddrEntrySize;
 439         int     ipIfStatsRouteEntrySize;
 440         int     ipIfStatsNetToMediaEntrySize;
 441         int     ipIfStatsMemberEntrySize;
 442         int     ipIfStatsGroupSourceEntrySize;
 443 
 444         /* # input datagrams (incl errors)      { ipIfStatsEntry 3 } */
 445         Counter ipIfStatsInReceives;
 446         /* # errors in IP headers and options   { ipIfStatsEntry 7 } */
 447         Counter ipIfStatsInHdrErrors;
 448         /* # exceeds outgoing link MTU(v6 only) { ipv6IfStatsEntry 3 } */
 449         Counter ipIfStatsInTooBigErrors;
 450         /* # discarded due to no route to dest  { ipIfStatsEntry 8 } */
 451         Counter ipIfStatsInNoRoutes;
 452         /* # invalid or unsupported addresses   { ipIfStatsEntry 9 } */
 453         Counter ipIfStatsInAddrErrors;
 454         /* # unknown next header                { ipIfStatsEntry 10 } */
 455         Counter ipIfStatsInUnknownProtos;
 456         /* # too short packets                  { ipIfStatsEntry 11 } */
 457         Counter ipIfStatsInTruncatedPkts;
 458         /* # discarded e.g. due to no buffers   { ipIfStatsEntry 17 } */
 459         Counter ipIfStatsInDiscards;
 460         /* # delivered to upper layer protocols { ipIfStatsEntry 18 } */
 461         Counter ipIfStatsInDelivers;
 462         /* # forwarded out interface            { ipIfStatsEntry 23 } */
 463         Counter ipIfStatsOutForwDatagrams;
 464         /* # originated out interface           { ipIfStatsEntry 20 } */
 465         Counter ipIfStatsOutRequests;
 466         /* # discarded e.g. due to no buffers   { ipIfStatsEntry 25 } */
 467         Counter ipIfStatsOutDiscards;
 468         /* # sucessfully fragmented packets     { ipIfStatsEntry 27 } */
 469         Counter ipIfStatsOutFragOKs;
 470         /* # fragmentation failed               { ipIfStatsEntry 28 } */
 471         Counter ipIfStatsOutFragFails;
 472         /* # fragments created                  { ipIfStatsEntry 29 } */
 473         Counter ipIfStatsOutFragCreates;
 474         /* # fragments to reassemble            { ipIfStatsEntry 14 } */
 475         Counter ipIfStatsReasmReqds;
 476         /* # packets after reassembly           { ipIfStatsEntry 15 } */
 477         Counter ipIfStatsReasmOKs;
 478         /* # reassembly failed                  { ipIfStatsEntry 16 } */
 479         Counter ipIfStatsReasmFails;
 480         /* # received multicast packets         { ipIfStatsEntry 34 } */
 481         Counter ipIfStatsInMcastPkts;
 482         /* # transmitted multicast packets      { ipIfStatsEntry 38 } */
 483         Counter ipIfStatsOutMcastPkts;
 484 
 485         /*
 486          * In addition to defined MIBs
 487          */
 488 
 489         /* # discarded due to no route to dest  { ipSystemStatsEntry 22 } */
 490         Counter ipIfStatsOutNoRoutes;
 491         /* # of complete duplicates in reassembly */
 492         Counter ipIfStatsReasmDuplicates;
 493         /* # of partial duplicates in reassembly */
 494         Counter ipIfStatsReasmPartDups;
 495         /* # of packets not forwarded due to adminstrative reasons */
 496         Counter ipIfStatsForwProhibits;
 497         /* # of UDP packets with bad UDP checksums */
 498         Counter udpInCksumErrs;
 499 #define udpIfStatsInCksumErrs   udpInCksumErrs
 500         /* # of UDP packets droped due to queue overflow */
 501         Counter udpInOverflows;
 502 #define udpIfStatsInOverflows   udpInOverflows
 503         /*
 504          * # of RAW IP packets (all IP protocols except UDP, TCP
 505          * and ICMP) droped due to queue overflow
 506          */
 507         Counter rawipInOverflows;
 508 #define rawipIfStatsInOverflows rawipInOverflows
 509 
 510         /*
 511          * # of IP packets received with the wrong version (i.e., not equal
 512          * to ipIfStatsIPVersion) and that were dropped.
 513          */
 514         Counter ipIfStatsInWrongIPVersion;
 515         /*
 516          * This counter is no longer used
 517          */
 518         Counter ipIfStatsOutWrongIPVersion;
 519         /*
 520          * This counter is no longer used
 521          */
 522         Counter ipIfStatsOutSwitchIPVersion;
 523 
 524         /*
 525          * Fields defined in RFC 4293
 526          */
 527 
 528         /* ip version                           { ipIfStatsEntry 1 } */
 529         int             ipIfStatsIPVersion;
 530         /* # input datagrams (incl errors)      { ipIfStatsEntry 4 } */
 531         Counter64       ipIfStatsHCInReceives;
 532         /* # input octets (incl errors)         { ipIfStatsEntry 6 } */
 533         Counter64       ipIfStatsHCInOctets;
 534         /*
 535          *                                      { ipIfStatsEntry 13 }
 536          * # input datagrams for which a forwarding attempt was made
 537          */
 538         Counter64       ipIfStatsHCInForwDatagrams;
 539         /* # delivered to upper layer protocols { ipIfStatsEntry 19 } */
 540         Counter64       ipIfStatsHCInDelivers;
 541         /* # originated out interface           { ipIfStatsEntry 21 } */
 542         Counter64       ipIfStatsHCOutRequests;
 543         /* # forwarded out interface            { ipIfStatsEntry 23 } */
 544         Counter64       ipIfStatsHCOutForwDatagrams;
 545         /* # dg's requiring fragmentation       { ipIfStatsEntry 26 } */
 546         Counter         ipIfStatsOutFragReqds;
 547         /* # output datagrams                   { ipIfStatsEntry 31 } */
 548         Counter64       ipIfStatsHCOutTransmits;
 549         /* # output octets                      { ipIfStatsEntry 33 } */
 550         Counter64       ipIfStatsHCOutOctets;
 551         /* # received multicast datagrams       { ipIfStatsEntry 35 } */
 552         Counter64       ipIfStatsHCInMcastPkts;
 553         /* # received multicast octets          { ipIfStatsEntry 37 } */
 554         Counter64       ipIfStatsHCInMcastOctets;
 555         /* # transmitted multicast datagrams    { ipIfStatsEntry 39 } */
 556         Counter64       ipIfStatsHCOutMcastPkts;
 557         /* # transmitted multicast octets       { ipIfStatsEntry 41 } */
 558         Counter64       ipIfStatsHCOutMcastOctets;
 559         /* # received broadcast datagrams       { ipIfStatsEntry 43 } */
 560         Counter64       ipIfStatsHCInBcastPkts;
 561         /* # transmitted broadcast datagrams    { ipIfStatsEntry 45 } */
 562         Counter64       ipIfStatsHCOutBcastPkts;
 563 
 564         /*
 565          * Fields defined in mib2_ip_t
 566          */
 567 
 568         /* # of incoming packets that succeeded policy checks */
 569         Counter         ipsecInSucceeded;
 570 #define ipsecIfStatsInSucceeded ipsecInSucceeded
 571         /* # of incoming packets that failed policy checks */
 572         Counter         ipsecInFailed;
 573 #define ipsecIfStatsInFailed    ipsecInFailed
 574         /* # of bad IP header checksums */
 575         Counter         ipInCksumErrs;
 576 #define ipIfStatsInCksumErrs    ipInCksumErrs
 577         /* total # of segments recv'd with error        { tcp 14 } */
 578         Counter         tcpInErrs;
 579 #define tcpIfStatsInErrs        tcpInErrs
 580         /* # of recv'd dg's not deliverable (no appl.)  { udp 2 } */
 581         Counter         udpNoPorts;
 582 #define udpIfStatsNoPorts       udpNoPorts
 583 } mib2_ipIfStatsEntry_t;
 584 #define MIB_FIRST_NEW_ELM_mib2_ipIfStatsEntry_t ipIfStatsIPVersion
 585 
 586 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
 587 #pragma pack()
 588 #endif
 589 
 590 /*
 591  * The IP address table contains this entity's IP addressing information.
 592  *
 593  *      ipAddrTable OBJECT-TYPE
 594  *              SYNTAX  SEQUENCE OF IpAddrEntry
 595  *              ACCESS  not-accessible
 596  *              STATUS  mandatory
 597  *              DESCRIPTION
 598  *                      "The table of addressing information relevant to
 599  *                      this entity's IP addresses."
 600  *              ::= { ip 20 }
 601  */
 602 
 603 typedef struct mib2_ipAddrEntry {
 604                         /* IP address of this entry     {ipAddrEntry 1} */
 605         IpAddress       ipAdEntAddr;
 606                         /* Unique interface index       {ipAddrEntry 2} */
 607         DeviceName      ipAdEntIfIndex;
 608                         /* Subnet mask for this IP addr {ipAddrEntry 3} */
 609         IpAddress       ipAdEntNetMask;
 610                         /* 2^lsb of IP broadcast addr   {ipAddrEntry 4} */
 611         int             ipAdEntBcastAddr;
 612                         /* max size for dg reassembly   {ipAddrEntry 5} */
 613         int             ipAdEntReasmMaxSize;
 614                         /* additional ipif_t fields */
 615         struct ipAdEntInfo_s {
 616                 Gauge           ae_mtu;
 617                                 /* BSD if metric */
 618                 int             ae_metric;
 619                                 /* ipif broadcast addr.  relation to above?? */
 620                 IpAddress       ae_broadcast_addr;
 621                                 /* point-point dest addr */
 622                 IpAddress       ae_pp_dst_addr;
 623                 int             ae_flags;       /* IFF_* flags in if.h */
 624                 Counter         ae_ibcnt;       /* Inbound packets */
 625                 Counter         ae_obcnt;       /* Outbound packets */
 626                 Counter         ae_focnt;       /* Forwarded packets */
 627                 IpAddress       ae_subnet;      /* Subnet prefix */
 628                 int             ae_subnet_len;  /* Subnet prefix length */
 629                 IpAddress       ae_src_addr;    /* Source address */
 630         }               ipAdEntInfo;
 631         uint32_t        ipAdEntRetransmitTime;  /* ipInterfaceRetransmitTime */
 632 } mib2_ipAddrEntry_t;
 633 #define MIB_FIRST_NEW_ELM_mib2_ipAddrEntry_t    ipAdEntRetransmitTime
 634 
 635 /*
 636  *      ipv6AddrTable OBJECT-TYPE
 637  *              SYNTAX      SEQUENCE OF Ipv6AddrEntry
 638  *              MAX-ACCESS  not-accessible
 639  *              STATUS      current
 640  *              DESCRIPTION
 641  *                      "The table of addressing information relevant to
 642  *                      this node's interface addresses."
 643  *              ::= { ipv6MIBObjects 8 }
 644  */
 645 
 646 typedef struct mib2_ipv6AddrEntry {
 647         /* Unique interface index                       { Part of INDEX } */
 648         DeviceName      ipv6AddrIfIndex;
 649 
 650         /* IPv6 address of this entry                   { ipv6AddrEntry 1 } */
 651         Ip6Address      ipv6AddrAddress;
 652         /* Prefix length                                { ipv6AddrEntry 2 } */
 653         uint_t          ipv6AddrPfxLength;
 654         /* Type: stateless(1), stateful(2), unknown(3)  { ipv6AddrEntry 3 } */
 655         uint_t          ipv6AddrType;
 656         /* Anycast: true(1), false(2)                   { ipv6AddrEntry 4 } */
 657         uint_t          ipv6AddrAnycastFlag;
 658         /*
 659          * Address status: preferred(1), deprecated(2), invalid(3),
 660          * inaccessible(4), unknown(5)                  { ipv6AddrEntry 5 }
 661          */
 662         uint_t          ipv6AddrStatus;
 663         struct ipv6AddrInfo_s {
 664                 Gauge           ae_mtu;
 665                                 /* BSD if metric */
 666                 int             ae_metric;
 667                                 /* point-point dest addr */
 668                 Ip6Address      ae_pp_dst_addr;
 669                 int             ae_flags;       /* IFF_* flags in if.h */
 670                 Counter         ae_ibcnt;       /* Inbound packets */
 671                 Counter         ae_obcnt;       /* Outbound packets */
 672                 Counter         ae_focnt;       /* Forwarded packets */
 673                 Ip6Address      ae_subnet;      /* Subnet prefix */
 674                 int             ae_subnet_len;  /* Subnet prefix length */
 675                 Ip6Address      ae_src_addr;    /* Source address */
 676         }               ipv6AddrInfo;
 677         uint32_t        ipv6AddrReasmMaxSize;   /* InterfaceReasmMaxSize */
 678         Ip6Address      ipv6AddrIdentifier;     /* InterfaceIdentifier */
 679         uint32_t        ipv6AddrIdentifierLen;
 680         uint32_t        ipv6AddrReachableTime;  /* InterfaceReachableTime */
 681         uint32_t        ipv6AddrRetransmitTime; /* InterfaceRetransmitTime */
 682 } mib2_ipv6AddrEntry_t;
 683 #define MIB_FIRST_NEW_ELM_mib2_ipv6AddrEntry_t  ipv6AddrReasmMaxSize
 684 
 685 /*
 686  * The IP routing table contains an entry for each route presently known to
 687  * this entity. (for IPv4 routes)
 688  *
 689  *      ipRouteTable OBJECT-TYPE
 690  *              SYNTAX  SEQUENCE OF IpRouteEntry
 691  *              ACCESS  not-accessible
 692  *              STATUS  mandatory
 693  *              DESCRIPTION
 694  *                      "This entity's IP Routing table."
 695  *              ::= { ip 21 }
 696  */
 697 
 698 typedef struct mib2_ipRouteEntry {
 699                 /* dest ip addr for this route          {ipRouteEntry 1 } RW */
 700         IpAddress       ipRouteDest;
 701                 /* unique interface index for this hop  {ipRouteEntry 2 } RW */
 702         DeviceName      ipRouteIfIndex;
 703                 /* primary route metric                 {ipRouteEntry 3 } RW */
 704         int             ipRouteMetric1;
 705                 /* alternate route metric               {ipRouteEntry 4 } RW */
 706         int             ipRouteMetric2;
 707                 /* alternate route metric               {ipRouteEntry 5 } RW */
 708         int             ipRouteMetric3;
 709                 /* alternate route metric               {ipRouteEntry 6 } RW */
 710         int             ipRouteMetric4;
 711                 /* ip addr of next hop on this route    {ipRouteEntry 7 } RW */
 712         IpAddress       ipRouteNextHop;
 713                 /* other(1), inval(2), dir(3), indir(4) {ipRouteEntry 8 } RW */
 714         int             ipRouteType;
 715                 /* mechanism by which route was learned {ipRouteEntry 9 } */
 716         int             ipRouteProto;
 717                 /* sec's since last update of route     {ipRouteEntry 10} RW */
 718         int             ipRouteAge;
 719                 /*                                      {ipRouteEntry 11} RW */
 720         IpAddress       ipRouteMask;
 721                 /* alternate route metric               {ipRouteEntry 12} RW */
 722         int             ipRouteMetric5;
 723                 /* additional info from ire's           {ipRouteEntry 13 } */
 724         struct ipRouteInfo_s {
 725                 Gauge           re_max_frag;
 726                 Gauge           re_rtt;
 727                 Counter         re_ref;
 728                 int             re_frag_flag;
 729                 IpAddress       re_src_addr;
 730                 int             re_ire_type;
 731                 Counter         re_obpkt;
 732                 Counter         re_ibpkt;
 733                 int             re_flags;
 734                 /*
 735                  * The following two elements (re_in_ill and re_in_src_addr)
 736                  * are no longer used but are left here for the benefit of
 737                  * old Apps that won't be able to handle the change in the
 738                  * size of this struct. These elements will always be
 739                  * set to zeroes.
 740                  */
 741                 DeviceName      re_in_ill;      /* Input interface */
 742                 IpAddress       re_in_src_addr; /* Input source address */
 743         }               ipRouteInfo;
 744 } mib2_ipRouteEntry_t;
 745 
 746 /*
 747  * The IPv6 routing table contains an entry for each route presently known to
 748  * this entity.
 749  *
 750  *      ipv6RouteTable OBJECT-TYPE
 751  *              SYNTAX  SEQUENCE OF IpRouteEntry
 752  *              ACCESS  not-accessible
 753  *              STATUS  current
 754  *              DESCRIPTION
 755  *                      "IPv6 Routing table. This table contains
 756  *                      an entry for each valid IPv6 unicast route
 757  *                      that can be used for packet forwarding
 758  *                      determination."
 759  *              ::= { ipv6MIBObjects 11 }
 760  */
 761 
 762 typedef struct mib2_ipv6RouteEntry {
 763                 /* dest ip addr for this route          { ipv6RouteEntry 1 } */
 764         Ip6Address      ipv6RouteDest;
 765                 /* prefix length                        { ipv6RouteEntry 2 } */
 766         int             ipv6RoutePfxLength;
 767                 /* unique route index                   { ipv6RouteEntry 3 } */
 768         unsigned        ipv6RouteIndex;
 769                 /* unique interface index for this hop  { ipv6RouteEntry 4 } */
 770         DeviceName      ipv6RouteIfIndex;
 771                 /* IPv6 addr of next hop on this route  { ipv6RouteEntry 5 } */
 772         Ip6Address      ipv6RouteNextHop;
 773                 /* other(1), discard(2), local(3), remote(4) */
 774                 /*                                      { ipv6RouteEntry 6 } */
 775         int             ipv6RouteType;
 776                 /* mechanism by which route was learned { ipv6RouteEntry 7 } */
 777                 /*
 778                  * other(1), local(2), netmgmt(3), ndisc(4), rip(5), ospf(6),
 779                  * bgp(7), idrp(8), igrp(9)
 780                  */
 781         int             ipv6RouteProtocol;
 782                 /* policy hook or traffic class         { ipv6RouteEntry 8 } */
 783         unsigned        ipv6RoutePolicy;
 784                 /* sec's since last update of route     { ipv6RouteEntry 9} */
 785         int             ipv6RouteAge;
 786                 /* Routing domain ID of the next hop    { ipv6RouteEntry 10 } */
 787         unsigned        ipv6RouteNextHopRDI;
 788                 /* route metric                         { ipv6RouteEntry 11 } */
 789         unsigned        ipv6RouteMetric;
 790                 /* preference (impl specific)           { ipv6RouteEntry 12 } */
 791         unsigned        ipv6RouteWeight;
 792                 /* additional info from ire's           { } */
 793         struct ipv6RouteInfo_s {
 794                 Gauge           re_max_frag;
 795                 Gauge           re_rtt;
 796                 Counter         re_ref;
 797                 int             re_frag_flag;
 798                 Ip6Address      re_src_addr;
 799                 int             re_ire_type;
 800                 Counter         re_obpkt;
 801                 Counter         re_ibpkt;
 802                 int             re_flags;
 803         }               ipv6RouteInfo;
 804 } mib2_ipv6RouteEntry_t;
 805 
 806 /*
 807  * The IPv4 and IPv6 routing table entries on a trusted system also have
 808  * security attributes in the form of label ranges.  This experimental
 809  * interface provides information about these labels.
 810  *
 811  * Each entry in this table contains a label range and an index that refers
 812  * back to the entry in the routing table to which it applies.  There may be 0,
 813  * 1, or many label ranges for each routing table entry.
 814  *
 815  * (opthdr.level is set to MIB2_IP for IPv4 entries and MIB2_IP6 for IPv6.
 816  * opthdr.name is set to EXPER_IP_GWATTR.)
 817  *
 818  *      ipRouteAttributeTable OBJECT-TYPE
 819  *              SYNTAX  SEQUENCE OF IpAttributeEntry
 820  *              ACCESS  not-accessible
 821  *              STATUS  current
 822  *              DESCRIPTION
 823  *                      "IPv4 routing attributes table.  This table contains
 824  *                      an entry for each valid trusted label attached to a
 825  *                      route in the system."
 826  *              ::= { ip 102 }
 827  *
 828  *      ipv6RouteAttributeTable OBJECT-TYPE
 829  *              SYNTAX  SEQUENCE OF IpAttributeEntry
 830  *              ACCESS  not-accessible
 831  *              STATUS  current
 832  *              DESCRIPTION
 833  *                      "IPv6 routing attributes table.  This table contains
 834  *                      an entry for each valid trusted label attached to a
 835  *                      route in the system."
 836  *              ::= { ip6 102 }
 837  */
 838 
 839 typedef struct mib2_ipAttributeEntry {
 840         uint_t          iae_routeidx;
 841         int             iae_doi;
 842         brange_t        iae_slrange;
 843 } mib2_ipAttributeEntry_t;
 844 
 845 /*
 846  * The IP address translation table contain the IpAddress to
 847  * `physical' address equivalences.  Some interfaces do not
 848  * use translation tables for determining address
 849  * equivalences (e.g., DDN-X.25 has an algorithmic method);
 850  * if all interfaces are of this type, then the Address
 851  * Translation table is empty, i.e., has zero entries.
 852  *
 853  *      ipNetToMediaTable OBJECT-TYPE
 854  *              SYNTAX  SEQUENCE OF IpNetToMediaEntry
 855  *              ACCESS  not-accessible
 856  *              STATUS  mandatory
 857  *              DESCRIPTION
 858  *                      "The IP Address Translation table used for mapping
 859  *                      from IP addresses to physical addresses."
 860  *              ::= { ip 22 }
 861  */
 862 
 863 typedef struct mib2_ipNetToMediaEntry {
 864         /* Unique interface index               { ipNetToMediaEntry 1 } RW */
 865         DeviceName      ipNetToMediaIfIndex;
 866         /* Media dependent physical addr        { ipNetToMediaEntry 2 } RW */
 867         PhysAddress     ipNetToMediaPhysAddress;
 868         /* ip addr for this physical addr       { ipNetToMediaEntry 3 } RW */
 869         IpAddress       ipNetToMediaNetAddress;
 870         /* other(1), inval(2), dyn(3), stat(4)  { ipNetToMediaEntry 4 } RW */
 871         int             ipNetToMediaType;
 872         struct ipNetToMediaInfo_s {
 873                 PhysAddress     ntm_mask;       /* subnet mask for entry */
 874                 int             ntm_flags;      /* ACE_F_* flags in arp.h */
 875         }               ipNetToMediaInfo;
 876 } mib2_ipNetToMediaEntry_t;
 877 
 878 /*
 879  *      ipv6NetToMediaTable OBJECT-TYPE
 880  *               SYNTAX      SEQUENCE OF Ipv6NetToMediaEntry
 881  *               MAX-ACCESS  not-accessible
 882  *               STATUS      current
 883  *               DESCRIPTION
 884  *                      "The IPv6 Address Translation table used for
 885  *                      mapping from IPv6 addresses to physical addresses.
 886  *
 887  *                      The IPv6 address translation table contain the
 888  *                      Ipv6Address to `physical' address equivalencies.
 889  *                      Some interfaces do not use translation tables
 890  *                      for determining address equivalencies; if all
 891  *                      interfaces are of this type, then the Address
 892  *                      Translation table is empty, i.e., has zero
 893  *                      entries."
 894  *              ::= { ipv6MIBObjects 12 }
 895  */
 896 
 897 typedef struct mib2_ipv6NetToMediaEntry {
 898         /* Unique interface index               { Part of INDEX } */
 899         DeviceIndex     ipv6NetToMediaIfIndex;
 900 
 901         /* ip addr for this physical addr       { ipv6NetToMediaEntry 1 } */
 902         Ip6Address      ipv6NetToMediaNetAddress;
 903         /* Media dependent physical addr        { ipv6NetToMediaEntry 2 } */
 904         PhysAddress     ipv6NetToMediaPhysAddress;
 905         /*
 906          * Type of mapping
 907          * other(1), dynamic(2), static(3), local(4)
 908          *                                      { ipv6NetToMediaEntry 3 }
 909          */
 910         int             ipv6NetToMediaType;
 911         /*
 912          * NUD state
 913          * reachable(1), stale(2), delay(3), probe(4), invalid(5), unknown(6)
 914          * Note: The kernel returns ND_* states.
 915          *                                      { ipv6NetToMediaEntry 4 }
 916          */
 917         int             ipv6NetToMediaState;
 918         /* sysUpTime last time entry was updated { ipv6NetToMediaEntry 5 } */
 919         int             ipv6NetToMediaLastUpdated;
 920 } mib2_ipv6NetToMediaEntry_t;
 921 
 922 
 923 /*
 924  * List of group members per interface
 925  */
 926 typedef struct ip_member {
 927         /* Interface index */
 928         DeviceName      ipGroupMemberIfIndex;
 929         /* IP Multicast address */
 930         IpAddress       ipGroupMemberAddress;
 931         /* Number of member sockets */
 932         Counter         ipGroupMemberRefCnt;
 933         /* Filter mode: 1 => include, 2 => exclude */
 934         int             ipGroupMemberFilterMode;
 935 } ip_member_t;
 936 
 937 
 938 /*
 939  * List of IPv6 group members per interface
 940  */
 941 typedef struct ipv6_member {
 942         /* Interface index */
 943         DeviceIndex     ipv6GroupMemberIfIndex;
 944         /* IP Multicast address */
 945         Ip6Address      ipv6GroupMemberAddress;
 946         /* Number of member sockets */
 947         Counter         ipv6GroupMemberRefCnt;
 948         /* Filter mode: 1 => include, 2 => exclude */
 949         int             ipv6GroupMemberFilterMode;
 950 } ipv6_member_t;
 951 
 952 /*
 953  * This is used to mark transport layer entities (e.g., TCP connections) that
 954  * are capable of receiving packets from a range of labels.  'level' is set to
 955  * the protocol of interest (e.g., MIB2_TCP), and 'name' is set to
 956  * EXPER_XPORT_MLP.  The tme_connidx refers back to the entry in MIB2_TCP_CONN,
 957  * MIB2_TCP6_CONN, or MIB2_SCTP_CONN.
 958  *
 959  * It is also used to report connections that receive packets at a single label
 960  * that's other than the zone's label.  This is the case when a TCP connection
 961  * is accepted from a particular peer using an MLP listener.
 962  */
 963 typedef struct mib2_transportMLPEntry {
 964         uint_t          tme_connidx;
 965         uint_t          tme_flags;
 966         int             tme_doi;
 967         bslabel_t       tme_label;
 968 } mib2_transportMLPEntry_t;
 969 
 970 #define MIB2_TMEF_PRIVATE       0x00000001      /* MLP on private addresses */
 971 #define MIB2_TMEF_SHARED        0x00000002      /* MLP on shared addresses */
 972 #define MIB2_TMEF_ANONMLP       0x00000004      /* Anonymous MLP port */
 973 #define MIB2_TMEF_MACEXEMPT     0x00000008      /* MAC-Exempt port */
 974 #define MIB2_TMEF_IS_LABELED    0x00000010      /* tme_doi & tme_label exists */
 975 #define MIB2_TMEF_MACIMPLICIT   0x00000020      /* MAC-Implicit */
 976 /*
 977  * List of IPv4 source addresses being filtered per interface
 978  */
 979 typedef struct ip_grpsrc {
 980         /* Interface index */
 981         DeviceName      ipGroupSourceIfIndex;
 982         /* IP Multicast address */
 983         IpAddress       ipGroupSourceGroup;
 984         /* IP Source address */
 985         IpAddress       ipGroupSourceAddress;
 986 } ip_grpsrc_t;
 987 
 988 
 989 /*
 990  * List of IPv6 source addresses being filtered per interface
 991  */
 992 typedef struct ipv6_grpsrc {
 993         /* Interface index */
 994         DeviceIndex     ipv6GroupSourceIfIndex;
 995         /* IP Multicast address */
 996         Ip6Address      ipv6GroupSourceGroup;
 997         /* IP Source address */
 998         Ip6Address      ipv6GroupSourceAddress;
 999 } ipv6_grpsrc_t;
1000 
1001 
1002 /*
1003  * List of destination cache entries
1004  */
1005 typedef struct dest_cache_entry {
1006         /* IP Multicast address */
1007         IpAddress       DestIpv4Address;
1008         Ip6Address      DestIpv6Address;
1009         uint_t          DestFlags;      /* DCEF_* */
1010         uint32_t        DestPmtu;       /* Path MTU if DCEF_PMTU */
1011         uint32_t        DestIdent;      /* Per destination IP ident. */
1012         DeviceIndex     DestIfindex;    /* For IPv6 link-locals */
1013         uint32_t        DestAge;        /* Age of MTU info in seconds */
1014 } dest_cache_entry_t;
1015 
1016 
1017 /*
1018  * ICMP Group
1019  */
1020 typedef struct mib2_icmp {
1021         /* total # of recv'd ICMP msgs                  { icmp 1 } */
1022         Counter icmpInMsgs;
1023         /* recv'd ICMP msgs with errors                 { icmp 2 } */
1024         Counter icmpInErrors;
1025         /* recv'd "dest unreachable" msg's              { icmp 3 } */
1026         Counter icmpInDestUnreachs;
1027         /* recv'd "time exceeded" msg's                 { icmp 4 } */
1028         Counter icmpInTimeExcds;
1029         /* recv'd "parameter problem" msg's             { icmp 5 } */
1030         Counter icmpInParmProbs;
1031         /* recv'd "source quench" msg's                 { icmp 6 } */
1032         Counter icmpInSrcQuenchs;
1033         /* recv'd "ICMP redirect" msg's                 { icmp 7 } */
1034         Counter icmpInRedirects;
1035         /* recv'd "echo request" msg's                  { icmp 8 } */
1036         Counter icmpInEchos;
1037         /* recv'd "echo reply" msg's                    { icmp 9 } */
1038         Counter icmpInEchoReps;
1039         /* recv'd "timestamp" msg's                     { icmp 10 } */
1040         Counter icmpInTimestamps;
1041         /* recv'd "timestamp reply" msg's               { icmp 11 } */
1042         Counter icmpInTimestampReps;
1043         /* recv'd "address mask request" msg's          { icmp 12 } */
1044         Counter icmpInAddrMasks;
1045         /* recv'd "address mask reply" msg's            { icmp 13 } */
1046         Counter icmpInAddrMaskReps;
1047         /* total # of sent ICMP msg's                   { icmp 14 } */
1048         Counter icmpOutMsgs;
1049         /* # of msg's not sent for internal icmp errors { icmp 15 } */
1050         Counter icmpOutErrors;
1051         /* # of "dest unreachable" msg's sent           { icmp 16 } */
1052         Counter icmpOutDestUnreachs;
1053         /* # of "time exceeded" msg's sent              { icmp 17 } */
1054         Counter icmpOutTimeExcds;
1055         /* # of "parameter problme" msg's sent          { icmp 18 } */
1056         Counter icmpOutParmProbs;
1057         /* # of "source quench" msg's sent              { icmp 19 } */
1058         Counter icmpOutSrcQuenchs;
1059         /* # of "ICMP redirect" msg's sent              { icmp 20 } */
1060         Counter icmpOutRedirects;
1061         /* # of "Echo request" msg's sent               { icmp 21 } */
1062         Counter icmpOutEchos;
1063         /* # of "Echo reply" msg's sent                 { icmp 22 } */
1064         Counter icmpOutEchoReps;
1065         /* # of "timestamp request" msg's sent          { icmp 23 } */
1066         Counter icmpOutTimestamps;
1067         /* # of "timestamp reply" msg's sent            { icmp 24 } */
1068         Counter icmpOutTimestampReps;
1069         /* # of "address mask request" msg's sent       { icmp 25 } */
1070         Counter icmpOutAddrMasks;
1071         /* # of "address mask reply" msg's sent         { icmp 26 } */
1072         Counter icmpOutAddrMaskReps;
1073 /*
1074  * In addition to MIB-II
1075  */
1076         /* # of received packets with checksum errors */
1077         Counter icmpInCksumErrs;
1078         /* # of received packets with unknow codes */
1079         Counter icmpInUnknowns;
1080         /* # of received unreachables with "fragmentation needed" */
1081         Counter icmpInFragNeeded;
1082         /* # of sent unreachables with "fragmentation needed" */
1083         Counter icmpOutFragNeeded;
1084         /*
1085          * # of msg's not sent since original packet was broadcast/multicast
1086          * or an ICMP error packet
1087          */
1088         Counter icmpOutDrops;
1089         /* # of ICMP packets droped due to queue overflow */
1090         Counter icmpInOverflows;
1091         /* recv'd "ICMP redirect" msg's that are bad thus ignored */
1092         Counter icmpInBadRedirects;
1093 } mib2_icmp_t;
1094 
1095 
1096 /*
1097  *      ipv6IfIcmpEntry OBJECT-TYPE
1098  *              SYNTAX      Ipv6IfIcmpEntry
1099  *              MAX-ACCESS  not-accessible
1100  *              STATUS      current
1101  *              DESCRIPTION
1102  *                      "An ICMPv6 statistics entry containing
1103  *                      objects at a particular IPv6 interface.
1104  *
1105  *                      Note that a receiving interface is
1106  *                      the interface to which a given ICMPv6 message
1107  *                      is addressed which may not be necessarily
1108  *                      the input interface for the message.
1109  *
1110  *                      Similarly, the sending interface is
1111  *                      the interface that sources a given
1112  *                      ICMP message which is usually but not
1113  *                      necessarily the output interface for the message."
1114  *              AUGMENTS { ipv6IfEntry }
1115  *              ::= { ipv6IfIcmpTable 1 }
1116  *
1117  * Per-interface ICMPv6 statistics table
1118  */
1119 
1120 typedef struct mib2_ipv6IfIcmpEntry {
1121         /* Local ifindex to identify the interface */
1122         DeviceIndex     ipv6IfIcmpIfIndex;
1123 
1124         int             ipv6IfIcmpEntrySize;    /* Size of ipv6IfIcmpEntry */
1125 
1126         /* The total # ICMP msgs rcvd includes ipv6IfIcmpInErrors */
1127         Counter32       ipv6IfIcmpInMsgs;
1128         /* # ICMP with ICMP-specific errors (bad checkum, length, etc) */
1129         Counter32       ipv6IfIcmpInErrors;
1130         /* # ICMP Destination Unreachable */
1131         Counter32       ipv6IfIcmpInDestUnreachs;
1132         /* # ICMP destination unreachable/communication admin prohibited */
1133         Counter32       ipv6IfIcmpInAdminProhibs;
1134         Counter32       ipv6IfIcmpInTimeExcds;
1135         Counter32       ipv6IfIcmpInParmProblems;
1136         Counter32       ipv6IfIcmpInPktTooBigs;
1137         Counter32       ipv6IfIcmpInEchos;
1138         Counter32       ipv6IfIcmpInEchoReplies;
1139         Counter32       ipv6IfIcmpInRouterSolicits;
1140         Counter32       ipv6IfIcmpInRouterAdvertisements;
1141         Counter32       ipv6IfIcmpInNeighborSolicits;
1142         Counter32       ipv6IfIcmpInNeighborAdvertisements;
1143         Counter32       ipv6IfIcmpInRedirects;
1144         Counter32       ipv6IfIcmpInGroupMembQueries;
1145         Counter32       ipv6IfIcmpInGroupMembResponses;
1146         Counter32       ipv6IfIcmpInGroupMembReductions;
1147         /* Total # ICMP messages attempted to send (includes OutErrors) */
1148         Counter32       ipv6IfIcmpOutMsgs;
1149         /* # ICMP messages not sent due to ICMP problems (e.g. no buffers) */
1150         Counter32       ipv6IfIcmpOutErrors;
1151         Counter32       ipv6IfIcmpOutDestUnreachs;
1152         Counter32       ipv6IfIcmpOutAdminProhibs;
1153         Counter32       ipv6IfIcmpOutTimeExcds;
1154         Counter32       ipv6IfIcmpOutParmProblems;
1155         Counter32       ipv6IfIcmpOutPktTooBigs;
1156         Counter32       ipv6IfIcmpOutEchos;
1157         Counter32       ipv6IfIcmpOutEchoReplies;
1158         Counter32       ipv6IfIcmpOutRouterSolicits;
1159         Counter32       ipv6IfIcmpOutRouterAdvertisements;
1160         Counter32       ipv6IfIcmpOutNeighborSolicits;
1161         Counter32       ipv6IfIcmpOutNeighborAdvertisements;
1162         Counter32       ipv6IfIcmpOutRedirects;
1163         Counter32       ipv6IfIcmpOutGroupMembQueries;
1164         Counter32       ipv6IfIcmpOutGroupMembResponses;
1165         Counter32       ipv6IfIcmpOutGroupMembReductions;
1166 /* Additions beyond the MIB */
1167         Counter32       ipv6IfIcmpInOverflows;
1168         /* recv'd "ICMPv6 redirect" msg's that are bad thus ignored */
1169         Counter32       ipv6IfIcmpBadHoplimit;
1170         Counter32       ipv6IfIcmpInBadNeighborAdvertisements;
1171         Counter32       ipv6IfIcmpInBadNeighborSolicitations;
1172         Counter32       ipv6IfIcmpInBadRedirects;
1173         Counter32       ipv6IfIcmpInGroupMembTotal;
1174         Counter32       ipv6IfIcmpInGroupMembBadQueries;
1175         Counter32       ipv6IfIcmpInGroupMembBadReports;
1176         Counter32       ipv6IfIcmpInGroupMembOurReports;
1177 } mib2_ipv6IfIcmpEntry_t;
1178 
1179 /*
1180  * the TCP group
1181  *
1182  * Note that instances of object types that represent
1183  * information about a particular TCP connection are
1184  * transient; they persist only as long as the connection
1185  * in question.
1186  */
1187 #define MIB2_TCP_CONN   13      /* tcpConnEntry */
1188 #define MIB2_TCP6_CONN  14      /* tcp6ConnEntry */
1189 
1190 /* Old name retained for compatibility */
1191 #define MIB2_TCP_13     MIB2_TCP_CONN
1192 
1193 /* Pack data in mib2_tcp to make struct size the same for 32- and 64-bits */
1194 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1195 #pragma pack(4)
1196 #endif
1197 typedef struct mib2_tcp {
1198                 /* algorithm used for transmit timeout value    { tcp 1 } */
1199         int     tcpRtoAlgorithm;
1200                 /* minimum retransmit timeout (ms)              { tcp 2 } */
1201         int     tcpRtoMin;
1202                 /* maximum retransmit timeout (ms)              { tcp 3 } */
1203         int     tcpRtoMax;
1204                 /* maximum # of connections supported           { tcp 4 } */
1205         int     tcpMaxConn;
1206                 /* # of direct transitions CLOSED -> SYN-SENT        { tcp 5 } */
1207         Counter tcpActiveOpens;
1208                 /* # of direct transitions LISTEN -> SYN-RCVD        { tcp 6 } */
1209         Counter tcpPassiveOpens;
1210                 /* # of direct SIN-SENT/RCVD -> CLOSED/LISTEN        { tcp 7 } */
1211         Counter tcpAttemptFails;
1212                 /* # of direct ESTABLISHED/CLOSE-WAIT -> CLOSED      { tcp 8 } */
1213         Counter tcpEstabResets;
1214                 /* # of connections ESTABLISHED or CLOSE-WAIT   { tcp 9 } */
1215         Gauge   tcpCurrEstab;
1216                 /* total # of segments recv'd                   { tcp 10 } */
1217         Counter tcpInSegs;
1218                 /* total # of segments sent                     { tcp 11 } */
1219         Counter tcpOutSegs;
1220                 /* total # of segments retransmitted            { tcp 12 } */
1221         Counter tcpRetransSegs;
1222                 /* {tcp 13} */
1223         int     tcpConnTableSize;       /* Size of tcpConnEntry_t */
1224         /* in ip                                {tcp 14} */
1225                 /* # of segments sent with RST flag             { tcp 15 } */
1226         Counter tcpOutRsts;
1227 /* In addition to MIB-II */
1228 /* Sender */
1229         /* total # of data segments sent */
1230         Counter tcpOutDataSegs;
1231         /* total # of bytes in data segments sent */
1232         Counter tcpOutDataBytes;
1233         /* total # of bytes in segments retransmitted */
1234         Counter tcpRetransBytes;
1235         /* total # of acks sent */
1236         Counter tcpOutAck;
1237         /* total # of delayed acks sent */
1238         Counter tcpOutAckDelayed;
1239         /* total # of segments sent with the urg flag on */
1240         Counter tcpOutUrg;
1241         /* total # of window updates sent */
1242         Counter tcpOutWinUpdate;
1243         /* total # of zero window probes sent */
1244         Counter tcpOutWinProbe;
1245         /* total # of control segments sent (syn, fin, rst) */
1246         Counter tcpOutControl;
1247         /* total # of segments sent due to "fast retransmit" */
1248         Counter tcpOutFastRetrans;
1249 /* Receiver */
1250         /* total # of ack segments received */
1251         Counter tcpInAckSegs;
1252         /* total # of bytes acked */
1253         Counter tcpInAckBytes;
1254         /* total # of duplicate acks */
1255         Counter tcpInDupAck;
1256         /* total # of acks acking unsent data */
1257         Counter tcpInAckUnsent;
1258         /* total # of data segments received in order */
1259         Counter tcpInDataInorderSegs;
1260         /* total # of data bytes received in order */
1261         Counter tcpInDataInorderBytes;
1262         /* total # of data segments received out of order */
1263         Counter tcpInDataUnorderSegs;
1264         /* total # of data bytes received out of order */
1265         Counter tcpInDataUnorderBytes;
1266         /* total # of complete duplicate data segments received */
1267         Counter tcpInDataDupSegs;
1268         /* total # of bytes in the complete duplicate data segments received */
1269         Counter tcpInDataDupBytes;
1270         /* total # of partial duplicate data segments received */
1271         Counter tcpInDataPartDupSegs;
1272         /* total # of bytes in the partial duplicate data segments received */
1273         Counter tcpInDataPartDupBytes;
1274         /* total # of data segments received past the window */
1275         Counter tcpInDataPastWinSegs;
1276         /* total # of data bytes received part the window */
1277         Counter tcpInDataPastWinBytes;
1278         /* total # of zero window probes received */
1279         Counter tcpInWinProbe;
1280         /* total # of window updates received */
1281         Counter tcpInWinUpdate;
1282         /* total # of data segments received after the connection has closed */
1283         Counter tcpInClosed;
1284 /* Others */
1285         /* total # of failed attempts to update the rtt estimate */
1286         Counter tcpRttNoUpdate;
1287         /* total # of successful attempts to update the rtt estimate */
1288         Counter tcpRttUpdate;
1289         /* total # of retransmit timeouts */
1290         Counter tcpTimRetrans;
1291         /* total # of retransmit timeouts dropping the connection */
1292         Counter tcpTimRetransDrop;
1293         /* total # of keepalive timeouts */
1294         Counter tcpTimKeepalive;
1295         /* total # of keepalive timeouts sending a probe */
1296         Counter tcpTimKeepaliveProbe;
1297         /* total # of keepalive timeouts dropping the connection */
1298         Counter tcpTimKeepaliveDrop;
1299         /* total # of connections refused due to backlog full on listen */
1300         Counter tcpListenDrop;
1301         /* total # of connections refused due to half-open queue (q0) full */
1302         Counter tcpListenDropQ0;
1303         /* total # of connections dropped from a full half-open queue (q0) */
1304         Counter tcpHalfOpenDrop;
1305         /* total # of retransmitted segments by SACK retransmission */
1306         Counter tcpOutSackRetransSegs;
1307 
1308         int     tcp6ConnTableSize;      /* Size of tcp6ConnEntry_t */
1309 
1310         /*
1311          * fields from RFC 4022
1312          */
1313 
1314         /* total # of segments recv'd                           { tcp 17 } */
1315         Counter64       tcpHCInSegs;
1316         /* total # of segments sent                             { tcp 18 } */
1317         Counter64       tcpHCOutSegs;
1318 } mib2_tcp_t;
1319 #define MIB_FIRST_NEW_ELM_mib2_tcp_t    tcpHCInSegs
1320 
1321 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1322 #pragma pack()
1323 #endif
1324 
1325 /*
1326  * The TCP/IPv4 connection table {tcp 13} contains information about this
1327  * entity's existing TCP connections over IPv4.
1328  */
1329 /* For tcpConnState and tcp6ConnState */
1330 #define MIB2_TCP_closed         1
1331 #define MIB2_TCP_listen         2
1332 #define MIB2_TCP_synSent        3
1333 #define MIB2_TCP_synReceived    4
1334 #define MIB2_TCP_established    5
1335 #define MIB2_TCP_finWait1       6
1336 #define MIB2_TCP_finWait2       7
1337 #define MIB2_TCP_closeWait      8
1338 #define MIB2_TCP_lastAck        9
1339 #define MIB2_TCP_closing        10
1340 #define MIB2_TCP_timeWait       11
1341 #define MIB2_TCP_deleteTCB      12              /* only writeable value */
1342 
1343 /* Pack data to make struct size the same for 32- and 64-bits */
1344 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1345 #pragma pack(4)
1346 #endif
1347 typedef struct mib2_tcpConnEntry {
1348                 /* state of tcp connection              { tcpConnEntry 1} RW */
1349         int             tcpConnState;
1350                 /* local ip addr for this connection    { tcpConnEntry 2 } */
1351         IpAddress       tcpConnLocalAddress;
1352                 /* local port for this connection       { tcpConnEntry 3 } */
1353         int             tcpConnLocalPort;       /* In host byte order */
1354                 /* remote ip addr for this connection   { tcpConnEntry 4 } */
1355         IpAddress       tcpConnRemAddress;
1356                 /* remote port for this connection      { tcpConnEntry 5 } */
1357         int             tcpConnRemPort;         /* In host byte order */
1358         struct tcpConnEntryInfo_s {
1359                         /* seq # of next segment to send */
1360                 Gauge           ce_snxt;
1361                                 /* seq # of of last segment unacknowledged */
1362                 Gauge           ce_suna;
1363                                 /* currect send window size */
1364                 Gauge           ce_swnd;
1365                                 /* seq # of next expected segment */
1366                 Gauge           ce_rnxt;
1367                                 /* seq # of last ack'd segment */
1368                 Gauge           ce_rack;
1369                                 /* currenct receive window size */
1370                 Gauge           ce_rwnd;
1371                                         /* current rto (retransmit timeout) */
1372                 Gauge           ce_rto;
1373                                         /* current max segment size */
1374                 Gauge           ce_mss;
1375                                 /* actual internal state */
1376                 int             ce_state;
1377         }               tcpConnEntryInfo;
1378 
1379         /* pid of the processes that created this connection */
1380         uint32_t        tcpConnCreationProcess;
1381         /* system uptime when the connection was created */
1382         uint64_t        tcpConnCreationTime;
1383 } mib2_tcpConnEntry_t;
1384 #define MIB_FIRST_NEW_ELM_mib2_tcpConnEntry_t   tcpConnCreationProcess
1385 
1386 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1387 #pragma pack()
1388 #endif
1389 
1390 
1391 /*
1392  * The TCP/IPv6 connection table {tcp 14} contains information about this
1393  * entity's existing TCP connections over IPv6.
1394  */
1395 
1396 /* Pack data to make struct size the same for 32- and 64-bits */
1397 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1398 #pragma pack(4)
1399 #endif
1400 typedef struct mib2_tcp6ConnEntry {
1401         /* local ip addr for this connection    { ipv6TcpConnEntry 1 } */
1402         Ip6Address      tcp6ConnLocalAddress;
1403         /* local port for this connection       { ipv6TcpConnEntry 2 } */
1404         int             tcp6ConnLocalPort;
1405         /* remote ip addr for this connection   { ipv6TcpConnEntry 3 } */
1406         Ip6Address      tcp6ConnRemAddress;
1407         /* remote port for this connection      { ipv6TcpConnEntry 4 } */
1408         int             tcp6ConnRemPort;
1409         /* interface index or zero              { ipv6TcpConnEntry 5 } */
1410         DeviceIndex     tcp6ConnIfIndex;
1411         /* state of tcp6 connection             { ipv6TcpConnEntry 6 } RW */
1412         int             tcp6ConnState;
1413         struct tcp6ConnEntryInfo_s {
1414                         /* seq # of next segment to send */
1415                 Gauge           ce_snxt;
1416                                 /* seq # of of last segment unacknowledged */
1417                 Gauge           ce_suna;
1418                                 /* currect send window size */
1419                 Gauge           ce_swnd;
1420                                 /* seq # of next expected segment */
1421                 Gauge           ce_rnxt;
1422                                 /* seq # of last ack'd segment */
1423                 Gauge           ce_rack;
1424                                 /* currenct receive window size */
1425                 Gauge           ce_rwnd;
1426                                         /* current rto (retransmit timeout) */
1427                 Gauge           ce_rto;
1428                                         /* current max segment size */
1429                 Gauge           ce_mss;
1430                                 /* actual internal state */
1431                 int             ce_state;
1432         }               tcp6ConnEntryInfo;
1433 
1434         /* pid of the processes that created this connection */
1435         uint32_t        tcp6ConnCreationProcess;
1436         /* system uptime when the connection was created */
1437         uint64_t        tcp6ConnCreationTime;
1438 } mib2_tcp6ConnEntry_t;
1439 #define MIB_FIRST_NEW_ELM_mib2_tcp6ConnEntry_t  tcp6ConnCreationProcess
1440 
1441 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1442 #pragma pack()
1443 #endif
1444 
1445 /*
1446  * the UDP group
1447  */
1448 #define MIB2_UDP_ENTRY  5       /* udpEntry */
1449 #define MIB2_UDP6_ENTRY 6       /* udp6Entry */
1450 
1451 /* Old name retained for compatibility */
1452 #define MIB2_UDP_5      MIB2_UDP_ENTRY
1453 
1454 /* Pack data to make struct size the same for 32- and 64-bits */
1455 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1456 #pragma pack(4)
1457 #endif
1458 typedef struct mib2_udp {
1459                 /* total # of UDP datagrams sent upstream       { udp 1 } */
1460         Counter udpInDatagrams;
1461         /* in ip                                { udp 2 } */
1462                 /* # of recv'd dg's not deliverable (other)     { udp 3 }  */
1463         Counter udpInErrors;
1464                 /* total # of dg's sent                         { udp 4 } */
1465         Counter udpOutDatagrams;
1466                 /* { udp 5 } */
1467         int     udpEntrySize;                   /* Size of udpEntry_t */
1468         int     udp6EntrySize;                  /* Size of udp6Entry_t */
1469         Counter udpOutErrors;
1470 
1471         /*
1472          * fields from RFC 4113
1473          */
1474 
1475         /* total # of UDP datagrams sent upstream               { udp 8 } */
1476         Counter64       udpHCInDatagrams;
1477         /* total # of dg's sent                                 { udp 9 } */
1478         Counter64       udpHCOutDatagrams;
1479 } mib2_udp_t;
1480 #define MIB_FIRST_NEW_ELM_mib2_udp_t    udpHCInDatagrams
1481 
1482 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1483 #pragma pack()
1484 #endif
1485 
1486 /*
1487  * The UDP listener table contains information about this entity's UDP
1488  * end-points on which a local application is currently accepting datagrams.
1489  */
1490 
1491 /* For both IPv4 and IPv6 ue_state: */
1492 #define MIB2_UDP_unbound        1
1493 #define MIB2_UDP_idle           2
1494 #define MIB2_UDP_connected      3
1495 #define MIB2_UDP_unknown        4
1496 
1497 /* Pack data to make struct size the same for 32- and 64-bits */
1498 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1499 #pragma pack(4)
1500 #endif
1501 typedef struct mib2_udpEntry {
1502                 /* local ip addr of listener            { udpEntry 1 } */
1503         IpAddress       udpLocalAddress;
1504                 /* local port of listener               { udpEntry 2 } */
1505         int             udpLocalPort;           /* In host byte order */
1506         struct udpEntryInfo_s {
1507                 int             ue_state;
1508                 IpAddress       ue_RemoteAddress;
1509                 int             ue_RemotePort;  /* In host byte order */
1510         }               udpEntryInfo;
1511 
1512         /*
1513          * RFC 4113
1514          */
1515 
1516         /* Unique id for this 4-tuple           { udpEndpointEntry 7 } */
1517         uint32_t        udpInstance;
1518         /* pid of the processes that created this endpoint */
1519         uint32_t        udpCreationProcess;
1520         /* system uptime when the endpoint was created */
1521         uint64_t        udpCreationTime;
1522 } mib2_udpEntry_t;
1523 #define MIB_FIRST_NEW_ELM_mib2_udpEntry_t       udpInstance
1524 
1525 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1526 #pragma pack()
1527 #endif
1528 
1529 /*
1530  * The UDP (for IPv6) listener table contains information about this
1531  * entity's UDP end-points on which a local application is
1532  * currently accepting datagrams.
1533  */
1534 
1535 /* Pack data to make struct size the same for 32- and 64-bits */
1536 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1537 #pragma pack(4)
1538 #endif
1539 typedef struct mib2_udp6Entry {
1540                 /* local ip addr of listener            { ipv6UdpEntry 1 } */
1541         Ip6Address      udp6LocalAddress;
1542                 /* local port of listener               { ipv6UdpEntry 2 } */
1543         int             udp6LocalPort;          /* In host byte order */
1544                 /* interface index or zero              { ipv6UdpEntry 3 } */
1545         DeviceIndex     udp6IfIndex;
1546         struct udp6EntryInfo_s {
1547                 int     ue_state;
1548                 Ip6Address      ue_RemoteAddress;
1549                 int             ue_RemotePort;  /* In host byte order */
1550         }               udp6EntryInfo;
1551 
1552         /*
1553          * RFC 4113
1554          */
1555 
1556         /* Unique id for this 4-tuple           { udpEndpointEntry 7 } */
1557         uint32_t        udp6Instance;
1558         /* pid of the processes that created this endpoint */
1559         uint32_t        udp6CreationProcess;
1560         /* system uptime when the endpoint was created */
1561         uint64_t        udp6CreationTime;
1562 } mib2_udp6Entry_t;
1563 #define MIB_FIRST_NEW_ELM_mib2_udp6Entry_t      udp6Instance
1564 
1565 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1566 #pragma pack()
1567 #endif
1568 
1569 /*
1570  * the RAWIP group
1571  */
1572 typedef struct mib2_rawip {
1573                 /* total # of RAWIP datagrams sent upstream */
1574         Counter rawipInDatagrams;
1575                 /* # of RAWIP packets with bad IPV6_CHECKSUM checksums */
1576         Counter rawipInCksumErrs;
1577                 /* # of recv'd dg's not deliverable (other) */
1578         Counter rawipInErrors;
1579                 /* total # of dg's sent */
1580         Counter rawipOutDatagrams;
1581                 /* total # of dg's not sent (e.g. no memory) */
1582         Counter rawipOutErrors;
1583 } mib2_rawip_t;
1584 
1585 /* DVMRP group */
1586 #define EXPER_DVMRP_VIF         1
1587 #define EXPER_DVMRP_MRT         2
1588 
1589 
1590 /*
1591  * The SCTP group
1592  */
1593 #define MIB2_SCTP_CONN                  15
1594 #define MIB2_SCTP_CONN_LOCAL            16
1595 #define MIB2_SCTP_CONN_REMOTE           17
1596 
1597 #define MIB2_SCTP_closed                1
1598 #define MIB2_SCTP_cookieWait            2
1599 #define MIB2_SCTP_cookieEchoed          3
1600 #define MIB2_SCTP_established           4
1601 #define MIB2_SCTP_shutdownPending       5
1602 #define MIB2_SCTP_shutdownSent          6
1603 #define MIB2_SCTP_shutdownReceived      7
1604 #define MIB2_SCTP_shutdownAckSent       8
1605 #define MIB2_SCTP_deleteTCB             9
1606 #define MIB2_SCTP_listen                10      /* Not in the MIB */
1607 
1608 #define MIB2_SCTP_ACTIVE                1
1609 #define MIB2_SCTP_INACTIVE              2
1610 
1611 #define MIB2_SCTP_ADDR_V4               1
1612 #define MIB2_SCTP_ADDR_V6               2
1613 
1614 #define MIB2_SCTP_RTOALGO_OTHER         1
1615 #define MIB2_SCTP_RTOALGO_VANJ          2
1616 
1617 typedef struct mib2_sctpConnEntry {
1618                 /* connection identifier        { sctpAssocEntry 1 } */
1619         uint32_t        sctpAssocId;
1620                 /* remote hostname (not used)   { sctpAssocEntry 2 } */
1621         Octet_t         sctpAssocRemHostName;
1622                 /* local port number            { sctpAssocEntry 3 } */
1623         uint32_t        sctpAssocLocalPort;
1624                 /* remote port number           { sctpAssocEntry 4 } */
1625         uint32_t        sctpAssocRemPort;
1626                 /* type of primary remote addr  { sctpAssocEntry 5 } */
1627         int             sctpAssocRemPrimAddrType;
1628                 /* primary remote address       { sctpAssocEntry 6 } */
1629         Ip6Address      sctpAssocRemPrimAddr;
1630                 /* local address */
1631         Ip6Address      sctpAssocLocPrimAddr;
1632                 /* current heartbeat interval   { sctpAssocEntry 7 } */
1633         uint32_t        sctpAssocHeartBeatInterval;
1634                 /* state of this association    { sctpAssocEntry 8 } */
1635         int             sctpAssocState;
1636                 /* # of inbound streams         { sctpAssocEntry 9 } */
1637         uint32_t        sctpAssocInStreams;
1638                 /* # of outbound streams        { sctpAssocEntry 10 } */
1639         uint32_t        sctpAssocOutStreams;
1640                 /* max # of data retans         { sctpAssocEntry 11 } */
1641         uint32_t        sctpAssocMaxRetr;
1642                 /* sysId for assoc owner        { sctpAssocEntry 12 } */
1643         uint32_t        sctpAssocPrimProcess;
1644                 /* # of rxmit timeouts during hanshake */
1645         Counter32       sctpAssocT1expired;     /* { sctpAssocEntry 13 } */
1646                 /* # of rxmit timeouts during shutdown */
1647         Counter32       sctpAssocT2expired;     /* { sctpAssocEntry 14 } */
1648                 /* # of rxmit timeouts during data transfer */
1649         Counter32       sctpAssocRtxChunks;     /* { sctpAssocEntry 15 } */
1650                 /* assoc start-up time          { sctpAssocEntry 16 } */
1651         uint32_t        sctpAssocStartTime;
1652         struct sctpConnEntryInfo_s {
1653                                 /* amount of data in send Q */
1654                 Gauge           ce_sendq;
1655                                 /* amount of data in recv Q */
1656                 Gauge           ce_recvq;
1657                                 /* currect send window size */
1658                 Gauge           ce_swnd;
1659                                 /* currenct receive window size */
1660                 Gauge           ce_rwnd;
1661                                 /* current max segment size */
1662                 Gauge           ce_mss;
1663         } sctpConnEntryInfo;
1664 } mib2_sctpConnEntry_t;
1665 
1666 typedef struct mib2_sctpConnLocalAddrEntry {
1667                 /* connection identifier */
1668         uint32_t        sctpAssocId;
1669                 /* type of local addr           { sctpAssocLocalEntry 1 } */
1670         int             sctpAssocLocalAddrType;
1671                 /* local address                { sctpAssocLocalEntry 2 } */
1672         Ip6Address      sctpAssocLocalAddr;
1673 } mib2_sctpConnLocalEntry_t;
1674 
1675 typedef struct mib2_sctpConnRemoteAddrEntry {
1676                 /* connection identier */
1677         uint32_t        sctpAssocId;
1678                 /* remote addr type             { sctpAssocRemEntry 1 } */
1679         int             sctpAssocRemAddrType;
1680                 /* remote address               { sctpAssocRemEntry 2 } */
1681         Ip6Address      sctpAssocRemAddr;
1682                 /* is the address active        { sctpAssocRemEntry 3 } */
1683         int             sctpAssocRemAddrActive;
1684                 /* whether hearbeat is active   { sctpAssocRemEntry 4 } */
1685         int             sctpAssocRemAddrHBActive;
1686                 /* current RTO                  { sctpAssocRemEntry 5 } */
1687         uint32_t        sctpAssocRemAddrRTO;
1688                 /* max # of rexmits before becoming inactive */
1689         uint32_t        sctpAssocRemAddrMaxPathRtx; /* {sctpAssocRemEntry 6} */
1690                 /* # of rexmits to this dest    { sctpAssocRemEntry 7 } */
1691         uint32_t        sctpAssocRemAddrRtx;
1692 } mib2_sctpConnRemoteEntry_t;
1693 
1694 
1695 
1696 /* Pack data in mib2_sctp to make struct size the same for 32- and 64-bits */
1697 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1698 #pragma pack(4)
1699 #endif
1700 
1701 typedef struct mib2_sctp {
1702                 /* algorithm used to determine rto      { sctpParams 1 } */
1703         int             sctpRtoAlgorithm;
1704                 /* min RTO in msecs                     { sctpParams 2 } */
1705         uint32_t        sctpRtoMin;
1706                 /* max RTO in msecs                     { sctpParams 3 } */
1707         uint32_t        sctpRtoMax;
1708                 /* initial RTO in msecs                 { sctpParams 4 } */
1709         uint32_t        sctpRtoInitial;
1710                 /* max # of assocs                      { sctpParams 5 } */
1711         int32_t         sctpMaxAssocs;
1712                 /* cookie lifetime in msecs             { sctpParams 6 } */
1713         uint32_t        sctpValCookieLife;
1714                 /* max # of retrans in startup          { sctpParams 7 } */
1715         uint32_t        sctpMaxInitRetr;
1716         /* # of conns ESTABLISHED, SHUTDOWN-RECEIVED or SHUTDOWN-PENDING */
1717         Counter32       sctpCurrEstab;          /* { sctpStats 1 } */
1718                 /* # of active opens                    { sctpStats 2 } */
1719         Counter32       sctpActiveEstab;
1720                 /* # of passive opens                   { sctpStats 3 } */
1721         Counter32       sctpPassiveEstab;
1722                 /* # of aborted conns                   { sctpStats 4 } */
1723         Counter32       sctpAborted;
1724                 /* # of graceful shutdowns              { sctpStats 5 } */
1725         Counter32       sctpShutdowns;
1726                 /* # of OOB packets                     { sctpStats 6 } */
1727         Counter32       sctpOutOfBlue;
1728                 /* # of packets discarded due to cksum  { sctpStats 7 } */
1729         Counter32       sctpChecksumError;
1730                 /* # of control chunks sent             { sctpStats 8 } */
1731         Counter64       sctpOutCtrlChunks;
1732                 /* # of ordered data chunks sent        { sctpStats 9 } */
1733         Counter64       sctpOutOrderChunks;
1734                 /* # of unordered data chunks sent      { sctpStats 10 } */
1735         Counter64       sctpOutUnorderChunks;
1736                 /* # of retransmitted data chunks */
1737         Counter64       sctpRetransChunks;
1738                 /* # of SACK chunks sent */
1739         Counter         sctpOutAck;
1740                 /* # of delayed ACK timeouts */
1741         Counter         sctpOutAckDelayed;
1742                 /* # of SACK chunks sent to update window */
1743         Counter         sctpOutWinUpdate;
1744                 /* # of fast retransmits */
1745         Counter         sctpOutFastRetrans;
1746                 /* # of window probes sent */
1747         Counter         sctpOutWinProbe;
1748                 /* # of control chunks received         { sctpStats 11 } */
1749         Counter64       sctpInCtrlChunks;
1750                 /* # of ordered data chunks rcvd        { sctpStats 12 } */
1751         Counter64       sctpInOrderChunks;
1752                 /* # of unord data chunks rcvd          { sctpStats 13 } */
1753         Counter64       sctpInUnorderChunks;
1754                 /* # of received SACK chunks */
1755         Counter         sctpInAck;
1756                 /* # of received SACK chunks with duplicate TSN */
1757         Counter         sctpInDupAck;
1758                 /* # of SACK chunks acking unsent data */
1759         Counter         sctpInAckUnsent;
1760                 /* # of Fragmented User Messages        { sctpStats 14 } */
1761         Counter64       sctpFragUsrMsgs;
1762                 /* # of Reassembled User Messages       { sctpStats 15 } */
1763         Counter64       sctpReasmUsrMsgs;
1764                 /* # of Sent SCTP Packets               { sctpStats 16 } */
1765         Counter64       sctpOutSCTPPkts;
1766                 /* # of Received SCTP Packets           { sctpStats 17 } */
1767         Counter64       sctpInSCTPPkts;
1768                 /* # of invalid cookies received */
1769         Counter         sctpInInvalidCookie;
1770                 /* total # of retransmit timeouts */
1771         Counter         sctpTimRetrans;
1772                 /* total # of retransmit timeouts dropping the connection */
1773         Counter         sctpTimRetransDrop;
1774                 /* total # of heartbeat probes */
1775         Counter         sctpTimHeartBeatProbe;
1776                 /* total # of heartbeat timeouts dropping the connection */
1777         Counter         sctpTimHeartBeatDrop;
1778                 /* total # of conns refused due to backlog full on listen */
1779         Counter         sctpListenDrop;
1780                 /* total # of pkts received after the association has closed */
1781         Counter         sctpInClosed;
1782         int             sctpEntrySize;
1783         int             sctpLocalEntrySize;
1784         int             sctpRemoteEntrySize;
1785 } mib2_sctp_t;
1786 
1787 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1788 #pragma pack()
1789 #endif
1790 
1791 /*
1792  * the DCCP group
1793  */
1794 #define MIB2_DCCP_CONN          18
1795 #define MIB2_DCCP6_CONN         19
1796 
1797 #define MIB2_DCCP_closed        1
1798 #define MIB2_DCCP_listen        2
1799 
1800 /* Pack data to make struct size the same for 32- and 64-bits */
1801 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1802 #pragma pack(4)
1803 #endif
1804 
1805 typedef struct mib2_dccp {
1806 
1807                 /* # of direct transitions CLOSED -> ACK-SENT        { dccp 5 } */
1808         Counter dccpActiveOpens;
1809                 /* # of direct transitions LISTEN -> ACK-RCVD        { dccp 6 } */
1810         Counter dccpPassiveOpens;
1811                 /* # of direct SIN-SENT/RCVD -> CLOSED/LISTEN        { dccp 7 } */
1812         Counter dccpAttemptFails;
1813                 /* # of direct ESTABLISHED/CLOSE-WAIT -> CLOSED      { dccp 8 } */
1814         Counter dccpEstabResets;
1815                 /* # of connections ESTABLISHED or CLOSE-WAIT   { dccp 9 } */
1816         Gauge   dccpCurrEstab;
1817                 /* total # of segments recv'd                   { dccp 10 } */
1818         Counter dccpInSegs;
1819                 /* total # of segments sent                     { dccp 11 } */
1820         Counter dccpOutSegs;
1821                 /* total # of segments retransmitted            { dccp 12 } */
1822         Counter dccpRetransSegs;
1823 
1824         int     dccpEntrySize;
1825         int     dccp6EntrySize;
1826 
1827         int     dccpConnTableSize;
1828         int     dccp6ConnTableSize;
1829 
1830         Counter64       dccpHCInDatagrams;
1831 } mib2_dccp_t;
1832 #define MIB_FIRST_NEW_ELM_mib2_dccp_t   dccpHCInDatagrams
1833 
1834 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1835 #pragma pack()
1836 #endif
1837 
1838 /* Pack data to make struct size the same for 32- and 64-bits */
1839 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1840 #pragma pack(4)
1841 #endif
1842 
1843 typedef struct mib2_dccpConnEntry {
1844         int             dccpConnState;
1845         IpAddress       dccpConnLocalAddress;
1846         int             dccpConnLocalPort;
1847         IpAddress       dccpConnRemAddress;
1848         int             dccpConnRemPort;
1849 
1850         uint32_t        dccpConnCreationProcess;
1851         uint64_t        dccpConnCreationTime;
1852 } mib2_dccpConnEntry_t;
1853 #define MIB_FIRST_NEW_ELM_mib2_dccpConnEntry_t  dccpConnCreationProcess
1854 
1855 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1856 #pragma pack()
1857 #endif
1858 
1859 /* Pack data to make struct size the same for 32- and 64-bits */
1860 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1861 #pragma pack(4)
1862 #endif
1863 
1864 typedef struct mib2_dccp6ConnEntry {
1865         int             dccpConnState;
1866         Ip6Address      dccpConnLocalAddress;
1867         int             dccpConnLocalPort;
1868         Ip6Address      dccpConnRemAddress;
1869         int             dccpConnRemPort;
1870 
1871         uint32_t        dccpConnCreationProcess;
1872         uint64_t        dccpConnCreationTime;
1873 } mib2_dccp6ConnEntry_t;
1874 #define MIB_FIRST_NEW_ELM_mib2_dccp6ConnEntry_t dccpConnCreationProcess
1875 
1876 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1877 #pragma pack()
1878 #endif
1879 
1880 #ifdef  __cplusplus
1881 }
1882 #endif
1883 
1884 #endif  /* _INET_MIB2_H */