summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/mib2.h
blob: 5a168523ee1f90fa17ddef29a2d7353c479ebd88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
 */
/*
 * Copyright (c) 1990 Mentat Inc.
 * Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 */

/*
 * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 */

#ifndef	_INET_MIB2_H
#define	_INET_MIB2_H

#include <netinet/in.h>	/* For in6_addr_t */
#include <sys/tsol/label.h> /* For brange_t */
#include <sys/tsol/label_macro.h> /* For brange_t */

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * The IPv6 parts of this are derived from:
 *	RFC 2465
 *	RFC 2466
 *	RFC 2452
 *	RFC 2454
 */

/*
 * SNMP set/get via M_PROTO T_OPTMGMT_REQ.  Structure is that used
 * for [gs]etsockopt() calls.  get uses T_CURRENT, set uses T_NEOGTIATE
 * MGMT_flags value.  The following definition of opthdr is taken from
 * socket.h:
 *
 * An option specification consists of an opthdr, followed by the value of
 * the option.  An options buffer contains one or more options.  The len
 * field of opthdr specifies the length of the option value in bytes.  This
 * length must be a multiple of sizeof(long) (use OPTLEN macro).
 *
 * struct opthdr {
 *	long	level;	protocol level affected
 *	long	name;	option to modify
 *	long	len;	length of option value
 * };
 *
 * #define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
 * #define OPTVAL(opt) ((char *)(opt + 1))
 *
 * For get requests (T_CURRENT), any MIB2_xxx value can be used (only
 * "get all" is supported, so all modules get a copy of the request to
 * return everything it knows.   In general, we use MIB2_IP.  There is
 * one exception: in general, IP will not report information related to
 * ire_testhidden and IRE_IF_CLONE routes (e.g., in the MIB2_IP_ROUTE
 * table). However, using the special value EXPER_IP_AND_ALL_IRES will cause
 * all information to be reported.  This special value should only be
 * used by IPMP-aware low-level utilities (e.g. in.mpathd).
 *
 * IMPORTANT:  some fields are grouped in a different structure than
 * suggested by MIB-II, e.g., checksum error counts.  The original MIB-2
 * field name has been retained.  Field names beginning with "mi" are not
 * defined in the MIB but contain important & useful information maintained
 * by the corresponding module.
 */
#ifndef IPPROTO_MAX
#define	IPPROTO_MAX	256
#endif

#define	MIB2_SYSTEM		(IPPROTO_MAX+1)
#define	MIB2_INTERFACES		(IPPROTO_MAX+2)
#define	MIB2_AT			(IPPROTO_MAX+3)
#define	MIB2_IP			(IPPROTO_MAX+4)
#define	MIB2_ICMP		(IPPROTO_MAX+5)
#define	MIB2_TCP		(IPPROTO_MAX+6)
#define	MIB2_UDP		(IPPROTO_MAX+7)
#define	MIB2_EGP		(IPPROTO_MAX+8)
#define	MIB2_CMOT		(IPPROTO_MAX+9)
#define	MIB2_TRANSMISSION	(IPPROTO_MAX+10)
#define	MIB2_SNMP		(IPPROTO_MAX+11)
#define	MIB2_IP6		(IPPROTO_MAX+12)
#define	MIB2_ICMP6		(IPPROTO_MAX+13)
#define	MIB2_TCP6		(IPPROTO_MAX+14)
#define	MIB2_UDP6		(IPPROTO_MAX+15)
#define	MIB2_SCTP		(IPPROTO_MAX+16)

/*
 * Define range of levels for use with MIB2_*
 */
#define	MIB2_RANGE_START	(IPPROTO_MAX+1)
#define	MIB2_RANGE_END		(IPPROTO_MAX+16)


#define	EXPER			1024	/* experimental - not part of mib */
#define	EXPER_IGMP		(EXPER+1)
#define	EXPER_DVMRP		(EXPER+2)
#define	EXPER_RAWIP		(EXPER+3)
#define	EXPER_IP_AND_ALL_IRES	(EXPER+4)

/*
 * Define range of levels for experimental use
 */
#define	EXPER_RANGE_START	(EXPER+1)
#define	EXPER_RANGE_END		(EXPER+4)

#define	BUMP_MIB(s, x)		{				\
	extern void __dtrace_probe___mib_##x(int, void *);	\
	void *stataddr = &((s)->x);				\
	__dtrace_probe___mib_##x(1, stataddr);			\
	(s)->x++;						\
}

#define	UPDATE_MIB(s, x, y)	{				\
	extern void __dtrace_probe___mib_##x(int, void *);	\
	void *stataddr = &((s)->x);				\
	__dtrace_probe___mib_##x(y, stataddr);			\
	(s)->x += (y);						\
}

#define	SET_MIB(x, y)		x = y
#define	BUMP_LOCAL(x)		(x)++
#define	UPDATE_LOCAL(x, y)	(x) += (y)
#define	SYNC32_MIB(s, m32, m64)	SET_MIB((s)->m32, (s)->m64 & 0xffffffff)

/*
 * Each struct that has been extended have a macro (MIB_FIRST_NEW_ELM_type)
 * that is set to the first new element of the extended struct.
 * The LEGACY_MIB_SIZE macro can be used to determine the size of MIB
 * objects that needs to be returned to older applications unaware of
 * these extensions.
 */
#define	MIB_PTRDIFF(s, e)	(caddr_t)e - (caddr_t)s
#define	LEGACY_MIB_SIZE(s, t)	MIB_PTRDIFF(s, &(s)->MIB_FIRST_NEW_ELM_##t)

#define	OCTET_LENGTH	32	/* Must be at least LIFNAMSIZ */
typedef struct Octet_s {
	int	o_length;
	char	o_bytes[OCTET_LENGTH];
} Octet_t;

typedef uint32_t	Counter;
typedef uint32_t	Counter32;
typedef uint64_t	Counter64;
typedef uint32_t	Gauge;
typedef uint32_t	IpAddress;
typedef	struct in6_addr	Ip6Address;
typedef Octet_t		DeviceName;
typedef Octet_t		PhysAddress;
typedef uint32_t	DeviceIndex;	/* Interface index */

#define	MIB2_UNKNOWN_INTERFACE	0
#define	MIB2_UNKNOWN_PROCESS	0

/*
 *  IP group
 */
#define	MIB2_IP_ADDR		20	/* ipAddrEntry */
#define	MIB2_IP_ROUTE		21	/* ipRouteEntry */
#define	MIB2_IP_MEDIA		22	/* ipNetToMediaEntry */
#define	MIB2_IP6_ROUTE		23	/* ipv6RouteEntry */
#define	MIB2_IP6_MEDIA		24	/* ipv6NetToMediaEntry */
#define	MIB2_IP6_ADDR		25	/* ipv6AddrEntry */
#define	MIB2_IP_TRAFFIC_STATS	31	/* ipIfStatsEntry (IPv4) */
#define	EXPER_IP_GROUP_MEMBERSHIP	100
#define	EXPER_IP6_GROUP_MEMBERSHIP	101
#define	EXPER_IP_GROUP_SOURCES		102
#define	EXPER_IP6_GROUP_SOURCES		103
#define	EXPER_IP_RTATTR			104
#define	EXPER_IP_DCE			105

/*
 * There can be one of each of these tables per transport (MIB2_* above).
 */
#define	EXPER_XPORT_MLP		105	/* transportMLPEntry */
#define	EXPER_SOCK_INFO		106	/* socketInfoEntry */

/* Old names retained for compatibility */
#define	MIB2_IP_20	MIB2_IP_ADDR
#define	MIB2_IP_21	MIB2_IP_ROUTE
#define	MIB2_IP_22	MIB2_IP_MEDIA

typedef struct mib2_ip {
		/* forwarder?  1 gateway, 2 NOT gateway	{ip 1} RW */
	int	ipForwarding;
		/* default Time-to-Live for iph		{ip 2} RW */
	int	ipDefaultTTL;
		/* # of input datagrams			{ip 3} */
	Counter	ipInReceives;
		/* # of dg discards for iph error	{ip 4} */
	Counter	ipInHdrErrors;
		/* # of dg discards for bad addr	{ip 5} */
	Counter	ipInAddrErrors;
		/* # of dg being forwarded		{ip 6} */
	Counter	ipForwDatagrams;
		/* # of dg discards for unk protocol	{ip 7} */
	Counter	ipInUnknownProtos;
		/* # of dg discards of good dg's	{ip 8} */
	Counter	ipInDiscards;
		/* # of dg sent upstream		{ip 9} */
	Counter ipInDelivers;
		/* # of outdgs recv'd from upstream	{ip 10} */
	Counter	ipOutRequests;
		/* # of good outdgs discarded		{ip 11} */
	Counter ipOutDiscards;
		/* # of outdg discards: no route found	{ip 12} */
	Counter	ipOutNoRoutes;
		/* sec's recv'd frags held for reass.	{ip 13}	*/
	int	ipReasmTimeout;
		/* # of ip frags needing reassembly	{ip 14} */
	Counter	ipReasmReqds;
		/* # of dg's reassembled		{ip 15} */
	Counter	ipReasmOKs;
		/* # of reassembly failures (not dg cnt){ip 16} */
	Counter	ipReasmFails;
		/* # of dg's fragged			{ip 17} */
	Counter	ipFragOKs;
		/* # of dg discards for no frag set	{ip 18} */
	Counter ipFragFails;
		/* # of dg frags from fragmentation	{ip 19} */
	Counter	ipFragCreates;
		/* {ip 20} */
	int	ipAddrEntrySize;
		/* {ip 21} */
	int	ipRouteEntrySize;
		/* {ip 22} */
	int	ipNetToMediaEntrySize;
		/* # of valid route entries discarded	{ip 23} */
	Counter	ipRoutingDiscards;
/*
 * following defined in MIB-II as part of TCP & UDP groups:
 */
		/* total # of segments recv'd with error	{ tcp 14 } */
	Counter	tcpInErrs;
		/* # of recv'd dg's not deliverable (no appl.)	{ udp 2 } */
	Counter	udpNoPorts;
/*
 * In addition to MIB-II
 */
		/* # of bad IP header checksums */
	Counter	ipInCksumErrs;
		/* # of complete duplicates in reassembly */
	Counter	ipReasmDuplicates;
		/* # of partial duplicates in reassembly */
	Counter	ipReasmPartDups;
		/* # of packets not forwarded due to adminstrative reasons */
	Counter	ipForwProhibits;
		/* # of UDP packets with bad UDP checksums */
	Counter udpInCksumErrs;
		/* # of UDP packets droped due to queue overflow */
	Counter udpInOverflows;
		/*
		 * # of RAW IP packets (all IP protocols except UDP, TCP
		 * and ICMP) droped due to queue overflow
		 */
	Counter rawipInOverflows;

	/*
	 * Folowing are private IPSEC MIB.
	 */
	/* # of incoming packets that succeeded policy checks */
	Counter ipsecInSucceeded;
	/* # of incoming packets that failed policy checks */
	Counter ipsecInFailed;
/* Compatible extensions added here */
	int	ipMemberEntrySize;	/* Size of ip_member_t */
	int	ipGroupSourceEntrySize;	/* Size of ip_grpsrc_t */

	Counter ipInIPv6; /* # of IPv6 packets received by IPv4 and dropped */
	Counter ipOutIPv6;		/* No longer used */
	Counter ipOutSwitchIPv6;	/* No longer used */

	int	ipRouteAttributeSize;	/* Size of mib2_ipAttributeEntry_t */
	int	transportMLPSize;	/* Size of mib2_transportMLPEntry_t */
	int	ipDestEntrySize;	/* Size of dest_cache_entry_t */
} mib2_ip_t;

