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