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