/*
 *	ipv6IfStatsEntry OBJECT-TYPE
 *		SYNTAX     Ipv6IfStatsEntry
 *		MAX-ACCESS not-accessible
 *		STATUS     current
 *		DESCRIPTION
 *			"An interface statistics entry containing objects
 *			at a particular IPv6 interface."
 *		AUGMENTS { ipv6IfEntry }
 *		::= { ipv6IfStatsTable 1 }
 *
 * Per-interface IPv6 statistics table
 */

typedef struct mib2_ipv6IfStatsEntry {
	/* Local ifindex to identify the interface */
	DeviceIndex	ipv6IfIndex;

		/* forwarder?  1 gateway, 2 NOT gateway	{ipv6MIBObjects 1} RW */
	int	ipv6Forwarding;
		/* default Hoplimit for IPv6		{ipv6MIBObjects 2} RW */
	int	ipv6DefaultHopLimit;

	int	ipv6IfStatsEntrySize;
	int	ipv6AddrEntrySize;
	int	ipv6RouteEntrySize;
	int	ipv6NetToMediaEntrySize;
	int	ipv6MemberEntrySize;		/* Size of ipv6_member_t */
	int	ipv6GroupSourceEntrySize;	/* Size of ipv6_grpsrc_t */

	/* # input datagrams (incl errors)	{ ipv6IfStatsEntry 1 } */
	Counter	ipv6InReceives;
	/* # errors in IPv6 headers and options	{ ipv6IfStatsEntry 2 } */
	Counter	ipv6InHdrErrors;
	/* # exceeds outgoing link MTU		{ ipv6IfStatsEntry 3 } */
	Counter	ipv6InTooBigErrors;
	/* # discarded due to no route to dest	{ ipv6IfStatsEntry 4 } */
	Counter	ipv6InNoRoutes;
	/* # invalid or unsupported addresses	{ ipv6IfStatsEntry 5 } */
	Counter	ipv6InAddrErrors;
	/* # unknown next header		{ ipv6IfStatsEntry 6 } */
	Counter	ipv6InUnknownProtos;
	/* # too short packets			{ ipv6IfStatsEntry 7 } */
	Counter	ipv6InTruncatedPkts;
	/* # discarded e.g. due to no buffers	{ ipv6IfStatsEntry 8 } */
	Counter	ipv6InDiscards;
	/* # delivered to upper layer protocols	{ ipv6IfStatsEntry 9 } */
	Counter	ipv6InDelivers;
	/* # forwarded out interface		{ ipv6IfStatsEntry 10 } */
	Counter	ipv6OutForwDatagrams;
	/* # originated out interface		{ ipv6IfStatsEntry 11 } */
	Counter	ipv6OutRequests;
	/* # discarded e.g. due to no buffers	{ ipv6IfStatsEntry 12 } */
	Counter	ipv6OutDiscards;
	/* # sucessfully fragmented packets	{ ipv6IfStatsEntry 13 } */
	Counter	ipv6OutFragOKs;
	/* # fragmentation failed		{ ipv6IfStatsEntry 14 } */
	Counter	ipv6OutFragFails;
	/* # fragments created			{ ipv6IfStatsEntry 15 } */
	Counter	ipv6OutFragCreates;
	/* # fragments to reassemble		{ ipv6IfStatsEntry 16 } */
	Counter	ipv6ReasmReqds;
	/* # packets after reassembly		{ ipv6IfStatsEntry 17 } */
	Counter	ipv6ReasmOKs;
	/* # reassembly failed			{ ipv6IfStatsEntry 18 } */
	Counter	ipv6ReasmFails;
	/* # received multicast packets		{ ipv6IfStatsEntry 19 } */
	Counter	ipv6InMcastPkts;
	/* # transmitted multicast packets	{ ipv6IfStatsEntry 20 } */
	Counter	ipv6OutMcastPkts;
/*
 * In addition to defined MIBs
 */
		/* # discarded due to no route to dest */
	Counter	ipv6OutNoRoutes;
		/* # of complete duplicates in reassembly */
	Counter	ipv6ReasmDuplicates;
		/* # of partial duplicates in reassembly */
	Counter	ipv6ReasmPartDups;
		/* # of packets not forwarded due to adminstrative reasons */
	Counter	ipv6ForwProhibits;
		/* # of UDP packets with bad UDP checksums */
	Counter udpInCksumErrs;
		/* # of UDP packets droped due to queue overflow */
	Counter udpInOverflows;
		/*
		 * # of RAW IPv6 packets (all IPv6 protocols except UDP, TCP
		 * and ICMPv6) droped due to queue overflow
		 */
	Counter rawipInOverflows;

		/* # of IPv4 packets received by IPv6 and dropped */
	Counter ipv6InIPv4;
		/* # of IPv4 packets transmitted by ip_wput_wput */
	Counter ipv6OutIPv4;
		/* # of times ip_wput_v6 has switched to become ip_wput */
	Counter ipv6OutSwitchIPv4;
} mib2_ipv6IfStatsEntry_t;

/*
 * Per interface IP statistics, both v4 and v6.
 *
 * Some applications expect to get mib2_ipv6IfStatsEntry_t structs back when
 * making a request. To ensure backwards compatability, the first
 * sizeof(mib2_ipv6IfStatsEntry_t) bytes of the structure is identical to
 * mib2_ipv6IfStatsEntry_t. This should work as long the application is
 * written correctly (i.e., using ipv6IfStatsEntrySize to get the size of
 * the struct)
 *
 * RFC4293 introduces several new counters, as well as defining 64-bit
 * versions of existing counters. For a new counters, if they have both 32-
 * and 64-bit versions, then we only added the latter. However, for already
 * existing counters, we have added the 64-bit versions without removing the
 * old (32-bit) ones. The 64- and 32-bit counters will only be synchronized
 * when the structure contains IPv6 statistics, which is done to ensure
 * backwards compatibility.
 */

/* The following are defined in RFC 4001 and are used for ipIfStatsIPVersion */
#define	MIB2_INETADDRESSTYPE_unknown	0
#define	MIB2_INETADDRESSTYPE_ipv4	1
#define	MIB2_INETADDRESSTYPE_ipv6	2

/*
 * On amd64, the alignment requirements for long long's is different for
 * 32 and 64 bits. If we have a struct containing long long's that is being
 * passed between a 64-bit kernel to a 32-bit application, then it is very
 * likely that the size of the struct will differ due to padding. Therefore, we
 * pack the data to ensure that the struct size is the same for 32- and
 * 64-bits.
 */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif

