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