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