typedef struct mib2_ipIfStatsEntry {

	/* Local ifindex to identify the interface */
	DeviceIndex	ipIfStatsIfIndex;

	/* forwarder?  1 gateway, 2 NOT gateway	{ ipv6MIBObjects 1} RW */
	int	ipIfStatsForwarding;
	/* default Hoplimit for IPv6		{ ipv6MIBObjects 2} RW */
	int	ipIfStatsDefaultHopLimit;
#define	ipIfStatsDefaultTTL	ipIfStatsDefaultHopLimit

	int	ipIfStatsEntrySize;
	int	ipIfStatsAddrEntrySize;
	int	ipIfStatsRouteEntrySize;
	int	ipIfStatsNetToMediaEntrySize;
	int	ipIfStatsMemberEntrySize;
	int	ipIfStatsGroupSourceEntrySize;

	/* # input datagrams (incl errors)	{ ipIfStatsEntry 3 } */
	Counter	ipIfStatsInReceives;
	/* # errors in IP headers and options	{ ipIfStatsEntry 7 } */
	Counter	ipIfStatsInHdrErrors;
	/* # exceeds outgoing link MTU(v6 only)	{ ipv6IfStatsEntry 3 } */
	Counter	ipIfStatsInTooBigErrors;
	/* # discarded due to no route to dest	{ ipIfStatsEntry 8 } */
	Counter	ipIfStatsInNoRoutes;
	/* # invalid or unsupported addresses	{ ipIfStatsEntry 9 } */
	Counter	ipIfStatsInAddrErrors;
	/* # unknown next header		{ ipIfStatsEntry 10 } */
	Counter	ipIfStatsInUnknownProtos;
	/* # too short packets			{ ipIfStatsEntry 11 } */
	Counter	ipIfStatsInTruncatedPkts;
	/* # discarded e.g. due to no buffers	{ ipIfStatsEntry 17 } */
	Counter	ipIfStatsInDiscards;
	/* # delivered to upper layer protocols	{ ipIfStatsEntry 18 } */
	Counter	ipIfStatsInDelivers;
	/* # forwarded out interface		{ ipIfStatsEntry 23 } */
	Counter	ipIfStatsOutForwDatagrams;
	/* # originated out interface		{ ipIfStatsEntry 20 } */
	Counter	ipIfStatsOutRequests;
	/* # discarded e.g. due to no buffers	{ ipIfStatsEntry 25 } */
	Counter	ipIfStatsOutDiscards;
	/* # sucessfully fragmented packets	{ ipIfStatsEntry 27 } */
	Counter	ipIfStatsOutFragOKs;
	/* # fragmentation failed		{ ipIfStatsEntry 28 } */
	Counter	ipIfStatsOutFragFails;
	/* # fragments created			{ ipIfStatsEntry 29 } */
	Counter	ipIfStatsOutFragCreates;
	/* # fragments to reassemble		{ ipIfStatsEntry 14 } */
	Counter	ipIfStatsReasmReqds;
	/* # packets after reassembly		{ ipIfStatsEntry 15 } */
	Counter	ipIfStatsReasmOKs;
	/* # reassembly failed			{ ipIfStatsEntry 16 } */
	Counter	ipIfStatsReasmFails;
	/* # received multicast packets		{ ipIfStatsEntry 34 } */
	Counter	ipIfStatsInMcastPkts;
	/* # transmitted multicast packets	{ ipIfStatsEntry 38 } */
	Counter	ipIfStatsOutMcastPkts;

	/*
	 * In addition to defined MIBs
	 */

	/* # discarded due to no route to dest	{ ipSystemStatsEntry 22 } */
	Counter	ipIfStatsOutNoRoutes;
	/* # of complete duplicates in reassembly */
	Counter	ipIfStatsReasmDuplicates;
	/* # of partial duplicates in reassembly */
	Counter	ipIfStatsReasmPartDups;
	/* # of packets not forwarded due to adminstrative reasons */
	Counter	ipIfStatsForwProhibits;
	/* # of UDP packets with bad UDP checksums */
	Counter udpInCksumErrs;
#define	udpIfStatsInCksumErrs	udpInCksumErrs
	/* # of UDP packets droped due to queue overflow */
	Counter udpInOverflows;
#define	udpIfStatsInOverflows	udpInOverflows
	/*
	 * # of RAW IP packets (all IP protocols except UDP, TCP
	 * and ICMP) droped due to queue overflow
	 */
	Counter rawipInOverflows;
#define	rawipIfStatsInOverflows	rawipInOverflows

	/*
	 * # of IP packets received with the wrong version (i.e., not equal
	 * to ipIfStatsIPVersion) and that were dropped.
	 */
	Counter ipIfStatsInWrongIPVersion;
	/*
	 * This counter is no longer used
	 */
	Counter ipIfStatsOutWrongIPVersion;
	/*
	 * This counter is no longer used
	 */
	Counter ipIfStatsOutSwitchIPVersion;

	/*
	 * Fields defined in RFC 4293
	 */

	/* ip version				{ ipIfStatsEntry 1 } */
	int		ipIfStatsIPVersion;
	/* # input datagrams (incl errors)	{ ipIfStatsEntry 4 } */
	Counter64	ipIfStatsHCInReceives;
	/* # input octets (incl errors)		{ ipIfStatsEntry 6 } */
	Counter64	ipIfStatsHCInOctets;
	/*
	 *					{ ipIfStatsEntry 13 }
	 * # input datagrams for which a forwarding attempt was made
	 */
	Counter64	ipIfStatsHCInForwDatagrams;
	/* # delivered to upper layer protocols	{ ipIfStatsEntry 19 } */
	Counter64	ipIfStatsHCInDelivers;
	/* # originated out interface		{ ipIfStatsEntry 21 } */
	Counter64	ipIfStatsHCOutRequests;
	/* # forwarded out interface		{ ipIfStatsEntry 23 } */
	Counter64	ipIfStatsHCOutForwDatagrams;
	/* # dg's requiring fragmentation	{ ipIfStatsEntry 26 } */
	Counter		ipIfStatsOutFragReqds;
	/* # output datagrams			{ ipIfStatsEntry 31 } */
	Counter64	ipIfStatsHCOutTransmits;
	/* # output octets			{ ipIfStatsEntry 33 } */
	Counter64	ipIfStatsHCOutOctets;
	/* # received multicast datagrams	{ ipIfStatsEntry 35 } */
	Counter64	ipIfStatsHCInMcastPkts;
	/* # received multicast octets		{ ipIfStatsEntry 37 } */
	Counter64	ipIfStatsHCInMcastOctets;
	/* # transmitted multicast datagrams	{ ipIfStatsEntry 39 } */
	Counter64	ipIfStatsHCOutMcastPkts;
	/* # transmitted multicast octets	{ ipIfStatsEntry 41 } */
	Counter64	ipIfStatsHCOutMcastOctets;
	/* # received broadcast datagrams	{ ipIfStatsEntry 43 } */
	Counter64	ipIfStatsHCInBcastPkts;
	/* # transmitted broadcast datagrams	{ ipIfStatsEntry 45 } */
	Counter64	ipIfStatsHCOutBcastPkts;

	/*
	 * Fields defined in mib2_ip_t
	 */

	/* # of incoming packets that succeeded policy checks */
	Counter		ipsecInSucceeded;
#define	ipsecIfStatsInSucceeded	ipsecInSucceeded
	/* # of incoming packets that failed policy checks */
	Counter		ipsecInFailed;
#define	ipsecIfStatsInFailed	ipsecInFailed
	/* # of bad IP header checksums */
	Counter		ipInCksumErrs;
#define	ipIfStatsInCksumErrs	ipInCksumErrs
	/* total # of segments recv'd with error	{ tcp 14 } */
	Counter		tcpInErrs;
#define	tcpIfStatsInErrs	tcpInErrs
	/* # of recv'd dg's not deliverable (no appl.)	{ udp 2 } */
	Counter		udpNoPorts;
#define	udpIfStatsNoPorts	udpNoPorts
} mib2_ipIfStatsEntry_t;
#define	MIB_FIRST_NEW_ELM_mib2_ipIfStatsEntry_t	ipIfStatsIPVersion

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif

/*
 * The IP address table contains this entity's IP addressing information.
 *
 *	ipAddrTable OBJECT-TYPE
 *		SYNTAX  SEQUENCE OF IpAddrEntry
 *		ACCESS  not-accessible
 *		STATUS  mandatory
 *		DESCRIPTION
 *			"The table of addressing information relevant to
 *			this entity's IP addresses."
 *		::= { ip 20 }
 */

typedef struct mib2_ipAddrEntry {
			/* IP address of this entry	{ipAddrEntry 1} */
	IpAddress	ipAdEntAddr;
			/* Unique interface index	{ipAddrEntry 2} */
	DeviceName	ipAdEntIfIndex;
			/* Subnet mask for this IP addr	{ipAddrEntry 3} */
	IpAddress	ipAdEntNetMask;
			/* 2^lsb of IP broadcast addr	{ipAddrEntry 4} */
	int		ipAdEntBcastAddr;
			/* max size for dg reassembly	{ipAddrEntry 5} */
	int		ipAdEntReasmMaxSize;
			/* additional ipif_t fields */
	struct ipAdEntInfo_s {
		Gauge		ae_mtu;
				/* BSD if metric */
		int		ae_metric;
				/* ipif broadcast addr.  relation to above?? */
		IpAddress	ae_broadcast_addr;
				/* point-point dest addr */
		IpAddress	ae_pp_dst_addr;
		int		ae_flags;	/* IFF_* flags in if.h */
		Counter		ae_ibcnt;	/* Inbound packets */
		Counter		ae_obcnt;	/* Outbound packets */
		Counter		ae_focnt;	/* Forwarded packets */
		IpAddress	ae_subnet;	/* Subnet prefix */
		int		ae_subnet_len;	/* Subnet prefix length */
		IpAddress	ae_src_addr;	/* Source address */
	}		ipAdEntInfo;
	uint32_t	ipAdEntRetransmitTime;  /* ipInterfaceRetransmitTime */
} mib2_ipAddrEntry_t;
#define	MIB_FIRST_NEW_ELM_mib2_ipAddrEntry_t	ipAdEntRetransmitTime

/*
 *	ipv6AddrTable OBJECT-TYPE
 *		SYNTAX      SEQUENCE OF Ipv6AddrEntry
 *		MAX-ACCESS  not-accessible
 *		STATUS      current
 *		DESCRIPTION
 *			"The table of addressing information relevant to
 *			this node's interface addresses."
 *		::= { ipv6MIBObjects 8 }
 */

