xref: /titanic_50/usr/src/uts/common/inet/mib2.h (revision 62a24de03df1f2399ceda704cb3874dabc98bbbd)
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 2007 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 	} 		ipRouteInfo;
723 } mib2_ipRouteEntry_t;
724 
725 /*
726  * The IPv6 routing table contains an entry for each route presently known to
727  * this entity.
728  *
729  *	ipv6RouteTable OBJECT-TYPE
730  *		SYNTAX  SEQUENCE OF IpRouteEntry
731  *		ACCESS  not-accessible
732  *		STATUS  current
733  *		DESCRIPTION
734  *			"IPv6 Routing table. This table contains
735  *			an entry for each valid IPv6 unicast route
736  *			that can be used for packet forwarding
737  *			determination."
738  *		::= { ipv6MIBObjects 11 }
739  */
740 
741 typedef struct mib2_ipv6RouteEntry {
742 		/* dest ip addr for this route		{ ipv6RouteEntry 1 } */
743 	Ip6Address	ipv6RouteDest;
744 		/* prefix length 			{ ipv6RouteEntry 2 } */
745 	int		ipv6RoutePfxLength;
746 		/* unique route index 			{ ipv6RouteEntry 3 } */
747 	unsigned	ipv6RouteIndex;
748 		/* unique interface index for this hop	{ ipv6RouteEntry 4 } */
749 	DeviceName	ipv6RouteIfIndex;
750 		/* IPv6 addr of next hop on this route	{ ipv6RouteEntry 5 } */
751 	Ip6Address	ipv6RouteNextHop;
752 		/* other(1), discard(2), local(3), remote(4) */
753 		/* 					{ ipv6RouteEntry 6 } */
754 	int		ipv6RouteType;
755 		/* mechanism by which route was learned	{ ipv6RouteEntry 7 } */
756 		/*
757 		 * other(1), local(2), netmgmt(3), ndisc(4), rip(5), ospf(6),
758 		 * bgp(7), idrp(8), igrp(9)
759 		 */
760 	int		ipv6RouteProtocol;
761 		/* policy hook or traffic class		{ ipv6RouteEntry 8 } */
762 	unsigned	ipv6RoutePolicy;
763 		/* sec's since last update of route	{ ipv6RouteEntry 9} */
764 	int		ipv6RouteAge;
765 		/* Routing domain ID of the next hop	{ ipv6RouteEntry 10 } */
766 	unsigned	ipv6RouteNextHopRDI;
767 		/* route metric				{ ipv6RouteEntry 11 } */
768 	unsigned	ipv6RouteMetric;
769 		/* preference (impl specific)		{ ipv6RouteEntry 12 } */
770 	unsigned	ipv6RouteWeight;
771 		/* additional info from ire's		{ } */
772 	struct ipv6RouteInfo_s {
773 		Gauge		re_max_frag;
774 		Gauge		re_rtt;
775 		Counter		re_ref;
776 		int		re_frag_flag;
777 		Ip6Address	re_src_addr;
778 		int		re_ire_type;
779 		Counter		re_obpkt;
780 		Counter		re_ibpkt;
781 		int		re_flags;
782 	} 		ipv6RouteInfo;
783 } mib2_ipv6RouteEntry_t;
784 
785 /*
786  * The IPv4 and IPv6 routing table entries on a trusted system also have
787  * security attributes in the form of label ranges.  This experimental
788  * interface provides information about these labels.
789  *
790  * Each entry in this table contains a label range and an index that refers
791  * back to the entry in the routing table to which it applies.  There may be 0,
792  * 1, or many label ranges for each routing table entry.
793  *
794  * (opthdr.level is set to MIB2_IP for IPv4 entries and MIB2_IP6 for IPv6.
795  * opthdr.name is set to EXPER_IP_GWATTR.)
796  *
797  *	ipRouteAttributeTable OBJECT-TYPE
798  *		SYNTAX  SEQUENCE OF IpAttributeEntry
799  *		ACCESS  not-accessible
800  *		STATUS  current
801  *		DESCRIPTION
802  *			"IPv4 routing attributes table.  This table contains
803  *			an entry for each valid trusted label attached to a
804  *			route in the system."
805  *		::= { ip 102 }
806  *
807  *	ipv6RouteAttributeTable OBJECT-TYPE
808  *		SYNTAX  SEQUENCE OF IpAttributeEntry
809  *		ACCESS  not-accessible
810  *		STATUS  current
811  *		DESCRIPTION
812  *			"IPv6 routing attributes table.  This table contains
813  *			an entry for each valid trusted label attached to a
814  *			route in the system."
815  *		::= { ip6 102 }
816  */
817 
818 typedef struct mib2_ipAttributeEntry {
819 	uint_t		iae_routeidx;
820 	int		iae_doi;
821 	brange_t	iae_slrange;
822 } mib2_ipAttributeEntry_t;
823 
824 /*
825  * The IP address translation table contain the IpAddress to
826  * `physical' address equivalences.  Some interfaces do not
827  * use translation tables for determining address
828  * equivalences (e.g., DDN-X.25 has an algorithmic method);
829  * if all interfaces are of this type, then the Address
830  * Translation table is empty, i.e., has zero entries.
831  *
832  *	ipNetToMediaTable OBJECT-TYPE
833  *		SYNTAX  SEQUENCE OF IpNetToMediaEntry
834  *		ACCESS  not-accessible
835  *		STATUS  mandatory
836  *		DESCRIPTION
837  *			"The IP Address Translation table used for mapping
838  *			from IP addresses to physical addresses."
839  *		::= { ip 22 }
840  */
841 
842 typedef struct mib2_ipNetToMediaEntry {
843 	/* Unique interface index		{ ipNetToMediaEntry 1 } RW */
844 	DeviceName	ipNetToMediaIfIndex;
845 	/* Media dependent physical addr	{ ipNetToMediaEntry 2 } RW */
846 	PhysAddress	ipNetToMediaPhysAddress;
847 	/* ip addr for this physical addr	{ ipNetToMediaEntry 3 } RW */
848 	IpAddress	ipNetToMediaNetAddress;
849 	/* other(1), inval(2), dyn(3), stat(4)	{ ipNetToMediaEntry 4 } RW */
850 	int		ipNetToMediaType;
851 	struct ipNetToMediaInfo_s {
852 		PhysAddress	ntm_mask;	/* subnet mask for entry */
853 		int		ntm_flags;	/* ACE_F_* flags in arp.h */
854 	}		ipNetToMediaInfo;
855 } mib2_ipNetToMediaEntry_t;
856 
857 /*
858  *	ipv6NetToMediaTable OBJECT-TYPE
859  *		 SYNTAX      SEQUENCE OF Ipv6NetToMediaEntry
860  *		 MAX-ACCESS  not-accessible
861  *		 STATUS      current
862  *		 DESCRIPTION
863  *			"The IPv6 Address Translation table used for
864  *			mapping from IPv6 addresses to physical addresses.
865  *
866  *			The IPv6 address translation table contain the
867  *			Ipv6Address to `physical' address equivalencies.
868  *			Some interfaces do not use translation tables
869  *			for determining address equivalencies; if all
870  *			interfaces are of this type, then the Address
871  *			Translation table is empty, i.e., has zero
872  *			entries."
873  *		::= { ipv6MIBObjects 12 }
874  */
875 
876 typedef struct mib2_ipv6NetToMediaEntry {
877 	/* Unique interface index		{ Part of INDEX } */
878 	DeviceIndex	ipv6NetToMediaIfIndex;
879 
880 	/* ip addr for this physical addr	{ ipv6NetToMediaEntry 1 } */
881 	Ip6Address	ipv6NetToMediaNetAddress;
882 	/* Media dependent physical addr	{ ipv6NetToMediaEntry 2 } */
883 	PhysAddress	ipv6NetToMediaPhysAddress;
884 	/*
885 	 * Type of mapping
886 	 * other(1), dynamic(2), static(3), local(4)
887 	 *					{ ipv6NetToMediaEntry 3 }
888 	 */
889 	int		ipv6NetToMediaType;
890 	/*
891 	 * NUD state
892 	 * reachable(1), stale(2), delay(3), probe(4), invalid(5), unknown(6)
893 	 * Note: The kernel returns ND_* states.
894 	 *					{ ipv6NetToMediaEntry 4 }
895 	 */
896 	int		ipv6NetToMediaState;
897 	/* sysUpTime last time entry was updated { ipv6NetToMediaEntry 5 } */
898 	int		ipv6NetToMediaLastUpdated;
899 } mib2_ipv6NetToMediaEntry_t;
900 
901 
902 /*
903  * List of group members per interface
904  */
905 typedef struct ip_member {
906 	/* Interface index */
907 	DeviceName	ipGroupMemberIfIndex;
908 	/* IP Multicast address */
909 	IpAddress	ipGroupMemberAddress;
910 	/* Number of member sockets */
911 	Counter		ipGroupMemberRefCnt;
912 	/* Filter mode: 1 => include, 2 => exclude */
913 	int		ipGroupMemberFilterMode;
914 } ip_member_t;
915 
916 
917 /*
918  * List of IPv6 group members per interface
919  */
920 typedef struct ipv6_member {
921 	/* Interface index */
922 	DeviceIndex	ipv6GroupMemberIfIndex;
923 	/* IP Multicast address */
924 	Ip6Address	ipv6GroupMemberAddress;
925 	/* Number of member sockets */
926 	Counter		ipv6GroupMemberRefCnt;
927 	/* Filter mode: 1 => include, 2 => exclude */
928 	int		ipv6GroupMemberFilterMode;
929 } ipv6_member_t;
930 
931 /*
932  * This is used to mark transport layer entities (e.g., TCP connections) that
933  * are capable of receiving packets from a range of labels.  'level' is set to
934  * the protocol of interest (e.g., MIB2_TCP), and 'name' is set to
935  * EXPER_XPORT_MLP.  The tme_connidx refers back to the entry in MIB2_TCP_CONN,
936  * MIB2_TCP6_CONN, or MIB2_SCTP_CONN.
937  *
938  * It is also used to report connections that receive packets at a single label
939  * that's other than the zone's label.  This is the case when a TCP connection
940  * is accepted from a particular peer using an MLP listener.
941  */
942 typedef struct mib2_transportMLPEntry {
943 	uint_t		tme_connidx;
944 	uint_t		tme_flags;
945 	int		tme_doi;
946 	bslabel_t	tme_label;
947 } mib2_transportMLPEntry_t;
948 
949 #define	MIB2_TMEF_PRIVATE	0x00000001	/* MLP on private addresses */
950 #define	MIB2_TMEF_SHARED	0x00000002	/* MLP on shared addresses */
951 
952 /*
953  * List of IPv4 source addresses being filtered per interface
954  */
955 typedef struct ip_grpsrc {
956 	/* Interface index */
957 	DeviceName	ipGroupSourceIfIndex;
958 	/* IP Multicast address */
959 	IpAddress	ipGroupSourceGroup;
960 	/* IP Source address */
961 	IpAddress	ipGroupSourceAddress;
962 } ip_grpsrc_t;
963 
964 
965 /*
966  * List of IPv6 source addresses being filtered per interface
967  */
968 typedef struct ipv6_grpsrc {
969 	/* Interface index */
970 	DeviceIndex	ipv6GroupSourceIfIndex;
971 	/* IP Multicast address */
972 	Ip6Address	ipv6GroupSourceGroup;
973 	/* IP Source address */
974 	Ip6Address	ipv6GroupSourceAddress;
975 } ipv6_grpsrc_t;
976 
977 
978 /*
979  * ICMP Group
980  */
981 typedef struct mib2_icmp {
982 	/* total # of recv'd ICMP msgs			{ icmp 1 } */
983 	Counter	icmpInMsgs;
984 	/* recv'd ICMP msgs with errors			{ icmp 2 } */
985 	Counter	icmpInErrors;
986 	/* recv'd "dest unreachable" msg's		{ icmp 3 } */
987 	Counter	icmpInDestUnreachs;
988 	/* recv'd "time exceeded" msg's			{ icmp 4 } */
989 	Counter	icmpInTimeExcds;
990 	/* recv'd "parameter problem" msg's		{ icmp 5 } */
991 	Counter	icmpInParmProbs;
992 	/* recv'd "source quench" msg's			{ icmp 6 } */
993 	Counter	icmpInSrcQuenchs;
994 	/* recv'd "ICMP redirect" msg's			{ icmp 7 } */
995 	Counter	icmpInRedirects;
996 	/* recv'd "echo request" msg's			{ icmp 8 } */
997 	Counter	icmpInEchos;
998 	/* recv'd "echo reply" msg's			{ icmp 9 } */
999 	Counter	icmpInEchoReps;
1000 	/* recv'd "timestamp" msg's			{ icmp 10 } */
1001 	Counter	icmpInTimestamps;
1002 	/* recv'd "timestamp reply" msg's		{ icmp 11 } */
1003 	Counter	icmpInTimestampReps;
1004 	/* recv'd "address mask request" msg's		{ icmp 12 } */
1005 	Counter	icmpInAddrMasks;
1006 	/* recv'd "address mask reply" msg's		{ icmp 13 } */
1007 	Counter	icmpInAddrMaskReps;
1008 	/* total # of sent ICMP msg's			{ icmp 14 } */
1009 	Counter	icmpOutMsgs;
1010 	/* # of msg's not sent for internal icmp errors	{ icmp 15 } */
1011 	Counter	icmpOutErrors;
1012 	/* # of "dest unreachable" msg's sent		{ icmp 16 } */
1013 	Counter	icmpOutDestUnreachs;
1014 	/* # of "time exceeded" msg's sent		{ icmp 17 } */
1015 	Counter	icmpOutTimeExcds;
1016 	/* # of "parameter problme" msg's sent		{ icmp 18 } */
1017 	Counter	icmpOutParmProbs;
1018 	/* # of "source quench" msg's sent		{ icmp 19 } */
1019 	Counter	icmpOutSrcQuenchs;
1020 	/* # of "ICMP redirect" msg's sent		{ icmp 20 } */
1021 	Counter	icmpOutRedirects;
1022 	/* # of "Echo request" msg's sent		{ icmp 21 } */
1023 	Counter	icmpOutEchos;
1024 	/* # of "Echo reply" msg's sent			{ icmp 22 } */
1025 	Counter	icmpOutEchoReps;
1026 	/* # of "timestamp request" msg's sent		{ icmp 23 } */
1027 	Counter	icmpOutTimestamps;
1028 	/* # of "timestamp reply" msg's sent		{ icmp 24 } */
1029 	Counter	icmpOutTimestampReps;
1030 	/* # of "address mask request" msg's sent	{ icmp 25 } */
1031 	Counter	icmpOutAddrMasks;
1032 	/* # of "address mask reply" msg's sent		{ icmp 26 } */
1033 	Counter	icmpOutAddrMaskReps;
1034 /*
1035  * In addition to MIB-II
1036  */
1037 	/* # of received packets with checksum errors */
1038 	Counter	icmpInCksumErrs;
1039 	/* # of received packets with unknow codes */
1040 	Counter	icmpInUnknowns;
1041 	/* # of received unreachables with "fragmentation needed" */
1042 	Counter	icmpInFragNeeded;
1043 	/* # of sent unreachables with "fragmentation needed" */
1044 	Counter	icmpOutFragNeeded;
1045 	/*
1046 	 * # of msg's not sent since original packet was broadcast/multicast
1047 	 * or an ICMP error packet
1048 	 */
1049 	Counter	icmpOutDrops;
1050 	/* # of ICMP packets droped due to queue overflow */
1051 	Counter icmpInOverflows;
1052 	/* recv'd "ICMP redirect" msg's	that are bad thus ignored */
1053 	Counter	icmpInBadRedirects;
1054 } mib2_icmp_t;
1055 
1056 
1057 /*
1058  *	ipv6IfIcmpEntry OBJECT-TYPE
1059  *		SYNTAX      Ipv6IfIcmpEntry
1060  *		MAX-ACCESS  not-accessible
1061  *		STATUS      current
1062  *		DESCRIPTION
1063  *			"An ICMPv6 statistics entry containing
1064  *			objects at a particular IPv6 interface.
1065  *
1066  *			Note that a receiving interface is
1067  *			the interface to which a given ICMPv6 message
1068  *			is addressed which may not be necessarily
1069  *			the input interface for the message.
1070  *
1071  *			Similarly, the sending interface is
1072  *			the interface that sources a given
1073  *			ICMP message which is usually but not
1074  *			necessarily the output interface for the message."
1075  *		AUGMENTS { ipv6IfEntry }
1076  *		::= { ipv6IfIcmpTable 1 }
1077  *
1078  * Per-interface ICMPv6 statistics table
1079  */
1080 
1081 typedef struct mib2_ipv6IfIcmpEntry {
1082 	/* Local ifindex to identify the interface */
1083 	DeviceIndex	ipv6IfIcmpIfIndex;
1084 
1085 	int		ipv6IfIcmpEntrySize;	/* Size of ipv6IfIcmpEntry */
1086 
1087 	/* The total # ICMP msgs rcvd includes ipv6IfIcmpInErrors */
1088 	Counter32	ipv6IfIcmpInMsgs;
1089 	/* # ICMP with ICMP-specific errors (bad checkum, length, etc) */
1090 	Counter32	ipv6IfIcmpInErrors;
1091 	/* # ICMP Destination Unreachable */
1092 	Counter32	ipv6IfIcmpInDestUnreachs;
1093 	/* # ICMP destination unreachable/communication admin prohibited */
1094 	Counter32	ipv6IfIcmpInAdminProhibs;
1095 	Counter32	ipv6IfIcmpInTimeExcds;
1096 	Counter32	ipv6IfIcmpInParmProblems;
1097 	Counter32	ipv6IfIcmpInPktTooBigs;
1098 	Counter32	ipv6IfIcmpInEchos;
1099 	Counter32	ipv6IfIcmpInEchoReplies;
1100 	Counter32	ipv6IfIcmpInRouterSolicits;
1101 	Counter32	ipv6IfIcmpInRouterAdvertisements;
1102 	Counter32	ipv6IfIcmpInNeighborSolicits;
1103 	Counter32	ipv6IfIcmpInNeighborAdvertisements;
1104 	Counter32	ipv6IfIcmpInRedirects;
1105 	Counter32	ipv6IfIcmpInGroupMembQueries;
1106 	Counter32	ipv6IfIcmpInGroupMembResponses;
1107 	Counter32	ipv6IfIcmpInGroupMembReductions;
1108 	/* Total # ICMP messages attempted to send (includes OutErrors) */
1109 	Counter32	ipv6IfIcmpOutMsgs;
1110 	/* # ICMP messages not sent due to ICMP problems (e.g. no buffers) */
1111 	Counter32	ipv6IfIcmpOutErrors;
1112 	Counter32	ipv6IfIcmpOutDestUnreachs;
1113 	Counter32	ipv6IfIcmpOutAdminProhibs;
1114 	Counter32	ipv6IfIcmpOutTimeExcds;
1115 	Counter32	ipv6IfIcmpOutParmProblems;
1116 	Counter32	ipv6IfIcmpOutPktTooBigs;
1117 	Counter32	ipv6IfIcmpOutEchos;
1118 	Counter32	ipv6IfIcmpOutEchoReplies;
1119 	Counter32	ipv6IfIcmpOutRouterSolicits;
1120 	Counter32	ipv6IfIcmpOutRouterAdvertisements;
1121 	Counter32	ipv6IfIcmpOutNeighborSolicits;
1122 	Counter32	ipv6IfIcmpOutNeighborAdvertisements;
1123 	Counter32	ipv6IfIcmpOutRedirects;
1124 	Counter32	ipv6IfIcmpOutGroupMembQueries;
1125 	Counter32	ipv6IfIcmpOutGroupMembResponses;
1126 	Counter32	ipv6IfIcmpOutGroupMembReductions;
1127 /* Additions beyond the MIB */
1128 	Counter32	ipv6IfIcmpInOverflows;
1129 	/* recv'd "ICMPv6 redirect" msg's that are bad thus ignored */
1130 	Counter32	ipv6IfIcmpBadHoplimit;
1131 	Counter32	ipv6IfIcmpInBadNeighborAdvertisements;
1132 	Counter32	ipv6IfIcmpInBadNeighborSolicitations;
1133 	Counter32	ipv6IfIcmpInBadRedirects;
1134 	Counter32	ipv6IfIcmpInGroupMembTotal;
1135 	Counter32	ipv6IfIcmpInGroupMembBadQueries;
1136 	Counter32	ipv6IfIcmpInGroupMembBadReports;
1137 	Counter32	ipv6IfIcmpInGroupMembOurReports;
1138 } mib2_ipv6IfIcmpEntry_t;
1139 
1140 /*
1141  * the TCP group
1142  *
1143  * Note that instances of object types that represent
1144  * information about a particular TCP connection are
1145  * transient; they persist only as long as the connection
1146  * in question.
1147  */
1148 #define	MIB2_TCP_CONN	13	/* tcpConnEntry */
1149 #define	MIB2_TCP6_CONN	14	/* tcp6ConnEntry */
1150 
1151 /* Old name retained for compatibility */
1152 #define	MIB2_TCP_13	MIB2_TCP_CONN
1153 
1154 /* Pack data in mib2_tcp to make struct size the same for 32- and 64-bits */
1155 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1156 #pragma pack(4)
1157 #endif
1158 typedef struct mib2_tcp {
1159 		/* algorithm used for transmit timeout value	{ tcp 1 } */
1160 	int	tcpRtoAlgorithm;
1161 		/* minimum retransmit timeout (ms)		{ tcp 2 } */
1162 	int	tcpRtoMin;
1163 		/* maximum retransmit timeout (ms)		{ tcp 3 } */
1164 	int	tcpRtoMax;
1165 		/* maximum # of connections supported		{ tcp 4 } */
1166 	int	tcpMaxConn;
1167 		/* # of direct transitions CLOSED -> SYN-SENT	{ tcp 5 } */
1168 	Counter	tcpActiveOpens;
1169 		/* # of direct transitions LISTEN -> SYN-RCVD	{ tcp 6 } */
1170 	Counter	tcpPassiveOpens;
1171 		/* # of direct SIN-SENT/RCVD -> CLOSED/LISTEN	{ tcp 7 } */
1172 	Counter	tcpAttemptFails;
1173 		/* # of direct ESTABLISHED/CLOSE-WAIT -> CLOSED	{ tcp 8 } */
1174 	Counter	tcpEstabResets;
1175 		/* # of connections ESTABLISHED or CLOSE-WAIT	{ tcp 9 } */
1176 	Gauge	tcpCurrEstab;
1177 		/* total # of segments recv'd			{ tcp 10 } */
1178 	Counter	tcpInSegs;
1179 		/* total # of segments sent			{ tcp 11 } */
1180 	Counter	tcpOutSegs;
1181 		/* total # of segments retransmitted		{ tcp 12 } */
1182 	Counter	tcpRetransSegs;
1183 		/* {tcp 13} */
1184 	int	tcpConnTableSize;	/* Size of tcpConnEntry_t */
1185 	/* in ip				{tcp 14} */
1186 		/* # of segments sent with RST flag		{ tcp 15 } */
1187 	Counter	tcpOutRsts;
1188 /* In addition to MIB-II */
1189 /* Sender */
1190 	/* total # of data segments sent */
1191 	Counter tcpOutDataSegs;
1192 	/* total # of bytes in data segments sent */
1193 	Counter tcpOutDataBytes;
1194 	/* total # of bytes in segments retransmitted */
1195 	Counter tcpRetransBytes;
1196 	/* total # of acks sent */
1197 	Counter tcpOutAck;
1198 	/* total # of delayed acks sent */
1199 	Counter tcpOutAckDelayed;
1200 	/* total # of segments sent with the urg flag on */
1201 	Counter tcpOutUrg;
1202 	/* total # of window updates sent */
1203 	Counter tcpOutWinUpdate;
1204 	/* total # of zero window probes sent */
1205 	Counter tcpOutWinProbe;
1206 	/* total # of control segments sent (syn, fin, rst) */
1207 	Counter tcpOutControl;
1208 	/* total # of segments sent due to "fast retransmit" */
1209 	Counter tcpOutFastRetrans;
1210 /* Receiver */
1211 	/* total # of ack segments received */
1212 	Counter tcpInAckSegs;
1213 	/* total # of bytes acked */
1214 	Counter tcpInAckBytes;
1215 	/* total # of duplicate acks */
1216 	Counter tcpInDupAck;
1217 	/* total # of acks acking unsent data */
1218 	Counter tcpInAckUnsent;
1219 	/* total # of data segments received in order */
1220 	Counter tcpInDataInorderSegs;
1221 	/* total # of data bytes received in order */
1222 	Counter tcpInDataInorderBytes;
1223 	/* total # of data segments received out of order */
1224 	Counter tcpInDataUnorderSegs;
1225 	/* total # of data bytes received out of order */
1226 	Counter tcpInDataUnorderBytes;
1227 	/* total # of complete duplicate data segments received */
1228 	Counter tcpInDataDupSegs;
1229 	/* total # of bytes in the complete duplicate data segments received */
1230 	Counter tcpInDataDupBytes;
1231 	/* total # of partial duplicate data segments received */
1232 	Counter tcpInDataPartDupSegs;
1233 	/* total # of bytes in the partial duplicate data segments received */
1234 	Counter tcpInDataPartDupBytes;
1235 	/* total # of data segments received past the window */
1236 	Counter tcpInDataPastWinSegs;
1237 	/* total # of data bytes received part the window */
1238 	Counter tcpInDataPastWinBytes;
1239 	/* total # of zero window probes received */
1240 	Counter tcpInWinProbe;
1241 	/* total # of window updates received */
1242 	Counter tcpInWinUpdate;
1243 	/* total # of data segments received after the connection has closed */
1244 	Counter tcpInClosed;
1245 /* Others */
1246 	/* total # of failed attempts to update the rtt estimate */
1247 	Counter tcpRttNoUpdate;
1248 	/* total # of successful attempts to update the rtt estimate */
1249 	Counter tcpRttUpdate;
1250 	/* total # of retransmit timeouts */
1251 	Counter tcpTimRetrans;
1252 	/* total # of retransmit timeouts dropping the connection */
1253 	Counter tcpTimRetransDrop;
1254 	/* total # of keepalive timeouts */
1255 	Counter tcpTimKeepalive;
1256 	/* total # of keepalive timeouts sending a probe */
1257 	Counter tcpTimKeepaliveProbe;
1258 	/* total # of keepalive timeouts dropping the connection */
1259 	Counter tcpTimKeepaliveDrop;
1260 	/* total # of connections refused due to backlog full on listen */
1261 	Counter tcpListenDrop;
1262 	/* total # of connections refused due to half-open queue (q0) full */
1263 	Counter tcpListenDropQ0;
1264 	/* total # of connections dropped from a full half-open queue (q0) */
1265 	Counter tcpHalfOpenDrop;
1266 	/* total # of retransmitted segments by SACK retransmission */
1267 	Counter	tcpOutSackRetransSegs;
1268 
1269 	int	tcp6ConnTableSize;	/* Size of tcp6ConnEntry_t */
1270 
1271 	/*
1272 	 * fields from RFC 4022
1273 	 */
1274 
1275 	/* total # of segments recv'd				{ tcp 17 } */
1276 	Counter64	tcpHCInSegs;
1277 	/* total # of segments sent				{ tcp 18 } */
1278 	Counter64	tcpHCOutSegs;
1279 } mib2_tcp_t;
1280 
1281 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1282 #pragma pack()
1283 #endif
1284 
1285 /*
1286  * The TCP/IPv4 connection table {tcp 13} contains information about this
1287  * entity's existing TCP connections over IPv4.
1288  */
1289 /* For tcpConnState and tcp6ConnState */
1290 #define	MIB2_TCP_closed		1
1291 #define	MIB2_TCP_listen		2
1292 #define	MIB2_TCP_synSent	3
1293 #define	MIB2_TCP_synReceived	4
1294 #define	MIB2_TCP_established	5
1295 #define	MIB2_TCP_finWait1	6
1296 #define	MIB2_TCP_finWait2	7
1297 #define	MIB2_TCP_closeWait	8
1298 #define	MIB2_TCP_lastAck	9
1299 #define	MIB2_TCP_closing	10
1300 #define	MIB2_TCP_timeWait	11
1301 #define	MIB2_TCP_deleteTCB	12		/* only writeable value */
1302 
1303 /* Pack data to make struct size the same for 32- and 64-bits */
1304 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1305 #pragma pack(4)
1306 #endif
1307 typedef struct mib2_tcpConnEntry {
1308 		/* state of tcp connection		{ tcpConnEntry 1} RW */
1309 	int		tcpConnState;
1310 		/* local ip addr for this connection	{ tcpConnEntry 2 } */
1311 	IpAddress	tcpConnLocalAddress;
1312 		/* local port for this connection	{ tcpConnEntry 3 } */
1313 	int		tcpConnLocalPort;	/* In host byte order */
1314 		/* remote ip addr for this connection	{ tcpConnEntry 4 } */
1315 	IpAddress	tcpConnRemAddress;
1316 		/* remote port for this connection	{ tcpConnEntry 5 } */
1317 	int		tcpConnRemPort;		/* In host byte order */
1318 	struct tcpConnEntryInfo_s {
1319 			/* seq # of next segment to send */
1320 		Gauge		ce_snxt;
1321 				/* seq # of of last segment unacknowledged */
1322 		Gauge		ce_suna;
1323 				/* currect send window size */
1324 		Gauge		ce_swnd;
1325 				/* seq # of next expected segment */
1326 		Gauge		ce_rnxt;
1327 				/* seq # of last ack'd segment */
1328 		Gauge		ce_rack;
1329 				/* currenct receive window size */
1330 		Gauge		ce_rwnd;
1331 					/* current rto (retransmit timeout) */
1332 		Gauge		ce_rto;
1333 					/* current max segment size */
1334 		Gauge		ce_mss;
1335 				/* actual internal state */
1336 		int		ce_state;
1337 	} 		tcpConnEntryInfo;
1338 
1339 	/* pid of the processes that created this connection */
1340 	uint32_t	tcpConnCreationProcess;
1341 	/* system uptime when the connection was created */
1342 	uint64_t	tcpConnCreationTime;
1343 } mib2_tcpConnEntry_t;
1344 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1345 #pragma pack()
1346 #endif
1347 
1348 
1349 /*
1350  * The TCP/IPv6 connection table {tcp 14} contains information about this
1351  * entity's existing TCP connections over IPv6.
1352  */
1353 
1354 /* Pack data to make struct size the same for 32- and 64-bits */
1355 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1356 #pragma pack(4)
1357 #endif
1358 typedef struct mib2_tcp6ConnEntry {
1359 	/* local ip addr for this connection	{ ipv6TcpConnEntry 1 } */
1360 	Ip6Address	tcp6ConnLocalAddress;
1361 	/* local port for this connection	{ ipv6TcpConnEntry 2 } */
1362 	int		tcp6ConnLocalPort;
1363 	/* remote ip addr for this connection	{ ipv6TcpConnEntry 3 } */
1364 	Ip6Address	tcp6ConnRemAddress;
1365 	/* remote port for this connection	{ ipv6TcpConnEntry 4 } */
1366 	int		tcp6ConnRemPort;
1367 	/* interface index or zero		{ ipv6TcpConnEntry 5 } */
1368 	DeviceIndex	tcp6ConnIfIndex;
1369 	/* state of tcp6 connection		{ ipv6TcpConnEntry 6 } RW */
1370 	int		tcp6ConnState;
1371 	struct tcp6ConnEntryInfo_s {
1372 			/* seq # of next segment to send */
1373 		Gauge		ce_snxt;
1374 				/* seq # of of last segment unacknowledged */
1375 		Gauge		ce_suna;
1376 				/* currect send window size */
1377 		Gauge		ce_swnd;
1378 				/* seq # of next expected segment */
1379 		Gauge		ce_rnxt;
1380 				/* seq # of last ack'd segment */
1381 		Gauge		ce_rack;
1382 				/* currenct receive window size */
1383 		Gauge		ce_rwnd;
1384 					/* current rto (retransmit timeout) */
1385 		Gauge		ce_rto;
1386 					/* current max segment size */
1387 		Gauge		ce_mss;
1388 				/* actual internal state */
1389 		int		ce_state;
1390 	} 		tcp6ConnEntryInfo;
1391 
1392 	/* pid of the processes that created this connection */
1393 	uint32_t	tcp6ConnCreationProcess;
1394 	/* system uptime when the connection was created */
1395 	uint64_t	tcp6ConnCreationTime;
1396 } mib2_tcp6ConnEntry_t;
1397 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1398 #pragma pack()
1399 #endif
1400 
1401 /*
1402  * the UDP group
1403  */
1404 #define	MIB2_UDP_ENTRY	5	/* udpEntry */
1405 #define	MIB2_UDP6_ENTRY	6	/* udp6Entry */
1406 
1407 /* Old name retained for compatibility */
1408 #define	MIB2_UDP_5	MIB2_UDP_ENTRY
1409 
1410 /* Pack data to make struct size the same for 32- and 64-bits */
1411 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1412 #pragma pack(4)
1413 #endif
1414 typedef struct mib2_udp {
1415 		/* total # of UDP datagrams sent upstream	{ udp 1 } */
1416 	Counter	udpInDatagrams;
1417 	/* in ip				{ udp 2 } */
1418 		/* # of recv'd dg's not deliverable (other)	{ udp 3 }  */
1419 	Counter	udpInErrors;
1420 		/* total # of dg's sent				{ udp 4 } */
1421 	Counter	udpOutDatagrams;
1422 		/* { udp 5 } */
1423 	int	udpEntrySize;			/* Size of udpEntry_t */
1424 	int	udp6EntrySize;			/* Size of udp6Entry_t */
1425 	Counter	udpOutErrors;
1426 
1427 	/*
1428 	 * fields from RFC 4113
1429 	 */
1430 
1431 	/* total # of UDP datagrams sent upstream		{ udp 8 } */
1432 	Counter64	udpHCInDatagrams;
1433 	/* total # of dg's sent					{ udp 9 } */
1434 	Counter64	udpHCOutDatagrams;
1435 } mib2_udp_t;
1436 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1437 #pragma pack()
1438 #endif
1439 
1440 /*
1441  * The UDP listener table contains information about this entity's UDP
1442  * end-points on which a local application is currently accepting datagrams.
1443  */
1444 
1445 /* For both IPv4 and IPv6 ue_state: */
1446 #define	MIB2_UDP_unbound	1
1447 #define	MIB2_UDP_idle		2
1448 #define	MIB2_UDP_connected	3
1449 #define	MIB2_UDP_unknown	4
1450 
1451 /* Pack data to make struct size the same for 32- and 64-bits */
1452 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1453 #pragma pack(4)
1454 #endif
1455 typedef struct mib2_udpEntry {
1456 		/* local ip addr of listener		{ udpEntry 1 } */
1457 	IpAddress	udpLocalAddress;
1458 		/* local port of listener		{ udpEntry 2 } */
1459 	int		udpLocalPort;		/* In host byte order */
1460 	struct udpEntryInfo_s {
1461 		int		ue_state;
1462 		IpAddress	ue_RemoteAddress;
1463 		int		ue_RemotePort;	/* In host byte order */
1464 	}		udpEntryInfo;
1465 
1466 	/*
1467 	 * RFC 4113
1468 	 */
1469 
1470 	/* Unique id for this 4-tuple		{ udpEndpointEntry 7 } */
1471 	uint32_t	udpInstance;
1472 	/* pid of the processes that created this endpoint */
1473 	uint32_t	udpCreationProcess;
1474 	/* system uptime when the endpoint was created */
1475 	uint64_t	udpCreationTime;
1476 } mib2_udpEntry_t;
1477 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1478 #pragma pack()
1479 #endif
1480 
1481 /*
1482  * The UDP (for IPv6) listener table contains information about this
1483  * entity's UDP end-points on which a local application is
1484  * currently accepting datagrams.
1485  */
1486 
1487 /* Pack data to make struct size the same for 32- and 64-bits */
1488 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1489 #pragma pack(4)
1490 #endif
1491 typedef	struct mib2_udp6Entry {
1492 		/* local ip addr of listener		{ ipv6UdpEntry 1 } */
1493 	Ip6Address	udp6LocalAddress;
1494 		/* local port of listener		{ ipv6UdpEntry 2 } */
1495 	int		udp6LocalPort;		/* In host byte order */
1496 		/* interface index or zero 		{ ipv6UdpEntry 3 } */
1497 	DeviceIndex	udp6IfIndex;
1498 	struct udp6EntryInfo_s {
1499 		int	ue_state;
1500 		Ip6Address	ue_RemoteAddress;
1501 		int		ue_RemotePort;	/* In host byte order */
1502 	}		udp6EntryInfo;
1503 
1504 	/*
1505 	 * RFC 4113
1506 	 */
1507 
1508 	/* Unique id for this 4-tuple		{ udpEndpointEntry 7 } */
1509 	uint32_t	udp6Instance;
1510 	/* pid of the processes that created this endpoint */
1511 	uint32_t	udp6CreationProcess;
1512 	/* system uptime when the endpoint was created */
1513 	uint64_t	udp6CreationTime;
1514 } mib2_udp6Entry_t;
1515 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1516 #pragma pack()
1517 #endif
1518 
1519 /*
1520  * the RAWIP group
1521  */
1522 typedef struct mib2_rawip {
1523 		/* total # of RAWIP datagrams sent upstream */
1524 	Counter	rawipInDatagrams;
1525 		/* # of RAWIP packets with bad IPV6_CHECKSUM checksums */
1526 	Counter rawipInCksumErrs;
1527 		/* # of recv'd dg's not deliverable (other) */
1528 	Counter	rawipInErrors;
1529 		/* total # of dg's sent */
1530 	Counter	rawipOutDatagrams;
1531 		/* total # of dg's not sent (e.g. no memory) */
1532 	Counter	rawipOutErrors;
1533 } mib2_rawip_t;
1534 
1535 /* DVMRP group */
1536 #define	EXPER_DVMRP_VIF		1
1537 #define	EXPER_DVMRP_MRT		2
1538 
1539 
1540 /*
1541  * The SCTP group
1542  */
1543 #define	MIB2_SCTP_CONN			15
1544 #define	MIB2_SCTP_CONN_LOCAL		16
1545 #define	MIB2_SCTP_CONN_REMOTE		17
1546 
1547 #define	MIB2_SCTP_closed		1
1548 #define	MIB2_SCTP_cookieWait		2
1549 #define	MIB2_SCTP_cookieEchoed		3
1550 #define	MIB2_SCTP_established		4
1551 #define	MIB2_SCTP_shutdownPending	5
1552 #define	MIB2_SCTP_shutdownSent		6
1553 #define	MIB2_SCTP_shutdownReceived	7
1554 #define	MIB2_SCTP_shutdownAckSent	8
1555 #define	MIB2_SCTP_deleteTCB		9
1556 #define	MIB2_SCTP_listen		10	/* Not in the MIB */
1557 
1558 #define	MIB2_SCTP_ACTIVE		1
1559 #define	MIB2_SCTP_INACTIVE		2
1560 
1561 #define	MIB2_SCTP_ADDR_V4		1
1562 #define	MIB2_SCTP_ADDR_V6		2
1563 
1564 #define	MIB2_SCTP_RTOALGO_OTHER		1
1565 #define	MIB2_SCTP_RTOALGO_VANJ		2
1566 
1567 typedef struct mib2_sctpConnEntry {
1568 		/* connection identifier	{ sctpAssocEntry 1 } */
1569 	uint32_t	sctpAssocId;
1570 		/* remote hostname (not used)	{ sctpAssocEntry 2 } */
1571 	Octet_t		sctpAssocRemHostName;
1572 		/* local port number		{ sctpAssocEntry 3 } */
1573 	uint32_t	sctpAssocLocalPort;
1574 		/* remote port number		{ sctpAssocEntry 4 } */
1575 	uint32_t	sctpAssocRemPort;
1576 		/* type of primary remote addr	{ sctpAssocEntry 5 } */
1577 	int		sctpAssocRemPrimAddrType;
1578 		/* primary remote address	{ sctpAssocEntry 6 } */
1579 	Ip6Address	sctpAssocRemPrimAddr;
1580 		/* local address */
1581 	Ip6Address	sctpAssocLocPrimAddr;
1582 		/* current heartbeat interval	{ sctpAssocEntry 7 } */
1583 	uint32_t	sctpAssocHeartBeatInterval;
1584 		/* state of this association	{ sctpAssocEntry 8 } */
1585 	int		sctpAssocState;
1586 		/* # of inbound streams		{ sctpAssocEntry 9 } */
1587 	uint32_t	sctpAssocInStreams;
1588 		/* # of outbound streams	{ sctpAssocEntry 10 } */
1589 	uint32_t	sctpAssocOutStreams;
1590 		/* max # of data retans		{ sctpAssocEntry 11 } */
1591 	uint32_t	sctpAssocMaxRetr;
1592 		/* sysId for assoc owner	{ sctpAssocEntry 12 } */
1593 	uint32_t	sctpAssocPrimProcess;
1594 		/* # of rxmit timeouts during hanshake */
1595 	Counter32	sctpAssocT1expired;	/* { sctpAssocEntry 13 } */
1596 		/* # of rxmit timeouts during shutdown */
1597 	Counter32	sctpAssocT2expired;	/* { sctpAssocEntry 14 } */
1598 		/* # of rxmit timeouts during data transfer */
1599 	Counter32	sctpAssocRtxChunks;	/* { sctpAssocEntry 15 } */
1600 		/* assoc start-up time		{ sctpAssocEntry 16 } */
1601 	uint32_t	sctpAssocStartTime;
1602 	struct sctpConnEntryInfo_s {
1603 				/* amount of data in send Q */
1604 		Gauge		ce_sendq;
1605 				/* amount of data in recv Q */
1606 		Gauge		ce_recvq;
1607 				/* currect send window size */
1608 		Gauge		ce_swnd;
1609 				/* currenct receive window size */
1610 		Gauge		ce_rwnd;
1611 				/* current max segment size */
1612 		Gauge		ce_mss;
1613 	} sctpConnEntryInfo;
1614 } mib2_sctpConnEntry_t;
1615 
1616 typedef struct mib2_sctpConnLocalAddrEntry {
1617 		/* connection identifier */
1618 	uint32_t	sctpAssocId;
1619 		/* type of local addr		{ sctpAssocLocalEntry 1 } */
1620 	int		sctpAssocLocalAddrType;
1621 		/* local address		{ sctpAssocLocalEntry 2 } */
1622 	Ip6Address	sctpAssocLocalAddr;
1623 } mib2_sctpConnLocalEntry_t;
1624 
1625 typedef struct mib2_sctpConnRemoteAddrEntry {
1626 		/* connection identier */
1627 	uint32_t	sctpAssocId;
1628 		/* remote addr type		{ sctpAssocRemEntry 1 } */
1629 	int		sctpAssocRemAddrType;
1630 		/* remote address		{ sctpAssocRemEntry 2 } */
1631 	Ip6Address	sctpAssocRemAddr;
1632 		/* is the address active	{ sctpAssocRemEntry 3 } */
1633 	int		sctpAssocRemAddrActive;
1634 		/* whether hearbeat is active	{ sctpAssocRemEntry 4 } */
1635 	int		sctpAssocRemAddrHBActive;
1636 		/* current RTO			{ sctpAssocRemEntry 5 } */
1637 	uint32_t	sctpAssocRemAddrRTO;
1638 		/* max # of rexmits before becoming inactive */
1639 	uint32_t	sctpAssocRemAddrMaxPathRtx; /* {sctpAssocRemEntry 6} */
1640 		/* # of rexmits to this dest	{ sctpAssocRemEntry 7 } */
1641 	uint32_t	sctpAssocRemAddrRtx;
1642 } mib2_sctpConnRemoteEntry_t;
1643 
1644 
1645 
1646 /* Pack data in mib2_sctp to make struct size the same for 32- and 64-bits */
1647 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1648 #pragma pack(4)
1649 #endif
1650 
1651 typedef struct mib2_sctp {
1652 		/* algorithm used to determine rto	{ sctpParams 1 } */
1653 	int		sctpRtoAlgorithm;
1654 		/* min RTO in msecs			{ sctpParams 2 } */
1655 	uint32_t	sctpRtoMin;
1656 		/* max RTO in msecs			{ sctpParams 3 } */
1657 	uint32_t	sctpRtoMax;
1658 		/* initial RTO in msecs			{ sctpParams 4 } */
1659 	uint32_t	sctpRtoInitial;
1660 		/* max # of assocs			{ sctpParams 5 } */
1661 	int32_t		sctpMaxAssocs;
1662 		/* cookie lifetime in msecs		{ sctpParams 6 } */
1663 	uint32_t	sctpValCookieLife;
1664 		/* max # of retrans in startup		{ sctpParams 7 } */
1665 	uint32_t	sctpMaxInitRetr;
1666 	/* # of conns ESTABLISHED, SHUTDOWN-RECEIVED or SHUTDOWN-PENDING */
1667 	Counter32	sctpCurrEstab;		/* { sctpStats 1 } */
1668 		/* # of active opens			{ sctpStats 2 } */
1669 	Counter32	sctpActiveEstab;
1670 		/* # of passive opens			{ sctpStats 3 } */
1671 	Counter32	sctpPassiveEstab;
1672 		/* # of aborted conns			{ sctpStats 4 } */
1673 	Counter32	sctpAborted;
1674 		/* # of graceful shutdowns		{ sctpStats 5 } */
1675 	Counter32	sctpShutdowns;
1676 		/* # of OOB packets			{ sctpStats 6 } */
1677 	Counter32	sctpOutOfBlue;
1678 		/* # of packets discarded due to cksum	{ sctpStats 7 } */
1679 	Counter32	sctpChecksumError;
1680 		/* # of control chunks sent		{ sctpStats 8 } */
1681 	Counter64	sctpOutCtrlChunks;
1682 		/* # of ordered data chunks sent	{ sctpStats 9 } */
1683 	Counter64	sctpOutOrderChunks;
1684 		/* # of unordered data chunks sent	{ sctpStats 10 } */
1685 	Counter64	sctpOutUnorderChunks;
1686 		/* # of retransmitted data chunks */
1687 	Counter64	sctpRetransChunks;
1688 		/* # of SACK chunks sent */
1689 	Counter		sctpOutAck;
1690 		/* # of delayed ACK timeouts */
1691 	Counter		sctpOutAckDelayed;
1692 		/* # of SACK chunks sent to update window */
1693 	Counter		sctpOutWinUpdate;
1694 		/* # of fast retransmits */
1695 	Counter		sctpOutFastRetrans;
1696 		/* # of window probes sent */
1697 	Counter		sctpOutWinProbe;
1698 		/* # of control chunks received		{ sctpStats 11 } */
1699 	Counter64	sctpInCtrlChunks;
1700 		/* # of ordered data chunks rcvd	{ sctpStats 12 } */
1701 	Counter64	sctpInOrderChunks;
1702 		/* # of unord data chunks rcvd		{ sctpStats 13 } */
1703 	Counter64	sctpInUnorderChunks;
1704 		/* # of received SACK chunks */
1705 	Counter		sctpInAck;
1706 		/* # of received SACK chunks with duplicate TSN */
1707 	Counter		sctpInDupAck;
1708 		/* # of SACK chunks acking unsent data */
1709 	Counter 	sctpInAckUnsent;
1710 		/* # of Fragmented User Messages	{ sctpStats 14 } */
1711 	Counter64	sctpFragUsrMsgs;
1712 		/* # of Reassembled User Messages	{ sctpStats 15 } */
1713 	Counter64	sctpReasmUsrMsgs;
1714 		/* # of Sent SCTP Packets		{ sctpStats 16 } */
1715 	Counter64	sctpOutSCTPPkts;
1716 		/* # of Received SCTP Packets		{ sctpStats 17 } */
1717 	Counter64	sctpInSCTPPkts;
1718 		/* # of invalid cookies received */
1719 	Counter		sctpInInvalidCookie;
1720 		/* total # of retransmit timeouts */
1721 	Counter		sctpTimRetrans;
1722 		/* total # of retransmit timeouts dropping the connection */
1723 	Counter		sctpTimRetransDrop;
1724 		/* total # of heartbeat probes */
1725 	Counter		sctpTimHeartBeatProbe;
1726 		/* total # of heartbeat timeouts dropping the connection */
1727 	Counter		sctpTimHeartBeatDrop;
1728 		/* total # of conns refused due to backlog full on listen */
1729 	Counter		sctpListenDrop;
1730 		/* total # of pkts received after the association has closed */
1731 	Counter		sctpInClosed;
1732 	int		sctpEntrySize;
1733 	int		sctpLocalEntrySize;
1734 	int		sctpRemoteEntrySize;
1735 } mib2_sctp_t;
1736 
1737 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1738 #pragma pack()
1739 #endif
1740 
1741 
1742 #ifdef	__cplusplus
1743 }
1744 #endif
1745 
1746 #endif	/* _INET_MIB2_H */
1747