xref: /titanic_44/usr/src/uts/common/inet/mib2.h (revision 2d6b5ea734bb47d251c82670646fde46af15fd69)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  *
21  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22  * Use is subject to license terms.
23  */
24 /* Copyright (c) 1990 Mentat Inc. */
25 
26 #ifndef	_INET_MIB2_H
27 #define	_INET_MIB2_H
28 
29 #include <netinet/in.h>	/* For in6_addr_t */
30 #include <sys/tsol/label.h> /* For brange_t */
31 #include <sys/tsol/label_macro.h> /* For brange_t */
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * The IPv6 parts of this are derived from:
39  *	RFC 2465
40  *	RFC 2466
41  *	RFC 2452
42  *	RFC 2454
43  */
44 
45 /*
46  * SNMP set/get via M_PROTO T_OPTMGMT_REQ.  Structure is that used
47  * for [gs]etsockopt() calls.  get uses T_CURRENT, set uses T_NEOGTIATE
48  * MGMT_flags value.  The following definition of opthdr is taken from
49  * socket.h:
50  *
51  * An option specification consists of an opthdr, followed by the value of
52  * the option.  An options buffer contains one or more options.  The len
53  * field of opthdr specifies the length of the option value in bytes.  This
54  * length must be a multiple of sizeof(long) (use OPTLEN macro).
55  *
56  * struct opthdr {
57  *	long	level;	protocol level affected
58  *	long	name;	option to modify
59  *	long	len;	length of option value
60  * };
61  *
62  * #define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
63  * #define OPTVAL(opt) ((char *)(opt + 1))
64  *
65  * For get requests (T_CURRENT), any MIB2_xxx value can be used (only
66  * "get all" is supported, so all modules get a copy of the request to
67  * return everything it knows.   In general, we use MIB2_IP.  There is
68  * one exception: in general, IP will not report information related to
69  * IRE_MARK_TESTHIDDEN routes (e.g., in the MIB2_IP_ROUTE table).
70  * However, using the special value EXPER_IP_AND_TESTHIDDEN will cause
71  * all information to be reported.  This special value should only be
72  * used by IPMP-aware low-level utilities (e.g. in.mpathd).
73  *
74  * IMPORTANT:  some fields are grouped in a different structure than
75  * suggested by MIB-II, e.g., checksum error counts.  The original MIB-2
76  * field name has been retained.  Field names beginning with "mi" are not
77  * defined in the MIB but contain important & useful information maintained
78  * by the corresponding module.
79  */
80 #ifndef IPPROTO_MAX
81 #define	IPPROTO_MAX	256
82 #endif
83 
84 #define	MIB2_SYSTEM		(IPPROTO_MAX+1)
85 #define	MIB2_INTERFACES		(IPPROTO_MAX+2)
86 #define	MIB2_AT			(IPPROTO_MAX+3)
87 #define	MIB2_IP			(IPPROTO_MAX+4)
88 #define	MIB2_ICMP		(IPPROTO_MAX+5)
89 #define	MIB2_TCP		(IPPROTO_MAX+6)
90 #define	MIB2_UDP		(IPPROTO_MAX+7)
91 #define	MIB2_EGP		(IPPROTO_MAX+8)
92 #define	MIB2_CMOT		(IPPROTO_MAX+9)
93 #define	MIB2_TRANSMISSION	(IPPROTO_MAX+10)
94 #define	MIB2_SNMP		(IPPROTO_MAX+11)
95 #define	MIB2_IP6		(IPPROTO_MAX+12)
96 #define	MIB2_ICMP6		(IPPROTO_MAX+13)
97 #define	MIB2_TCP6		(IPPROTO_MAX+14)
98 #define	MIB2_UDP6		(IPPROTO_MAX+15)
99 #define	MIB2_SCTP		(IPPROTO_MAX+16)
100 
101 /*
102  * Define range of levels for use with MIB2_*
103  */
104 #define	MIB2_RANGE_START	(IPPROTO_MAX+1)
105 #define	MIB2_RANGE_END		(IPPROTO_MAX+16)
106 
107 
108 #define	EXPER			1024	/* experimental - not part of mib */
109 #define	EXPER_IGMP		(EXPER+1)
110 #define	EXPER_DVMRP		(EXPER+2)
111 #define	EXPER_RAWIP		(EXPER+3)
112 #define	EXPER_IP_AND_TESTHIDDEN	(EXPER+4)
113 
114 /*
115  * Define range of levels for experimental use
116  */
117 #define	EXPER_RANGE_START	(EXPER+1)
118 #define	EXPER_RANGE_END		(EXPER+4)
119 
120 #define	BUMP_MIB(s, x)		{				\
121 	extern void __dtrace_probe___mib_##x(int, void *);	\
122 	void *stataddr = &((s)->x);				\
123 	__dtrace_probe___mib_##x(1, stataddr);			\
124 	(s)->x++;						\
125 }
126 
127 #define	UPDATE_MIB(s, x, y)	{				\
128 	extern void __dtrace_probe___mib_##x(int, void *);	\
129 	void *stataddr = &((s)->x);				\
130 	__dtrace_probe___mib_##x(y, stataddr);			\
131 	(s)->x += (y);						\
132 }
133 
134 #define	SET_MIB(x, y)		x = y
135 #define	BUMP_LOCAL(x)		(x)++
136 #define	UPDATE_LOCAL(x, y)	(x) += (y)
137 #define	SYNC32_MIB(s, m32, m64)	SET_MIB((s)->m32, (s)->m64 & 0xffffffff)
138 
139 #define	OCTET_LENGTH	32	/* Must be at least LIFNAMSIZ */
140 typedef struct Octet_s {
141 	int	o_length;
142 	char	o_bytes[OCTET_LENGTH];
143 } Octet_t;
144 
145 typedef uint32_t	Counter;
146 typedef uint32_t	Counter32;
147 typedef uint64_t	Counter64;
148 typedef uint32_t	Gauge;
149 typedef uint32_t	IpAddress;
150 typedef	struct in6_addr	Ip6Address;
151 typedef Octet_t		DeviceName;
152 typedef Octet_t		PhysAddress;
153 typedef uint32_t	DeviceIndex;	/* Interface index */
154 
155 #define	MIB2_UNKNOWN_INTERFACE	0
156 #define	MIB2_UNKNOWN_PROCESS	0
157 
158 /*
159  *  IP group
160  */
161 #define	MIB2_IP_ADDR		20	/* ipAddrEntry */
162 #define	MIB2_IP_ROUTE		21	/* ipRouteEntry */
163 #define	MIB2_IP_MEDIA		22	/* ipNetToMediaEntry */
164 #define	MIB2_IP6_ROUTE		23	/* ipv6RouteEntry */
165 #define	MIB2_IP6_MEDIA		24	/* ipv6NetToMediaEntry */
166 #define	MIB2_IP6_ADDR		25	/* ipv6AddrEntry */
167 #define	MIB2_IP_TRAFFIC_STATS	31	/* ipIfStatsEntry (IPv4) */
168 #define	EXPER_IP_GROUP_MEMBERSHIP	100
169 #define	EXPER_IP6_GROUP_MEMBERSHIP	101
170 #define	EXPER_IP_GROUP_SOURCES		102
171 #define	EXPER_IP6_GROUP_SOURCES		103
172 #define	EXPER_IP_RTATTR			104
173 
174 /*
175  * There can be one of each of these tables per transport (MIB2_* above).
176  */
177 #define	EXPER_XPORT_MLP		105	/* transportMLPEntry */
178 
179 /* Old names retained for compatibility */
180 #define	MIB2_IP_20	MIB2_IP_ADDR
181 #define	MIB2_IP_21	MIB2_IP_ROUTE
182 #define	MIB2_IP_22	MIB2_IP_MEDIA
183 
184 typedef struct mib2_ip {
185 		/* forwarder?  1 gateway, 2 NOT gateway	{ip 1} RW */
186 	int	ipForwarding;
187 		/* default Time-to-Live for iph		{ip 2} RW */
188 	int	ipDefaultTTL;
189 		/* # of input datagrams			{ip 3} */
190 	Counter	ipInReceives;
191 		/* # of dg discards for iph error	{ip 4} */
192 	Counter	ipInHdrErrors;
193 		/* # of dg discards for bad addr	{ip 5} */
194 	Counter	ipInAddrErrors;
195 		/* # of dg being forwarded		{ip 6} */
196 	Counter	ipForwDatagrams;
197 		/* # of dg discards for unk protocol	{ip 7} */
198 	Counter	ipInUnknownProtos;
199 		/* # of dg discards of good dg's	{ip 8} */
200 	Counter	ipInDiscards;
201 		/* # of dg sent upstream		{ip 9} */
202 	Counter ipInDelivers;
203 		/* # of outdgs recv'd from upstream	{ip 10} */
204 	Counter	ipOutRequests;
205 		/* # of good outdgs discarded		{ip 11} */
206 	Counter ipOutDiscards;
207 		/* # of outdg discards: no route found	{ip 12} */
208 	Counter	ipOutNoRoutes;
209 		/* sec's recv'd frags held for reass.	{ip 13}	*/
210 	int	ipReasmTimeout;
211 		/* # of ip frags needing reassembly	{ip 14} */
212 	Counter	ipReasmReqds;
213 		/* # of dg's reassembled		{ip 15} */
214 	Counter	ipReasmOKs;
215 		/* # of reassembly failures (not dg cnt){ip 16} */
216 	Counter	ipReasmFails;
217 		/* # of dg's fragged			{ip 17} */
218 	Counter	ipFragOKs;
219 		/* # of dg discards for no frag set	{ip 18} */
220 	Counter ipFragFails;
221 		/* # of dg frags from fragmentation	{ip 19} */
222 	Counter	ipFragCreates;
223 		/* {ip 20} */
224 	int	ipAddrEntrySize;
225 		/* {ip 21} */
226 	int	ipRouteEntrySize;
227 		/* {ip 22} */
228 	int	ipNetToMediaEntrySize;
229 		/* # of valid route entries discarded 	{ip 23} */
230 	Counter	ipRoutingDiscards;
231 /*
232  * following defined in MIB-II as part of TCP & UDP groups:
233  */
234 		/* total # of segments recv'd with error	{ tcp 14 } */
235 	Counter	tcpInErrs;
236 		/* # of recv'd dg's not deliverable (no appl.)	{ udp 2 } */
237 	Counter	udpNoPorts;
238 /*
239  * In addition to MIB-II
240  */
241 		/* # of bad IP header checksums */
242 	Counter	ipInCksumErrs;
243 		/* # of complete duplicates in reassembly */
244 	Counter	ipReasmDuplicates;
245 		/* # of partial duplicates in reassembly */
246 	Counter	ipReasmPartDups;
247 		/* # of packets not forwarded due to adminstrative reasons */
248 	Counter	ipForwProhibits;
249 		/* # of UDP packets with bad UDP checksums */
250 	Counter udpInCksumErrs;
251 		/* # of UDP packets droped due to queue overflow */
252 	Counter udpInOverflows;
253 		/*
254 		 * # of RAW IP packets (all IP protocols except UDP, TCP
255 		 * and ICMP) droped due to queue overflow
256 		 */
257 	Counter rawipInOverflows;
258 
259 	/*
260 	 * Folowing are private IPSEC MIB.
261 	 */
262 	/* # of incoming packets that succeeded policy checks */
263 	Counter ipsecInSucceeded;
264 	/* # of incoming packets that failed policy checks */
265 	Counter ipsecInFailed;
266 /* Compatible extensions added here */
267 	int	ipMemberEntrySize;	/* Size of ip_member_t */
268 	int	ipGroupSourceEntrySize;	/* Size of ip_grpsrc_t */
269 
270 		/* # of IPv6 packets received by IPv4 and dropped */
271 	Counter ipInIPv6;
272 		/* # of IPv6 packets transmitted by ip_wput */
273 	Counter ipOutIPv6;
274 		/* # of times ip_wput has switched to become ip_wput_v6 */
275 	Counter ipOutSwitchIPv6;
276 
277 	int	ipRouteAttributeSize;	/* Size of mib2_ipAttributeEntry_t */
278 	int	transportMLPSize;	/* Size of mib2_transportMLPEntry_t */
279 } mib2_ip_t;
280 
281 /*
282  *	ipv6IfStatsEntry OBJECT-TYPE
283  *		SYNTAX     Ipv6IfStatsEntry
284  *		MAX-ACCESS not-accessible
285  *		STATUS     current
286  *		DESCRIPTION
287  *			"An interface statistics entry containing objects
288  *			at a particular IPv6 interface."
289  *		AUGMENTS { ipv6IfEntry }
290  *		::= { ipv6IfStatsTable 1 }
291  *
292  * Per-interface IPv6 statistics table
293  */
294 
295 typedef struct mib2_ipv6IfStatsEntry {
296 	/* Local ifindex to identify the interface */
297 	DeviceIndex	ipv6IfIndex;
298 
299 		/* forwarder?  1 gateway, 2 NOT gateway	{ipv6MIBObjects 1} RW */
300 	int	ipv6Forwarding;
301 		/* default Hoplimit for IPv6		{ipv6MIBObjects 2} RW */
302 	int	ipv6DefaultHopLimit;
303 
304 	int	ipv6IfStatsEntrySize;
305 	int	ipv6AddrEntrySize;
306 	int	ipv6RouteEntrySize;
307 	int	ipv6NetToMediaEntrySize;
308 	int	ipv6MemberEntrySize;		/* Size of ipv6_member_t */
309 	int	ipv6GroupSourceEntrySize;	/* Size of ipv6_grpsrc_t */
310 
311 	/* # input datagrams (incl errors)	{ ipv6IfStatsEntry 1 } */
312 	Counter	ipv6InReceives;
313 	/* # errors in IPv6 headers and options	{ ipv6IfStatsEntry 2 } */
314 	Counter	ipv6InHdrErrors;
315 	/* # exceeds outgoing link MTU		{ ipv6IfStatsEntry 3 } */
316 	Counter	ipv6InTooBigErrors;
317 	/* # discarded due to no route to dest 	{ ipv6IfStatsEntry 4 } */
318 	Counter	ipv6InNoRoutes;
319 	/* # invalid or unsupported addresses	{ ipv6IfStatsEntry 5 } */
320 	Counter	ipv6InAddrErrors;
321 	/* # unknown next header 		{ ipv6IfStatsEntry 6 } */
322 	Counter	ipv6InUnknownProtos;
323 	/* # too short packets			{ ipv6IfStatsEntry 7 } */
324 	Counter	ipv6InTruncatedPkts;
325 	/* # discarded e.g. due to no buffers	{ ipv6IfStatsEntry 8 } */
326 	Counter	ipv6InDiscards;
327 	/* # delivered to upper layer protocols	{ ipv6IfStatsEntry 9 } */
328 	Counter	ipv6InDelivers;
329 	/* # forwarded out interface		{ ipv6IfStatsEntry 10 } */
330 	Counter	ipv6OutForwDatagrams;
331 	/* # originated out interface		{ ipv6IfStatsEntry 11 } */
332 	Counter	ipv6OutRequests;
333 	/* # discarded e.g. due to no buffers	{ ipv6IfStatsEntry 12 } */
334 	Counter	ipv6OutDiscards;
335 	/* # sucessfully fragmented packets	{ ipv6IfStatsEntry 13 } */
336 	Counter	ipv6OutFragOKs;
337 	/* # fragmentation failed		{ ipv6IfStatsEntry 14 } */
338 	Counter	ipv6OutFragFails;
339 	/* # fragments created			{ ipv6IfStatsEntry 15 } */
340 	Counter	ipv6OutFragCreates;
341 	/* # fragments to reassemble		{ ipv6IfStatsEntry 16 } */
342 	Counter	ipv6ReasmReqds;
343 	/* # packets after reassembly		{ ipv6IfStatsEntry 17 } */
344 	Counter	ipv6ReasmOKs;
345 	/* # reassembly failed			{ ipv6IfStatsEntry 18 } */
346 	Counter	ipv6ReasmFails;
347 	/* # received multicast packets		{ ipv6IfStatsEntry 19 } */
348 	Counter	ipv6InMcastPkts;
349 	/* # transmitted multicast packets	{ ipv6IfStatsEntry 20 } */
350 	Counter	ipv6OutMcastPkts;
351 /*
352  * In addition to defined MIBs
353  */
354 		/* # discarded due to no route to dest */
355 	Counter	ipv6OutNoRoutes;
356 		/* # of complete duplicates in reassembly */
357 	Counter	ipv6ReasmDuplicates;
358 		/* # of partial duplicates in reassembly */
359 	Counter	ipv6ReasmPartDups;
360 		/* # of packets not forwarded due to adminstrative reasons */
361 	Counter	ipv6ForwProhibits;
362 		/* # of UDP packets with bad UDP checksums */
363 	Counter udpInCksumErrs;
364 		/* # of UDP packets droped due to queue overflow */
365 	Counter udpInOverflows;
366 		/*
367 		 * # of RAW IPv6 packets (all IPv6 protocols except UDP, TCP
368 		 * and ICMPv6) droped due to queue overflow
369 		 */
370 	Counter rawipInOverflows;
371 
372 		/* # of IPv4 packets received by IPv6 and dropped */
373 	Counter ipv6InIPv4;
374 		/* # of IPv4 packets transmitted by ip_wput_wput */
375 	Counter ipv6OutIPv4;
376 		/* # of times ip_wput_v6 has switched to become ip_wput */
377 	Counter ipv6OutSwitchIPv4;
378 } mib2_ipv6IfStatsEntry_t;
379 
380 /*
381  * Per interface IP statistics, both v4 and v6.
382  *
383  * Some applications expect to get mib2_ipv6IfStatsEntry_t structs back when
384  * making a request. To ensure backwards compatability, the first
385  * sizeof(mib2_ipv6IfStatsEntry_t) bytes of the structure is identical to
386  * mib2_ipv6IfStatsEntry_t. This should work as long the application is
387  * written correctly (i.e., using ipv6IfStatsEntrySize to get the size of
388  * the struct)
389  *
390  * RFC4293 introduces several new counters, as well as defining 64-bit
391  * versions of existing counters. For a new counters, if they have both 32-
392  * and 64-bit versions, then we only added the latter. However, for already
393  * existing counters, we have added the 64-bit versions without removing the
394  * old (32-bit) ones. The 64- and 32-bit counters will only be synchronized
395  * when the structure contains IPv6 statistics, which is done to ensure
396  * backwards compatibility.
397  */
398 
399 /* The following are defined in RFC 4001 and are used for ipIfStatsIPVersion */
400 #define	MIB2_INETADDRESSTYPE_unknown	0
401 #define	MIB2_INETADDRESSTYPE_ipv4	1
402 #define	MIB2_INETADDRESSTYPE_ipv6	2
403 
404 /*
405  * On amd64, the alignment requirements for long long's is different for
406  * 32 and 64 bits. If we have a struct containing long long's that is being
407  * passed between a 64-bit kernel to a 32-bit application, then it is very
408  * likely that the size of the struct will differ due to padding. Therefore, we
409  * pack the data to ensure that the struct size is the same for 32- and
410  * 64-bits.
411  */
412 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
413 #pragma pack(4)
414 #endif
415 
416 typedef struct mib2_ipIfStatsEntry {
417 
418 	/* Local ifindex to identify the interface */
419 	DeviceIndex	ipIfStatsIfIndex;
420 
421 	/* forwarder?  1 gateway, 2 NOT gateway	{ ipv6MIBObjects 1} RW */
422 	int	ipIfStatsForwarding;
423 	/* default Hoplimit for IPv6		{ ipv6MIBObjects 2} RW */
424 	int	ipIfStatsDefaultHopLimit;
425 #define	ipIfStatsDefaultTTL	ipIfStatsDefaultHopLimit
426 
427 	int	ipIfStatsEntrySize;
428 	int	ipIfStatsAddrEntrySize;
429 	int	ipIfStatsRouteEntrySize;
430 	int	ipIfStatsNetToMediaEntrySize;
431 	int	ipIfStatsMemberEntrySize;
432 	int	ipIfStatsGroupSourceEntrySize;
433 
434 	/* # input datagrams (incl errors)	{ ipIfStatsEntry 3 } */
435 	Counter	ipIfStatsInReceives;
436 	/* # errors in IP headers and options	{ ipIfStatsEntry 7 } */
437 	Counter	ipIfStatsInHdrErrors;
438 	/* # exceeds outgoing link MTU(v6 only)	{ ipv6IfStatsEntry 3 } */
439 	Counter	ipIfStatsInTooBigErrors;
440 	/* # discarded due to no route to dest 	{ ipIfStatsEntry 8 } */
441 	Counter	ipIfStatsInNoRoutes;
442 	/* # invalid or unsupported addresses	{ ipIfStatsEntry 9 } */
443 	Counter	ipIfStatsInAddrErrors;
444 	/* # unknown next header 		{ ipIfStatsEntry 10 } */
445 	Counter	ipIfStatsInUnknownProtos;
446 	/* # too short packets			{ ipIfStatsEntry 11 } */
447 	Counter	ipIfStatsInTruncatedPkts;
448 	/* # discarded e.g. due to no buffers	{ ipIfStatsEntry 17 } */
449 	Counter	ipIfStatsInDiscards;
450 	/* # delivered to upper layer protocols	{ ipIfStatsEntry 18 } */
451 	Counter	ipIfStatsInDelivers;
452 	/* # forwarded out interface		{ ipIfStatsEntry 23 } */
453 	Counter	ipIfStatsOutForwDatagrams;
454 	/* # originated out interface		{ ipIfStatsEntry 20 } */
455 	Counter	ipIfStatsOutRequests;
456 	/* # discarded e.g. due to no buffers	{ ipIfStatsEntry 25 } */
457 	Counter	ipIfStatsOutDiscards;
458 	/* # sucessfully fragmented packets	{ ipIfStatsEntry 27 } */
459 	Counter	ipIfStatsOutFragOKs;
460 	/* # fragmentation failed		{ ipIfStatsEntry 28 } */
461 	Counter	ipIfStatsOutFragFails;
462 	/* # fragments created			{ ipIfStatsEntry 29 } */
463 	Counter	ipIfStatsOutFragCreates;
464 	/* # fragments to reassemble		{ ipIfStatsEntry 14 } */
465 	Counter	ipIfStatsReasmReqds;
466 	/* # packets after reassembly		{ ipIfStatsEntry 15 } */
467 	Counter	ipIfStatsReasmOKs;
468 	/* # reassembly failed			{ ipIfStatsEntry 16 } */
469 	Counter	ipIfStatsReasmFails;
470 	/* # received multicast packets		{ ipIfStatsEntry 34 } */
471 	Counter	ipIfStatsInMcastPkts;
472 	/* # transmitted multicast packets	{ ipIfStatsEntry 38 } */
473 	Counter	ipIfStatsOutMcastPkts;
474 
475 	/*
476 	 * In addition to defined MIBs
477 	 */
478 
479 	/* # discarded due to no route to dest 	{ ipSystemStatsEntry 22 } */
480 	Counter	ipIfStatsOutNoRoutes;
481 	/* # of complete duplicates in reassembly */
482 	Counter	ipIfStatsReasmDuplicates;
483 	/* # of partial duplicates in reassembly */
484 	Counter	ipIfStatsReasmPartDups;
485 	/* # of packets not forwarded due to adminstrative reasons */
486 	Counter	ipIfStatsForwProhibits;
487 	/* # of UDP packets with bad UDP checksums */
488 	Counter udpInCksumErrs;
489 #define	udpIfStatsInCksumErrs	udpInCksumErrs
490 	/* # of UDP packets droped due to queue overflow */
491 	Counter udpInOverflows;
492 #define	udpIfStatsInOverflows	udpInOverflows
493 	/*
494 	 * # of RAW IP packets (all IP protocols except UDP, TCP
495 	 * and ICMP) droped due to queue overflow
496 	 */
497 	Counter rawipInOverflows;
498 #define	rawipIfStatsInOverflows	rawipInOverflows
499 
500 	/*
501 	 * # of IP packets received with the wrong version (i.e., not equal
502 	 * to ipIfStatsIPVersion) and that were dropped.
503 	 */
504 	Counter ipIfStatsInWrongIPVersion;
505 	/*
506 	 * Depending on the value of ipIfStatsIPVersion, this counter tracks
507 	 * v4: # of IPv6 packets transmitted by ip_wput or,
508 	 * v6: # of IPv4 packets transmitted by ip_wput_v6.
509 	 */
510 	Counter ipIfStatsOutWrongIPVersion;
511 	/*
512 	 * Depending on the value of ipIfStatsIPVersion, this counter tracks
513 	 * # of times ip_wput has switched to become ip_wput_v6, or vice versa.
514 	 */
515 	Counter ipIfStatsOutSwitchIPVersion;
516 
517 	/*
518 	 * Fields defined in RFC 4293
519 	 */
520 
521 	/* ip version				{ ipIfStatsEntry 1 } */
522 	int		ipIfStatsIPVersion;
523 	/* # input datagrams (incl errors)	{ ipIfStatsEntry 4 } */
524 	Counter64	ipIfStatsHCInReceives;
525 	/* # input octets (incl errors)		{ ipIfStatsEntry 6 } */
526 	Counter64	ipIfStatsHCInOctets;
527 	/*
528 	 *					{ ipIfStatsEntry 13 }
529 	 * # input datagrams for which a forwarding attempt was made
530 	 */
531 	Counter64	ipIfStatsHCInForwDatagrams;
532 	/* # delivered to upper layer protocols	{ ipIfStatsEntry 19 } */
533 	Counter64	ipIfStatsHCInDelivers;
534 	/* # originated out interface		{ ipIfStatsEntry 21 } */
535 	Counter64	ipIfStatsHCOutRequests;
536 	/* # forwarded out interface		{ ipIfStatsEntry 23 } */
537 	Counter64	ipIfStatsHCOutForwDatagrams;
538 	/* # dg's requiring fragmentation 	{ ipIfStatsEntry 26 } */
539 	Counter		ipIfStatsOutFragReqds;
540 	/* # output datagrams			{ ipIfStatsEntry 31 } */
541 	Counter64	ipIfStatsHCOutTransmits;
542 	/* # output octets			{ ipIfStatsEntry 33 } */
543 	Counter64	ipIfStatsHCOutOctets;
544 	/* # received multicast datagrams	{ ipIfStatsEntry 35 } */
545 	Counter64	ipIfStatsHCInMcastPkts;
546 	/* # received multicast octets		{ ipIfStatsEntry 37 } */
547 	Counter64	ipIfStatsHCInMcastOctets;
548 	/* # transmitted multicast datagrams	{ ipIfStatsEntry 39 } */
549 	Counter64	ipIfStatsHCOutMcastPkts;
550 	/* # transmitted multicast octets	{ ipIfStatsEntry 41 } */
551 	Counter64	ipIfStatsHCOutMcastOctets;
552 	/* # received broadcast datagrams	{ ipIfStatsEntry 43 } */
553 	Counter64	ipIfStatsHCInBcastPkts;
554 	/* # transmitted broadcast datagrams	{ ipIfStatsEntry 45 } */
555 	Counter64	ipIfStatsHCOutBcastPkts;
556 
557 	/*
558 	 * Fields defined in mib2_ip_t
559 	 */
560 
561 	/* # of incoming packets that succeeded policy checks */
562 	Counter		ipsecInSucceeded;
563 #define	ipsecIfStatsInSucceeded	ipsecInSucceeded
564 	/* # of incoming packets that failed policy checks */
565 	Counter		ipsecInFailed;
566 #define	ipsecIfStatsInFailed	ipsecInFailed
567 	/* # of bad IP header checksums */
568 	Counter		ipInCksumErrs;
569 #define	ipIfStatsInCksumErrs	ipInCksumErrs
570 	/* total # of segments recv'd with error	{ tcp 14 } */
571 	Counter		tcpInErrs;
572 #define	tcpIfStatsInErrs	tcpInErrs
573 	/* # of recv'd dg's not deliverable (no appl.)	{ udp 2 } */
574 	Counter		udpNoPorts;
575 #define	udpIfStatsNoPorts	udpNoPorts
576 } mib2_ipIfStatsEntry_t;
577 
578 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
579 #pragma pack()
580 #endif
581 
582 /*
583  * The IP address table contains this entity's IP addressing information.
584  *
585  *	ipAddrTable OBJECT-TYPE
586  *		SYNTAX  SEQUENCE OF IpAddrEntry
587  *		ACCESS  not-accessible
588  *		STATUS  mandatory
589  *		DESCRIPTION
590  *			"The table of addressing information relevant to
591  *			this entity's IP addresses."
592  *		::= { ip 20 }
593  */
594 
595 typedef struct mib2_ipAddrEntry {
596 			/* IP address of this entry	{ipAddrEntry 1} */
597 	IpAddress	ipAdEntAddr;
598 			/* Unique interface index	{ipAddrEntry 2} */
599 	DeviceName	ipAdEntIfIndex;
600 			/* Subnet mask for this IP addr	{ipAddrEntry 3} */
601 	IpAddress	ipAdEntNetMask;
602 			/* 2^lsb of IP broadcast addr	{ipAddrEntry 4} */
603 	int		ipAdEntBcastAddr;
604 			/* max size for dg reassembly	{ipAddrEntry 5} */
605 	int		ipAdEntReasmMaxSize;
606 			/* additional ipif_t fields */
607 	struct ipAdEntInfo_s {
608 		Gauge		ae_mtu;
609 				/* BSD if metric */
610 		int		ae_metric;
611 				/* ipif broadcast addr.  relation to above?? */
612 		IpAddress	ae_broadcast_addr;
613 				/* point-point dest addr */
614 		IpAddress	ae_pp_dst_addr;
615 		int		ae_flags;	/* IFF_* flags in if.h */
616 		Counter		ae_ibcnt;	/* Inbound packets */
617 		Counter		ae_obcnt;	/* Outbound packets */
618 		Counter		ae_focnt;	/* Forwarded packets */
619 		IpAddress	ae_subnet;	/* Subnet prefix */
620 		int		ae_subnet_len;	/* Subnet prefix length */
621 		IpAddress	ae_src_addr;	/* Source address */
622 	}		ipAdEntInfo;
623 	uint32_t	ipAdEntRetransmitTime;  /* ipInterfaceRetransmitTime */
624 } mib2_ipAddrEntry_t;
625 
626 /*
627  *	ipv6AddrTable OBJECT-TYPE
628  *		SYNTAX      SEQUENCE OF Ipv6AddrEntry
629  *		MAX-ACCESS  not-accessible
630  *		STATUS      current
631  *		DESCRIPTION
632  *			"The table of addressing information relevant to
633  *			this node's interface addresses."
634  *		::= { ipv6MIBObjects 8 }
635  */
636 
637 typedef struct mib2_ipv6AddrEntry {
638 	/* Unique interface index			{ Part of INDEX } */
639 	DeviceName	ipv6AddrIfIndex;
640 
641 	/* IPv6 address of this entry			{ ipv6AddrEntry 1 } */
642 	Ip6Address	ipv6AddrAddress;
643 	/* Prefix length				{ ipv6AddrEntry 2 } */
644 	uint_t		ipv6AddrPfxLength;
645 	/* Type: stateless(1), stateful(2), unknown(3)	{ ipv6AddrEntry 3 } */
646 	uint_t		ipv6AddrType;
647 	/* Anycast: true(1), false(2)			{ ipv6AddrEntry 4 } */
648 	uint_t		ipv6AddrAnycastFlag;
649 	/*
650 	 * Address status: preferred(1), deprecated(2), invalid(3),
651 	 * inaccessible(4), unknown(5)			{ ipv6AddrEntry 5 }
652 	 */
653 	uint_t		ipv6AddrStatus;
654 	struct ipv6AddrInfo_s {
655 		Gauge		ae_mtu;
656 				/* BSD if metric */
657 		int		ae_metric;
658 				/* point-point dest addr */
659 		Ip6Address	ae_pp_dst_addr;
660 		int		ae_flags;	/* IFF_* flags in if.h */
661 		Counter		ae_ibcnt;	/* Inbound packets */
662 		Counter		ae_obcnt;	/* Outbound packets */
663 		Counter		ae_focnt;	/* Forwarded packets */
664 		Ip6Address	ae_subnet;	/* Subnet prefix */
665 		int		ae_subnet_len;	/* Subnet prefix length */
666 		Ip6Address	ae_src_addr;	/* Source address */
667 	}		ipv6AddrInfo;
668 	uint32_t	ipv6AddrReasmMaxSize;	/* InterfaceReasmMaxSize */
669 	Ip6Address	ipv6AddrIdentifier;	/* InterfaceIdentifier */
670 	uint32_t	ipv6AddrIdentifierLen;
671 	uint32_t	ipv6AddrReachableTime;	/* InterfaceReachableTime */
672 	uint32_t	ipv6AddrRetransmitTime; /* InterfaceRetransmitTime */
673 } mib2_ipv6AddrEntry_t;
674 
675 /*
676  * The IP routing table contains an entry for each route presently known to
677  * this entity. (for IPv4 routes)
678  *
679  *	ipRouteTable OBJECT-TYPE
680  *		SYNTAX  SEQUENCE OF IpRouteEntry
681  *		ACCESS  not-accessible
682  *		STATUS  mandatory
683  *		DESCRIPTION
684  *			"This entity's IP Routing table."
685  *		::= { ip 21 }
686  */
687 
688 typedef struct mib2_ipRouteEntry {
689 		/* dest ip addr for this route		{ipRouteEntry 1 } RW */
690 	IpAddress	ipRouteDest;
691 		/* unique interface index for this hop	{ipRouteEntry 2 } RW */
692 	DeviceName	ipRouteIfIndex;
693 		/* primary route metric 		{ipRouteEntry 3 } RW */
694 	int		ipRouteMetric1;
695 		/* alternate route metric 		{ipRouteEntry 4 } RW */
696 	int		ipRouteMetric2;
697 		/* alternate route metric 		{ipRouteEntry 5 } RW */
698 	int		ipRouteMetric3;
699 		/* alternate route metric 		{ipRouteEntry 6 } RW */
700 	int		ipRouteMetric4;
701 		/* ip addr of next hop on this route	{ipRouteEntry 7 } RW */
702 	IpAddress	ipRouteNextHop;
703 		/* other(1), inval(2), dir(3), indir(4)	{ipRouteEntry 8 } RW */
704 	int		ipRouteType;
705 		/* mechanism by which route was learned	{ipRouteEntry 9 } */
706 	int		ipRouteProto;
707 		/* sec's since last update of route	{ipRouteEntry 10} RW */
708 	int		ipRouteAge;
709 		/* 					{ipRouteEntry 11} RW */
710 	IpAddress	ipRouteMask;
711 		/* alternate route metric 		{ipRouteEntry 12} RW */
712 	int		ipRouteMetric5;
713 		/* additional info from ire's		{ipRouteEntry 13 } */
714 	struct ipRouteInfo_s {
715 		Gauge		re_max_frag;
716 		Gauge		re_rtt;
717 		Counter		re_ref;
718 		int		re_frag_flag;
719 		IpAddress	re_src_addr;
720 		int		re_ire_type;
721 		Counter		re_obpkt;
722 		Counter		re_ibpkt;
723 		int		re_flags;
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