typedef struct mib2_ipv6AddrEntry {
	/* Unique interface index			{ Part of INDEX } */
	DeviceName	ipv6AddrIfIndex;

	/* IPv6 address of this entry			{ ipv6AddrEntry 1 } */
	Ip6Address	ipv6AddrAddress;
	/* Prefix length				{ ipv6AddrEntry 2 } */
	uint_t		ipv6AddrPfxLength;
	/* Type: stateless(1), stateful(2), unknown(3)	{ ipv6AddrEntry 3 } */
	uint_t		ipv6AddrType;
	/* Anycast: true(1), false(2)			{ ipv6AddrEntry 4 } */
	uint_t		ipv6AddrAnycastFlag;
	/*
	 * Address status: preferred(1), deprecated(2), invalid(3),
	 * inaccessible(4), unknown(5)			{ ipv6AddrEntry 5 }
	 */
	uint_t		ipv6AddrStatus;
	struct ipv6AddrInfo_s {
		Gauge		ae_mtu;
				/* BSD if metric */
		int		ae_metric;
				/* point-point dest addr */
		Ip6Address	ae_pp_dst_addr;
		int		ae_flags;	/* IFF_* flags in if.h */
		Counter		ae_ibcnt;	/* Inbound packets */
		Counter		ae_obcnt;	/* Outbound packets */
		Counter		ae_focnt;	/* Forwarded packets */
		Ip6Address	ae_subnet;	/* Subnet prefix */
		int		ae_subnet_len;	/* Subnet prefix length */
		Ip6Address	ae_src_addr;	/* Source address */
	}		ipv6AddrInfo;
	uint32_t	ipv6AddrReasmMaxSize;	/* InterfaceReasmMaxSize */
	Ip6Address	ipv6AddrIdentifier;	/* InterfaceIdentifier */
	uint32_t	ipv6AddrIdentifierLen;
	uint32_t	ipv6AddrReachableTime;	/* InterfaceReachableTime */
	uint32_t	ipv6AddrRetransmitTime; /* InterfaceRetransmitTime */
} mib2_ipv6AddrEntry_t;
#define	MIB_FIRST_NEW_ELM_mib2_ipv6AddrEntry_t	ipv6AddrReasmMaxSize

/*
 * The IP routing table contains an entry for each route presently known to
 * this entity. (for IPv4 routes)
 *
 *	ipRouteTable OBJECT-TYPE
 *		SYNTAX  SEQUENCE OF IpRouteEntry
 *		ACCESS  not-accessible
 *		STATUS  mandatory
 *		DESCRIPTION
 *			"This entity's IP Routing table."
 *		::= { ip 21 }
 */

typedef struct mib2_ipRouteEntry {
		/* dest ip addr for this route		{ipRouteEntry 1 } RW */
	IpAddress	ipRouteDest;
		/* unique interface index for this hop	{ipRouteEntry 2 } RW */
	DeviceName	ipRouteIfIndex;
		/* primary route metric			{ipRouteEntry 3 } RW */
	int		ipRouteMetric1;
		/* alternate route metric		{ipRouteEntry 4 } RW */
	int		ipRouteMetric2;
		/* alternate route metric		{ipRouteEntry 5 } RW */
	int		ipRouteMetric3;
		/* alternate route metric		{ipRouteEntry 6 } RW */
	int		ipRouteMetric4;
		/* ip addr of next hop on this route	{ipRouteEntry 7 } RW */
	IpAddress	ipRouteNextHop;
		/* other(1), inval(2), dir(3), indir(4)	{ipRouteEntry 8 } RW */
	int		ipRouteType;
		/* mechanism by which route was learned	{ipRouteEntry 9 } */
	int		ipRouteProto;
		/* sec's since last update of route	{ipRouteEntry 10} RW */
	int		ipRouteAge;
		/*					{ipRouteEntry 11} RW */
	IpAddress	ipRouteMask;
		/* alternate route metric		{ipRouteEntry 12} RW */
	int		ipRouteMetric5;
		/* additional info from ire's		{ipRouteEntry 13 } */
	struct ipRouteInfo_s {
		Gauge		re_max_frag;
		Gauge		re_rtt;
		Counter		re_ref;
		int		re_frag_flag;
		IpAddress	re_src_addr;
		int		re_ire_type;
		Counter		re_obpkt;
		Counter		re_ibpkt;
		int		re_flags;
		/*
		 * The following two elements (re_in_ill and re_in_src_addr)
		 * are no longer used but are left here for the benefit of
		 * old Apps that won't be able to handle the change in the
		 * size of this struct. These elements will always be
		 * set to zeroes.
		 */
		DeviceName	re_in_ill;	/* Input interface */
		IpAddress	re_in_src_addr;	/* Input source address */
	}		ipRouteInfo;
} mib2_ipRouteEntry_t;

/*
 * The IPv6 routing table contains an entry for each route presently known to
 * this entity.
 *
 *	ipv6RouteTable OBJECT-TYPE
 *		SYNTAX  SEQUENCE OF IpRouteEntry
 *		ACCESS  not-accessible
 *		STATUS  current
 *		DESCRIPTION
 *			"IPv6 Routing table. This table contains
 *			an entry for each valid IPv6 unicast route
 *			that can be used for packet forwarding
 *			determination."
 *		::= { ipv6MIBObjects 11 }
 */

typedef struct mib2_ipv6RouteEntry {
		/* dest ip addr for this route		{ ipv6RouteEntry 1 } */
	Ip6Address	ipv6RouteDest;
		/* prefix length			{ ipv6RouteEntry 2 } */
	int		ipv6RoutePfxLength;
		/* unique route index			{ ipv6RouteEntry 3 } */
	unsigned	ipv6RouteIndex;
		/* unique interface index for this hop	{ ipv6RouteEntry 4 } */
	DeviceName	ipv6RouteIfIndex;
		/* IPv6 addr of next hop on this route	{ ipv6RouteEntry 5 } */
	Ip6Address	ipv6RouteNextHop;
		/* other(1), discard(2), local(3), remote(4) */
		/*					{ ipv6RouteEntry 6 } */
	int		ipv6RouteType;
		/* mechanism by which route was learned	{ ipv6RouteEntry 7 } */
		/*
		 * other(1), local(2), netmgmt(3), ndisc(4), rip(5), ospf(6),
		 * bgp(7), idrp(8), igrp(9)
		 */
	int		ipv6RouteProtocol;
		/* policy hook or traffic class		{ ipv6RouteEntry 8 } */
	unsigned	ipv6RoutePolicy;
		/* sec's since last update of route	{ ipv6RouteEntry 9} */
	int		ipv6RouteAge;
		/* Routing domain ID of the next hop	{ ipv6RouteEntry 10 } */
	unsigned	ipv6RouteNextHopRDI;
		/* route metric				{ ipv6RouteEntry 11 } */
	unsigned	ipv6RouteMetric;
		/* preference (impl specific)		{ ipv6RouteEntry 12 } */
	unsigned	ipv6RouteWeight;
		/* additional info from ire's		{ } */
	struct ipv6RouteInfo_s {
		Gauge		re_max_frag;
		Gauge		re_rtt;
		Counter		re_ref;
		int		re_frag_flag;
		Ip6Address	re_src_addr;
		int		re_ire_type;
		Counter		re_obpkt;
		Counter		re_ibpkt;
		int		re_flags;
	}		ipv6RouteInfo;
} mib2_ipv6RouteEntry_t;

/*
 * The IPv4 and IPv6 routing table entries on a trusted system also have
 * security attributes in the form of label ranges.  This experimental
 * interface provides information about these labels.
 *
 * Each entry in this table contains a label range and an index that refers
 * back to the entry in the routing table to which it applies.  There may be 0,
 * 1, or many label ranges for each routing table entry.
 *
 * (opthdr.level is set to MIB2_IP for IPv4 entries and MIB2_IP6 for IPv6.
 * opthdr.name is set to EXPER_IP_GWATTR.)
 *
 *	ipRouteAttributeTable OBJECT-TYPE
 *		SYNTAX  SEQUENCE OF IpAttributeEntry
 *		ACCESS  not-accessible
 *		STATUS  current
 *		DESCRIPTION
 *			"IPv4 routing attributes table.  This table contains
 *			an entry for each valid trusted label attached to a
 *			route in the system."
 *		::= { ip 102 }
 *
 *	ipv6RouteAttributeTable OBJECT-TYPE
 *		SYNTAX  SEQUENCE OF IpAttributeEntry
 *		ACCESS  not-accessible
 *		STATUS  current
 *		DESCRIPTION
 *			"IPv6 routing attributes table.  This table contains
 *			an entry for each valid trusted label attached to a
 *			route in the system."
 *		::= { ip6 102 }
 */

typedef struct mib2_ipAttributeEntry {
	uint_t		iae_routeidx;
	int		iae_doi;
	brange_t	iae_slrange;
} mib2_ipAttributeEntry_t;

/*
 * The IP address translation table contain the IpAddress to
 * `physical' address equivalences.  Some interfaces do not
 * use translation tables for determining address
 * equivalences (e.g., DDN-X.25 has an algorithmic method);
 * if all interfaces are of this type, then the Address
 * Translation table is empty, i.e., has zero entries.
 *
 *	ipNetToMediaTable OBJECT-TYPE
 *		SYNTAX  SEQUENCE OF IpNetToMediaEntry
 *		ACCESS  not-accessible
 *		STATUS  mandatory
 *		DESCRIPTION
 *			"The IP Address Translation table used for mapping
 *			from IP addresses to physical addresses."
 *		::= { ip 22 }
 */

typedef struct mib2_ipNetToMediaEntry {
	/* Unique interface index		{ ipNetToMediaEntry 1 } RW */
	DeviceName	ipNetToMediaIfIndex;
	/* Media dependent physical addr	{ ipNetToMediaEntry 2 } RW */
	PhysAddress	ipNetToMediaPhysAddress;
	/* ip addr for this physical addr	{ ipNetToMediaEntry 3 } RW */
	IpAddress	ipNetToMediaNetAddress;
	/* other(1), inval(2), dyn(3), stat(4)	{ ipNetToMediaEntry 4 } RW */
	int		ipNetToMediaType;
	struct ipNetToMediaInfo_s {
		PhysAddress	ntm_mask;	/* subnet mask for entry */
		int		ntm_flags;	/* ACE_F_* flags in arp.h */
	}		ipNetToMediaInfo;
} mib2_ipNetToMediaEntry_t;

/*
 *	ipv6NetToMediaTable OBJECT-TYPE
 *		 SYNTAX      SEQUENCE OF Ipv6NetToMediaEntry
 *		 MAX-ACCESS  not-accessible
 *		 STATUS      current
 *		 DESCRIPTION
 *			"The IPv6 Address Translation table used for
 *			mapping from IPv6 addresses to physical addresses.
 *
 *			The IPv6 address translation table contain the
 *			Ipv6Address to `physical' address equivalencies.
 *			Some interfaces do not use translation tables
 *			for determining address equivalencies; if all
 *			interfaces are of this type, then the Address
 *			Translation table is empty, i.e., has zero
 *			entries."
 *		::= { ipv6MIBObjects 12 }
 */

typedef struct mib2_ipv6NetToMediaEntry {
	/* Unique interface index		{ Part of INDEX } */
	DeviceIndex	ipv6NetToMediaIfIndex;

	/* ip addr for this physical addr	{ ipv6NetToMediaEntry 1 } */
	Ip6Address	ipv6NetToMediaNetAddress;
	/* Media dependent physical addr	{ ipv6NetToMediaEntry 2 } */
	PhysAddress	ipv6NetToMediaPhysAddress;
	/*
	 * Type of mapping
	 * other(1), dynamic(2), static(3), local(4)
	 *					{ ipv6NetToMediaEntry 3 }
	 */
	int		ipv6NetToMediaType;
	/*
	 * NUD state
	 * reachable(1), stale(2), delay(3), probe(4), invalid(5), unknown(6)
	 * Note: The kernel returns ND_* states.
	 *					{ ipv6NetToMediaEntry 4 }
	 */
	int		ipv6NetToMediaState;
	/* sysUpTime last time entry was updated { ipv6NetToMediaEntry 5 } */
	int		ipv6NetToMediaLastUpdated;
} mib2_ipv6NetToMediaEntry_t;


/*
 * List of group members per interface
 */
typedef struct ip_member {
	/* Interface index */
	DeviceName	ipGroupMemberIfIndex;
	/* IP Multicast address */
	IpAddress	ipGroupMemberAddress;
	/* Number of member sockets */
	Counter		ipGroupMemberRefCnt;
	/* Filter mode: 1 => include, 2 => exclude */
	int		ipGroupMemberFilterMode;
} ip_member_t;


/*
 * List of IPv6 group members per interface
 */
typedef struct ipv6_member {
	/* Interface index */
	DeviceIndex	ipv6GroupMemberIfIndex;
	/* IP Multicast address */
	Ip6Address	ipv6GroupMemberAddress;
	/* Number of member sockets */
	Counter		ipv6GroupMemberRefCnt;
	/* Filter mode: 1 => include, 2 => exclude */
	int		ipv6GroupMemberFilterMode;
} ipv6_member_t;

/*
 * This is used to mark transport layer entities (e.g., TCP connections) that
 * are capable of receiving packets from a range of labels.  'level' is set to
 * the protocol of interest (e.g., MIB2_TCP), and 'name' is set to
 * EXPER_XPORT_MLP.  The tme_connidx refers back to the entry in MIB2_TCP_CONN,
 * MIB2_TCP6_CONN, or MIB2_SCTP_CONN.
 *
 * It is also used to report connections that receive packets at a single label
 * that's other than the zone's label.  This is the case when a TCP connection
 * is accepted from a particular peer using an MLP listener.
 */
typedef struct mib2_transportMLPEntry {
	uint_t		tme_connidx;
	uint_t		tme_flags;
	int		tme_doi;
	bslabel_t	tme_label;
} mib2_transportMLPEntry_t;

/*
 * This is not part of mib2 but is used to communicate additional information
 * about a socket alongside the mib2 data. This is used by netstat to
 * associate sockets with processes that are connected to them.
 */

#define	MIB2_SOCKINFO_STREAM	0x1
#define	MIB2_SOCKINFO_IPV6	0x2	/* IPV6 entry in an IPv4 table */

typedef struct mib2_socketInfoEntry {
	uint64_t	sie_connidx;
	uint64_t	sie_inode;
	uint64_t	sie_flags;
	uint64_t	sie_dev;
} mib2_socketInfoEntry_t;

#define	MIB2_TMEF_PRIVATE	0x00000001	/* MLP on private addresses */
#define	MIB2_TMEF_SHARED	0x00000002	/* MLP on shared addresses */
#define	MIB2_TMEF_ANONMLP	0x00000004	/* Anonymous MLP port */
#define	MIB2_TMEF_MACEXEMPT	0x00000008	/* MAC-Exempt port */
#define	MIB2_TMEF_IS_LABELED	0x00000010	/* tme_doi & tme_label exists */
#define	MIB2_TMEF_MACIMPLICIT	0x00000020	/* MAC-Implicit */
/*
 * List of IPv4 source addresses being filtered per interface
 */
typedef struct ip_grpsrc {
	/* Interface index */
	DeviceName	ipGroupSourceIfIndex;
	/* IP Multicast address */
	IpAddress	ipGroupSourceGroup;
	/* IP Source address */
	IpAddress	ipGroupSourceAddress;
} ip_grpsrc_t;


/*
 * List of IPv6 source addresses being filtered per interface
 */
typedef struct ipv6_grpsrc {
	/* Interface index */
	DeviceIndex	ipv6GroupSourceIfIndex;
	/* IP Multicast address */
	Ip6Address	ipv6GroupSourceGroup;
	/* IP Source address */
	Ip6Address	ipv6GroupSourceAddress;
} ipv6_grpsrc_t;


/*
 * List of destination cache entries
 */
typedef struct dest_cache_entry {
	/* IP Multicast address */
	IpAddress	DestIpv4Address;
	Ip6Address	DestIpv6Address;
	uint_t		DestFlags;	/* DCEF_* */
	uint32_t	DestPmtu;	/* Path MTU if DCEF_PMTU */
	uint32_t	DestIdent;	/* Per destination IP ident. */
	DeviceIndex	DestIfindex;	/* For IPv6 link-locals */
	uint32_t	DestAge;	/* Age of MTU info in seconds */
} dest_cache_entry_t;


/*
 * ICMP Group
 */
typedef struct mib2_icmp {
	/* total # of recv'd ICMP msgs			{ icmp 1 } */
	Counter	icmpInMsgs;
	/* recv'd ICMP msgs with errors			{ icmp 2 } */
	Counter	icmpInErrors;
	/* recv'd "dest unreachable" msg's		{ icmp 3 } */
	Counter	icmpInDestUnreachs;
	/* recv'd "time exceeded" msg's			{ icmp 4 } */
	Counter	icmpInTimeExcds;
	/* recv'd "parameter problem" msg's		{ icmp 5 } */
	Counter	icmpInParmProbs;
	/* recv'd "source quench" msg's			{ icmp 6 } */
	Counter	icmpInSrcQuenchs;
	/* recv'd "ICMP redirect" msg's			{ icmp 7 } */
	Counter	icmpInRedirects;
	/* recv'd "echo request" msg's			{ icmp 8 } */
	Counter	icmpInEchos;
	/* recv'd "echo reply" msg's			{ icmp 9 } */
	Counter	icmpInEchoReps;
	/* recv'd "timestamp" msg's			{ icmp 10 } */
	Counter	icmpInTimestamps;
	/* recv'd "timestamp reply" msg's		{ icmp 11 } */
	Counter	icmpInTimestampReps;
	/* recv'd "address mask request" msg's		{ icmp 12 } */
	Counter	icmpInAddrMasks;
	/* recv'd "address mask reply" msg's		{ icmp 13 } */
	Counter	icmpInAddrMaskReps;
	/* total # of sent ICMP msg's			{ icmp 14 } */
	Counter	icmpOutMsgs;
	/* # of msg's not sent for internal icmp errors	{ icmp 15 } */
	Counter	icmpOutErrors;
	/* # of "dest unreachable" msg's sent		{ icmp 16 } */
	Counter	icmpOutDestUnreachs;
	/* # of "time exceeded" msg's sent		{ icmp 17 } */
	Counter	icmpOutTimeExcds;
	/* # of "parameter problme" msg's sent		{ icmp 18 } */
	Counter	icmpOutParmProbs;
	/* # of "source quench" msg's sent		{ icmp 19 } */
	Counter	icmpOutSrcQuenchs;
	/* # of "ICMP redirect" msg's sent		{ icmp 20 } */
	Counter	icmpOutRedirects;
	/* # of "Echo request" msg's sent		{ icmp 21 } */
	Counter	icmpOutEchos;
	/* # of "Echo reply" msg's sent			{ icmp 22 } */
	Counter	icmpOutEchoReps;
	/* # of "timestamp request" msg's sent		{ icmp 23 } */
	Counter	icmpOutTimestamps;
	/* # of "timestamp reply" msg's sent		{ icmp 24 } */
	Counter	icmpOutTimestampReps;
	/* # of "address mask request" msg's sent	{ icmp 25 } */
	Counter	icmpOutAddrMasks;
	/* # of "address mask reply" msg's sent		{ icmp 26 } */
	Counter	icmpOutAddrMaskReps;
/*
 * In addition to MIB-II
 */
	/* # of received packets with checksum errors */
	Counter	icmpInCksumErrs;
	/* # of received packets with unknow codes */
	Counter	icmpInUnknowns;
	/* # of received unreachables with "fragmentation needed" */
	Counter	icmpInFragNeeded;
	/* # of sent unreachables with "fragmentation needed" */
	Counter	icmpOutFragNeeded;
	/*
	 * # of msg's not sent since original packet was broadcast/multicast
	 * or an ICMP error packet
	 */
	Counter	icmpOutDrops;
	/* # of ICMP packets droped due to queue overflow */
	Counter icmpInOverflows;
	/* recv'd "ICMP redirect" msg's	that are bad thus ignored */
	Counter	icmpInBadRedirects;
} mib2_icmp_t;


/*
 *	ipv6IfIcmpEntry OBJECT-TYPE
 *		SYNTAX      Ipv6IfIcmpEntry
 *		MAX-ACCESS  not-accessible
 *		STATUS      current
 *		DESCRIPTION
 *			"An ICMPv6 statistics entry containing
 *			objects at a particular IPv6 interface.
 *
 *			Note that a receiving interface is
 *			the interface to which a given ICMPv6 message
 *			is addressed which may not be necessarily
 *			the input interface for the message.
 *
 *			Similarly, the sending interface is
 *			the interface that sources a given
 *			ICMP message which is usually but not
 *			necessarily the output interface for the message."
 *		AUGMENTS { ipv6IfEntry }
 *		::= { ipv6IfIcmpTable 1 }
 *
 * Per-interface ICMPv6 statistics table
 */

typedef struct mib2_ipv6IfIcmpEntry {
	/* Local ifindex to identify the interface */
	DeviceIndex	ipv6IfIcmpIfIndex;

	int		ipv6IfIcmpEntrySize;	/* Size of ipv6IfIcmpEntry */

	/* The total # ICMP msgs rcvd includes ipv6IfIcmpInErrors */
	Counter32	ipv6IfIcmpInMsgs;
	/* # ICMP with ICMP-specific errors (bad checkum, length, etc) */
	Counter32	ipv6IfIcmpInErrors;
	/* # ICMP Destination Unreachable */
	Counter32	ipv6IfIcmpInDestUnreachs;
	/* # ICMP destination unreachable/communication admin prohibited */
	Counter32	ipv6IfIcmpInAdminProhibs;
	Counter32	ipv6IfIcmpInTimeExcds;
	Counter32	ipv6IfIcmpInParmProblems;
	Counter32	ipv6IfIcmpInPktTooBigs;
	Counter32	ipv6IfIcmpInEchos;
	Counter32	ipv6IfIcmpInEchoReplies;
	Counter32	ipv6IfIcmpInRouterSolicits;
	Counter32	ipv6IfIcmpInRouterAdvertisements;
	Counter32	ipv6IfIcmpInNeighborSolicits;
	Counter32	ipv6IfIcmpInNeighborAdvertisements;
	Counter32	ipv6IfIcmpInRedirects;
	Counter32	ipv6IfIcmpInGroupMembQueries;
	Counter32	ipv6IfIcmpInGroupMembResponses;
	Counter32	ipv6IfIcmpInGroupMembReductions;
	/* Total # ICMP messages attempted to send (includes OutErrors) */
	Counter32	ipv6IfIcmpOutMsgs;
	/* # ICMP messages not sent due to ICMP problems (e.g. no buffers) */
	Counter32	ipv6IfIcmpOutErrors;
	Counter32	ipv6IfIcmpOutDestUnreachs;
	Counter32	ipv6IfIcmpOutAdminProhibs;
	Counter32	ipv6IfIcmpOutTimeExcds;
	Counter32	ipv6IfIcmpOutParmProblems;
	Counter32	ipv6IfIcmpOutPktTooBigs;
	Counter32	ipv6IfIcmpOutEchos;
	Counter32	ipv6IfIcmpOutEchoReplies;
	Counter32	ipv6IfIcmpOutRouterSolicits;
	Counter32	ipv6IfIcmpOutRouterAdvertisements;
	Counter32	ipv6IfIcmpOutNeighborSolicits;
	Counter32	ipv6IfIcmpOutNeighborAdvertisements;
	Counter32	ipv6IfIcmpOutRedirects;
	Counter32	ipv6IfIcmpOutGroupMembQueries;
	Counter32	ipv6IfIcmpOutGroupMembResponses;
	Counter32	ipv6IfIcmpOutGroupMembReductions;
/* Additions beyond the MIB */
	Counter32	ipv6IfIcmpInOverflows;
	/* recv'd "ICMPv6 redirect" msg's that are bad thus ignored */
	Counter32	ipv6IfIcmpBadHoplimit;
	Counter32	ipv6IfIcmpInBadNeighborAdvertisements;
	Counter32	ipv6IfIcmpInBadNeighborSolicitations;
	Counter32	ipv6IfIcmpInBadRedirects;
	Counter32	ipv6IfIcmpInGroupMembTotal;
	Counter32	ipv6IfIcmpInGroupMembBadQueries;
	Counter32	ipv6IfIcmpInGroupMembBadReports;
	Counter32	ipv6IfIcmpInGroupMembOurReports;
} mib2_ipv6IfIcmpEntry_t;

/*
 * the TCP group
 *
 * Note that instances of object types that represent
 * information about a particular TCP connection are
 * transient; they persist only as long as the connection
 * in question.
 */
#define	MIB2_TCP_CONN	13	/* tcpConnEntry */
#define	MIB2_TCP6_CONN	14	/* tcp6ConnEntry */

/* Old name retained for compatibility */
#define	MIB2_TCP_13	MIB2_TCP_CONN

/* Pack data in mib2_tcp to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif
typedef struct mib2_tcp {
		/* algorithm used for transmit timeout value	{ tcp 1 } */
	int	tcpRtoAlgorithm;
		/* minimum retransmit timeout (ms)		{ tcp 2 } */
	int	tcpRtoMin;
		/* maximum retransmit timeout (ms)		{ tcp 3 } */
	int	tcpRtoMax;
		/* maximum # of connections supported		{ tcp 4 } */
	int	tcpMaxConn;
		/* # of direct transitions CLOSED -> SYN-SENT	{ tcp 5 } */
	Counter	tcpActiveOpens;
		/* # of direct transitions LISTEN -> SYN-RCVD	{ tcp 6 } */
	Counter	tcpPassiveOpens;
		/* # of direct SIN-SENT/RCVD -> CLOSED/LISTEN	{ tcp 7 } */
	Counter	tcpAttemptFails;
		/* # of direct ESTABLISHED/CLOSE-WAIT -> CLOSED	{ tcp 8 } */
	Counter	tcpEstabResets;
		/* # of connections ESTABLISHED or CLOSE-WAIT	{ tcp 9 } */
	Gauge	tcpCurrEstab;
		/* total # of segments recv'd			{ tcp 10 } */
	Counter	tcpInSegs;
		/* total # of segments sent			{ tcp 11 } */
	Counter	tcpOutSegs;
		/* total # of segments retransmitted		{ tcp 12 } */
	Counter	tcpRetransSegs;
		/* {tcp 13} */
	int	tcpConnTableSize;	/* Size of tcpConnEntry_t */
	/* in ip				{tcp 14} */
		/* # of segments sent with RST flag		{ tcp 15 } */
	Counter	tcpOutRsts;
/* In addition to MIB-II */
/* Sender */
	/* total # of data segments sent */
	Counter tcpOutDataSegs;
	/* total # of bytes in data segments sent */
	Counter tcpOutDataBytes;
	/* total # of bytes in segments retransmitted */
	Counter tcpRetransBytes;
	/* total # of acks sent */
	Counter tcpOutAck;
	/* total # of delayed acks sent */
	Counter tcpOutAckDelayed;
	/* total # of segments sent with the urg flag on */
	Counter tcpOutUrg;
	/* total # of window updates sent */
	Counter tcpOutWinUpdate;
	/* total # of zero window probes sent */
	Counter tcpOutWinProbe;
	/* total # of control segments sent (syn, fin, rst) */
	Counter tcpOutControl;
	/* total # of segments sent due to "fast retransmit" */
	Counter tcpOutFastRetrans;
/* Receiver */
	/* total # of ack segments received */
	Counter tcpInAckSegs;
	/* total # of bytes acked */
	Counter tcpInAckBytes;
	/* total # of duplicate acks */
	Counter tcpInDupAck;
	/* total # of acks acking unsent data */
	Counter tcpInAckUnsent;
	/* total # of data segments received in order */
	Counter tcpInDataInorderSegs;
	/* total # of data bytes received in order */
	Counter tcpInDataInorderBytes;
	/* total # of data segments received out of order */
	Counter tcpInDataUnorderSegs;
	/* total # of data bytes received out of order */
	Counter tcpInDataUnorderBytes;
	/* total # of complete duplicate data segments received */
	Counter tcpInDataDupSegs;
	/* total # of bytes in the complete duplicate data segments received */
	Counter tcpInDataDupBytes;
	/* total # of partial duplicate data segments received */
	Counter tcpInDataPartDupSegs;
	/* total # of bytes in the partial duplicate data segments received */
	Counter tcpInDataPartDupBytes;
	/* total # of data segments received past the window */
	Counter tcpInDataPastWinSegs;
	/* total # of data bytes received part the window */
	Counter tcpInDataPastWinBytes;
	/* total # of zero window probes received */
	Counter tcpInWinProbe;
	/* total # of window updates received */
	Counter tcpInWinUpdate;
	/* total # of data segments received after the connection has closed */
	Counter tcpInClosed;
/* Others */
	/* total # of failed attempts to update the rtt estimate */
	Counter tcpRttNoUpdate;
	/* total # of successful attempts to update the rtt estimate */
	Counter tcpRttUpdate;
	/* total # of retransmit timeouts */
	Counter tcpTimRetrans;
	/* total # of retransmit timeouts dropping the connection */
	Counter tcpTimRetransDrop;
	/* total # of keepalive timeouts */
	Counter tcpTimKeepalive;
	/* total # of keepalive timeouts sending a probe */
	Counter tcpTimKeepaliveProbe;
	/* total # of keepalive timeouts dropping the connection */
	Counter tcpTimKeepaliveDrop;
	/* total # of connections refused due to backlog full on listen */
	Counter tcpListenDrop;
	/* total # of connections refused due to half-open queue (q0) full */
	Counter tcpListenDropQ0;
	/* total # of connections dropped from a full half-open queue (q0) */
	Counter tcpHalfOpenDrop;
	/* total # of retransmitted segments by SACK retransmission */
	Counter	tcpOutSackRetransSegs;

	int	tcp6ConnTableSize;	/* Size of tcp6ConnEntry_t */

	/*
	 * fields from RFC 4022
	 */

	/* total # of segments recv'd				{ tcp 17 } */
	Counter64	tcpHCInSegs;
	/* total # of segments sent				{ tcp 18 } */
	Counter64	tcpHCOutSegs;
} mib2_tcp_t;
#define	MIB_FIRST_NEW_ELM_mib2_tcp_t	tcpHCInSegs

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif

/*
 * The TCP/IPv4 connection table {tcp 13} contains information about this
 * entity's existing TCP connections over IPv4.
 */
/* For tcpConnState and tcp6ConnState */
#define	MIB2_TCP_closed		1
#define	MIB2_TCP_listen		2
#define	MIB2_TCP_synSent	3
#define	MIB2_TCP_synReceived	4
#define	MIB2_TCP_established	5
#define	MIB2_TCP_finWait1	6
#define	MIB2_TCP_finWait2	7
#define	MIB2_TCP_closeWait	8
#define	MIB2_TCP_lastAck	9
#define	MIB2_TCP_closing	10
#define	MIB2_TCP_timeWait	11
#define	MIB2_TCP_deleteTCB	12		/* only writeable value */

/* Pack data to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif

typedef struct tcpConnEntryInfo_s {
	Counter64	ce_in_data_inorder_bytes;
	Counter64	ce_in_data_inorder_segs;
	Counter64	ce_in_data_unorder_bytes;
	Counter64	ce_in_data_unorder_segs;
	Counter64	ce_in_zwnd_probes;

	Counter64	ce_out_data_bytes;
	Counter64	ce_out_data_segs;
	Counter64	ce_out_retrans_bytes;
	Counter64	ce_out_retrans_segs;
	Counter64	ce_out_zwnd_probes;
	Counter64	ce_rtt_sum;

			/* seq # of next segment to send */
	Gauge		ce_snxt;
			/* seq # of of last segment unacknowledged */
	Gauge		ce_suna;
			/* current send window size */
	Gauge		ce_swnd;
			/* current congestion window size */
	Gauge		ce_cwnd;
			/* seq # of next expected segment */
	Gauge		ce_rnxt;
			/* seq # of last ack'd segment */
	Gauge		ce_rack;
			/* # of unsent bytes in the xmit queue */
	Gauge		ce_unsent;
			/* current receive window size */
	Gauge		ce_rwnd;
			/* round-trip time smoothed average (us) */
	Gauge		ce_rtt_sa;
			/* current rto (retransmit timeout) */
	Gauge		ce_rto;
			/* round-trip time count */
	Gauge		ce_rtt_cnt;
			/* current max segment size */
	Gauge		ce_mss;
			/* actual internal state */
	int		ce_state;
} tcpConnEntryInfo_t;

typedef struct mib2_tcpConnEntry {
		/* state of tcp connection		{ tcpConnEntry 1} RW */
	int		tcpConnState;
		/* local ip addr for this connection	{ tcpConnEntry 2 } */
	IpAddress	tcpConnLocalAddress;
		/* local port for this connection	{ tcpConnEntry 3 } */
	int		tcpConnLocalPort;	/* In host byte order */
		/* remote ip addr for this connection	{ tcpConnEntry 4 } */
	IpAddress	tcpConnRemAddress;
		/* remote port for this connection	{ tcpConnEntry 5 } */
	int		tcpConnRemPort;		/* In host byte order */
	tcpConnEntryInfo_t tcpConnEntryInfo;

	/* pid of the processes that created this connection */
	uint32_t	tcpConnCreationProcess;
	/* system uptime when the connection was created */
	uint64_t	tcpConnCreationTime;
} mib2_tcpConnEntry_t;
#define	MIB_FIRST_NEW_ELM_mib2_tcpConnEntry_t	tcpConnCreationProcess

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif


/*
 * The TCP/IPv6 connection table {tcp 14} contains information about this
 * entity's existing TCP connections over IPv6.
 */

/* Pack data to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif
typedef struct mib2_tcp6ConnEntry {
	/* local ip addr for this connection	{ ipv6TcpConnEntry 1 } */
	Ip6Address	tcp6ConnLocalAddress;
	/* local port for this connection	{ ipv6TcpConnEntry 2 } */
	int		tcp6ConnLocalPort;
	/* remote ip addr for this connection	{ ipv6TcpConnEntry 3 } */
	Ip6Address	tcp6ConnRemAddress;
	/* remote port for this connection	{ ipv6TcpConnEntry 4 } */
	int		tcp6ConnRemPort;
	/* interface index or zero		{ ipv6TcpConnEntry 5 } */
	DeviceIndex	tcp6ConnIfIndex;
	/* state of tcp6 connection		{ ipv6TcpConnEntry 6 } RW */
	int		tcp6ConnState;
	tcpConnEntryInfo_t tcp6ConnEntryInfo;

	/* pid of the processes that created this connection */
	uint32_t	tcp6ConnCreationProcess;
	/* system uptime when the connection was created */
	uint64_t	tcp6ConnCreationTime;
} mib2_tcp6ConnEntry_t;
#define	MIB_FIRST_NEW_ELM_mib2_tcp6ConnEntry_t	tcp6ConnCreationProcess

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif

/*
 * the UDP group
 */
#define	MIB2_UDP_ENTRY	5	/* udpEntry */
#define	MIB2_UDP6_ENTRY	6	/* udp6Entry */

/* Old name retained for compatibility */
#define	MIB2_UDP_5	MIB2_UDP_ENTRY

/* Pack data to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif
typedef struct mib2_udp {
		/* total # of UDP datagrams sent upstream	{ udp 1 } */
	Counter	udpInDatagrams;
	/* in ip				{ udp 2 } */
		/* # of recv'd dg's not deliverable (other)	{ udp 3 }  */
	Counter	udpInErrors;
		/* total # of dg's sent				{ udp 4 } */
	Counter	udpOutDatagrams;
		/* { udp 5 } */
	int	udpEntrySize;			/* Size of udpEntry_t */
	int	udp6EntrySize;			/* Size of udp6Entry_t */
	Counter	udpOutErrors;

	/*
	 * fields from RFC 4113
	 */

	/* total # of UDP datagrams sent upstream		{ udp 8 } */
	Counter64	udpHCInDatagrams;
	/* total # of dg's sent					{ udp 9 } */
	Counter64	udpHCOutDatagrams;
} mib2_udp_t;
#define	MIB_FIRST_NEW_ELM_mib2_udp_t	udpHCInDatagrams

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif

/*
 * The UDP listener table contains information about this entity's UDP
 * end-points on which a local application is currently accepting datagrams.
 */

/* For both IPv4 and IPv6 ue_state: */
#define	MIB2_UDP_unbound	1
#define	MIB2_UDP_idle		2
#define	MIB2_UDP_connected	3
#define	MIB2_UDP_unknown	4

/* Pack data to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif
typedef struct mib2_udpEntry {
		/* local ip addr of listener		{ udpEntry 1 } */
	IpAddress	udpLocalAddress;
		/* local port of listener		{ udpEntry 2 } */
	int		udpLocalPort;		/* In host byte order */
	struct udpEntryInfo_s {
		int		ue_state;
		IpAddress	ue_RemoteAddress;
		int		ue_RemotePort;	/* In host byte order */
	}		udpEntryInfo;

	/*
	 * RFC 4113
	 */

	/* Unique id for this 4-tuple		{ udpEndpointEntry 7 } */
	uint32_t	udpInstance;
	/* pid of the processes that created this endpoint */
	uint32_t	udpCreationProcess;
	/* system uptime when the endpoint was created */
	uint64_t	udpCreationTime;
} mib2_udpEntry_t;
#define	MIB_FIRST_NEW_ELM_mib2_udpEntry_t	udpInstance

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif

/*
 * The UDP (for IPv6) listener table contains information about this
 * entity's UDP end-points on which a local application is
 * currently accepting datagrams.
 */

/* Pack data to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif
typedef	struct mib2_udp6Entry {
		/* local ip addr of listener		{ ipv6UdpEntry 1 } */
	Ip6Address	udp6LocalAddress;
		/* local port of listener		{ ipv6UdpEntry 2 } */
	int		udp6LocalPort;		/* In host byte order */
		/* interface index or zero		{ ipv6UdpEntry 3 } */
	DeviceIndex	udp6IfIndex;
	struct udp6EntryInfo_s {
		int	ue_state;
		Ip6Address	ue_RemoteAddress;
		int		ue_RemotePort;	/* In host byte order */
	}		udp6EntryInfo;

	/*
	 * RFC 4113
	 */

	/* Unique id for this 4-tuple		{ udpEndpointEntry 7 } */
	uint32_t	udp6Instance;
	/* pid of the processes that created this endpoint */
	uint32_t	udp6CreationProcess;
	/* system uptime when the endpoint was created */
	uint64_t	udp6CreationTime;
} mib2_udp6Entry_t;
#define	MIB_FIRST_NEW_ELM_mib2_udp6Entry_t	udp6Instance

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif

/*
 * the RAWIP group
 */
typedef struct mib2_rawip {
		/* total # of RAWIP datagrams sent upstream */
	Counter	rawipInDatagrams;
		/* # of RAWIP packets with bad IPV6_CHECKSUM checksums */
	Counter rawipInCksumErrs;
		/* # of recv'd dg's not deliverable (other) */
	Counter	rawipInErrors;
		/* total # of dg's sent */
	Counter	rawipOutDatagrams;
		/* total # of dg's not sent (e.g. no memory) */
	Counter	rawipOutErrors;
} mib2_rawip_t;

/* DVMRP group */
#define	EXPER_DVMRP_VIF		1
#define	EXPER_DVMRP_MRT		2


/*
 * The SCTP group
 */
#define	MIB2_SCTP_CONN			15
#define	MIB2_SCTP_CONN_LOCAL		16
#define	MIB2_SCTP_CONN_REMOTE		17

#define	MIB2_SCTP_closed		1
#define	MIB2_SCTP_cookieWait		2
#define	MIB2_SCTP_cookieEchoed		3
#define	MIB2_SCTP_established		4
#define	MIB2_SCTP_shutdownPending	5
#define	MIB2_SCTP_shutdownSent		6
#define	MIB2_SCTP_shutdownReceived	7
#define	MIB2_SCTP_shutdownAckSent	8
#define	MIB2_SCTP_deleteTCB		9
#define	MIB2_SCTP_listen		10	/* Not in the MIB */

#define	MIB2_SCTP_ACTIVE		1
#define	MIB2_SCTP_INACTIVE		2

#define	MIB2_SCTP_ADDR_V4		1
#define	MIB2_SCTP_ADDR_V6		2

#define	MIB2_SCTP_RTOALGO_OTHER		1
#define	MIB2_SCTP_RTOALGO_VANJ		2

typedef struct mib2_sctpConnEntry {
		/* connection identifier	{ sctpAssocEntry 1 } */
	uint32_t	sctpAssocId;
		/* remote hostname (not used)	{ sctpAssocEntry 2 } */
	Octet_t		sctpAssocRemHostName;
		/* local port number		{ sctpAssocEntry 3 } */
	uint32_t	sctpAssocLocalPort;
		/* remote port number		{ sctpAssocEntry 4 } */
	uint32_t	sctpAssocRemPort;
		/* type of primary remote addr	{ sctpAssocEntry 5 } */
	int		sctpAssocRemPrimAddrType;
		/* primary remote address	{ sctpAssocEntry 6 } */
	Ip6Address	sctpAssocRemPrimAddr;
		/* local address */
	Ip6Address	sctpAssocLocPrimAddr;
		/* current heartbeat interval	{ sctpAssocEntry 7 } */
	uint32_t	sctpAssocHeartBeatInterval;
		/* state of this association	{ sctpAssocEntry 8 } */
	int		sctpAssocState;
		/* # of inbound streams		{ sctpAssocEntry 9 } */
	uint32_t	sctpAssocInStreams;
		/* # of outbound streams	{ sctpAssocEntry 10 } */
	uint32_t	sctpAssocOutStreams;
		/* max # of data retans		{ sctpAssocEntry 11 } */
	uint32_t	sctpAssocMaxRetr;
		/* sysId for assoc owner	{ sctpAssocEntry 12 } */
	uint32_t	sctpAssocPrimProcess;
		/* # of rxmit timeouts during hanshake */
	Counter32	sctpAssocT1expired;	/* { sctpAssocEntry 13 } */
		/* # of rxmit timeouts during shutdown */
	Counter32	sctpAssocT2expired;	/* { sctpAssocEntry 14 } */
		/* # of rxmit timeouts during data transfer */
	Counter32	sctpAssocRtxChunks;	/* { sctpAssocEntry 15 } */
		/* assoc start-up time		{ sctpAssocEntry 16 } */
	uint32_t	sctpAssocStartTime;
	struct sctpConnEntryInfo_s {
				/* amount of data in send Q */
		Gauge		ce_sendq;
				/* amount of data in recv Q */
		Gauge		ce_recvq;
				/* currect send window size */
		Gauge		ce_swnd;
				/* currenct receive window size */
		Gauge		ce_rwnd;
				/* current max segment size */
		Gauge		ce_mss;
	} sctpConnEntryInfo;
} mib2_sctpConnEntry_t;

typedef struct mib2_sctpConnLocalAddrEntry {
		/* connection identifier */
	uint32_t	sctpAssocId;
		/* type of local addr		{ sctpAssocLocalEntry 1 } */
	int		sctpAssocLocalAddrType;
		/* local address		{ sctpAssocLocalEntry 2 } */
	Ip6Address	sctpAssocLocalAddr;
} mib2_sctpConnLocalEntry_t;

typedef struct mib2_sctpConnRemoteAddrEntry {
		/* connection identier */
	uint32_t	sctpAssocId;
		/* remote addr type		{ sctpAssocRemEntry 1 } */
	int		sctpAssocRemAddrType;
		/* remote address		{ sctpAssocRemEntry 2 } */
	Ip6Address	sctpAssocRemAddr;
		/* is the address active	{ sctpAssocRemEntry 3 } */
	int		sctpAssocRemAddrActive;
		/* whether hearbeat is active	{ sctpAssocRemEntry 4 } */
	int		sctpAssocRemAddrHBActive;
		/* current RTO			{ sctpAssocRemEntry 5 } */
	uint32_t	sctpAssocRemAddrRTO;
		/* max # of rexmits before becoming inactive */
	uint32_t	sctpAssocRemAddrMaxPathRtx; /* {sctpAssocRemEntry 6} */
		/* # of rexmits to this dest	{ sctpAssocRemEntry 7 } */
	uint32_t	sctpAssocRemAddrRtx;
} mib2_sctpConnRemoteEntry_t;



/* Pack data in mib2_sctp to make struct size the same for 32- and 64-bits */
#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack(4)
#endif

typedef struct mib2_sctp {
		/* algorithm used to determine rto	{ sctpParams 1 } */
	int		sctpRtoAlgorithm;
		/* min RTO in msecs			{ sctpParams 2 } */
	uint32_t	sctpRtoMin;
		/* max RTO in msecs			{ sctpParams 3 } */
	uint32_t	sctpRtoMax;
		/* initial RTO in msecs			{ sctpParams 4 } */
	uint32_t	sctpRtoInitial;
		/* max # of assocs			{ sctpParams 5 } */
	int32_t		sctpMaxAssocs;
		/* cookie lifetime in msecs		{ sctpParams 6 } */
	uint32_t	sctpValCookieLife;
		/* max # of retrans in startup		{ sctpParams 7 } */
	uint32_t	sctpMaxInitRetr;
	/* # of conns ESTABLISHED, SHUTDOWN-RECEIVED or SHUTDOWN-PENDING */
	Counter32	sctpCurrEstab;		/* { sctpStats 1 } */
		/* # of active opens			{ sctpStats 2 } */
	Counter32	sctpActiveEstab;
		/* # of passive opens			{ sctpStats 3 } */
	Counter32	sctpPassiveEstab;
		/* # of aborted conns			{ sctpStats 4 } */
	Counter32	sctpAborted;
		/* # of graceful shutdowns		{ sctpStats 5 } */
	Counter32	sctpShutdowns;
		/* # of OOB packets			{ sctpStats 6 } */
	Counter32	sctpOutOfBlue;
		/* # of packets discarded due to cksum	{ sctpStats 7 } */
	Counter32	sctpChecksumError;
		/* # of control chunks sent		{ sctpStats 8 } */
	Counter64	sctpOutCtrlChunks;
		/* # of ordered data chunks sent	{ sctpStats 9 } */
	Counter64	sctpOutOrderChunks;
		/* # of unordered data chunks sent	{ sctpStats 10 } */
	Counter64	sctpOutUnorderChunks;
		/* # of retransmitted data chunks */
	Counter64	sctpRetransChunks;
		/* # of SACK chunks sent */
	Counter		sctpOutAck;
		/* # of delayed ACK timeouts */
	Counter		sctpOutAckDelayed;
		/* # of SACK chunks sent to update window */
	Counter		sctpOutWinUpdate;
		/* # of fast retransmits */
	Counter		sctpOutFastRetrans;
		/* # of window probes sent */
	Counter		sctpOutWinProbe;
		/* # of control chunks received		{ sctpStats 11 } */
	Counter64	sctpInCtrlChunks;
		/* # of ordered data chunks rcvd	{ sctpStats 12 } */
	Counter64	sctpInOrderChunks;
		/* # of unord data chunks rcvd		{ sctpStats 13 } */
	Counter64	sctpInUnorderChunks;
		/* # of received SACK chunks */
	Counter		sctpInAck;
		/* # of received SACK chunks with duplicate TSN */
	Counter		sctpInDupAck;
		/* # of SACK chunks acking unsent data */
	Counter		sctpInAckUnsent;
		/* # of Fragmented User Messages	{ sctpStats 14 } */
	Counter64	sctpFragUsrMsgs;
		/* # of Reassembled User Messages	{ sctpStats 15 } */
	Counter64	sctpReasmUsrMsgs;
		/* # of Sent SCTP Packets		{ sctpStats 16 } */
	Counter64	sctpOutSCTPPkts;
		/* # of Received SCTP Packets		{ sctpStats 17 } */
	Counter64	sctpInSCTPPkts;
		/* # of invalid cookies received */
	Counter		sctpInInvalidCookie;
		/* total # of retransmit timeouts */
	Counter		sctpTimRetrans;
		/* total # of retransmit timeouts dropping the connection */
	Counter		sctpTimRetransDrop;
		/* total # of heartbeat probes */
	Counter		sctpTimHeartBeatProbe;
		/* total # of heartbeat timeouts dropping the connection */
	Counter		sctpTimHeartBeatDrop;
		/* total # of conns refused due to backlog full on listen */
	Counter		sctpListenDrop;
		/* total # of pkts received after the association has closed */
	Counter		sctpInClosed;
	int		sctpEntrySize;
	int		sctpLocalEntrySize;
	int		sctpRemoteEntrySize;
} mib2_sctp_t;

#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
#pragma pack()
#endif


#ifdef	__cplusplus
}
#endif

#endif	/* _INET_MIB2_H */