xref: /freebsd/sys/net/if_mib.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1c398230bSWarner Losh /*-
2bbd17bf8SGarrett Wollman  * Copyright 1996 Massachusetts Institute of Technology
3bbd17bf8SGarrett Wollman  *
4bbd17bf8SGarrett Wollman  * Permission to use, copy, modify, and distribute this software and
5bbd17bf8SGarrett Wollman  * its documentation for any purpose and without fee is hereby
6bbd17bf8SGarrett Wollman  * granted, provided that both the above copyright notice and this
7bbd17bf8SGarrett Wollman  * permission notice appear in all copies, that both the above
8bbd17bf8SGarrett Wollman  * copyright notice and this permission notice appear in all
9bbd17bf8SGarrett Wollman  * supporting documentation, and that the name of M.I.T. not be used
10bbd17bf8SGarrett Wollman  * in advertising or publicity pertaining to distribution of the
11bbd17bf8SGarrett Wollman  * software without specific, written prior permission.  M.I.T. makes
12bbd17bf8SGarrett Wollman  * no representations about the suitability of this software for any
13bbd17bf8SGarrett Wollman  * purpose.  It is provided "as is" without express or implied
14bbd17bf8SGarrett Wollman  * warranty.
15bbd17bf8SGarrett Wollman  *
16bbd17bf8SGarrett Wollman  * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
17bbd17bf8SGarrett Wollman  * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18bbd17bf8SGarrett Wollman  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19bbd17bf8SGarrett Wollman  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20bbd17bf8SGarrett Wollman  * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21bbd17bf8SGarrett Wollman  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22bbd17bf8SGarrett Wollman  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23bbd17bf8SGarrett Wollman  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24bbd17bf8SGarrett Wollman  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25bbd17bf8SGarrett Wollman  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26bbd17bf8SGarrett Wollman  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27bbd17bf8SGarrett Wollman  * SUCH DAMAGE.
28bbd17bf8SGarrett Wollman  */
29bbd17bf8SGarrett Wollman 
30bbd17bf8SGarrett Wollman #ifndef _NET_IF_MIB_H
31bbd17bf8SGarrett Wollman #define	_NET_IF_MIB_H	1
32bbd17bf8SGarrett Wollman 
33bbd17bf8SGarrett Wollman struct ifmibdata {
34bbd17bf8SGarrett Wollman 	char	ifmd_name[IFNAMSIZ]; /* name of interface */
35bbd17bf8SGarrett Wollman 	int	ifmd_pcount;	/* number of promiscuous listeners */
36bbd17bf8SGarrett Wollman 	int	ifmd_flags;	/* interface flags */
37bbd17bf8SGarrett Wollman 	int	ifmd_snd_len;	/* instantaneous length of send queue */
38bbd17bf8SGarrett Wollman 	int	ifmd_snd_maxlen; /* maximum length of send queue */
39bbd17bf8SGarrett Wollman 	int	ifmd_snd_drops;	/* number of drops in send queue */
401de1c452SGarrett Wollman 	int	ifmd_filler[4];	/* for future expansion */
411de1c452SGarrett Wollman 	struct	if_data ifmd_data; /* generic information and statistics */
42bbd17bf8SGarrett Wollman };
43bbd17bf8SGarrett Wollman 
44bbd17bf8SGarrett Wollman /*
45bbd17bf8SGarrett Wollman  * sysctl MIB tags at the net.link.generic level
46bbd17bf8SGarrett Wollman  */
47bbd17bf8SGarrett Wollman #define	IFMIB_SYSTEM	1	/* non-interface-specific */
48bbd17bf8SGarrett Wollman #define	IFMIB_IFDATA	2	/* per-interface data table */
49bbd17bf8SGarrett Wollman 
50bbd17bf8SGarrett Wollman /*
51bbd17bf8SGarrett Wollman  * MIB tags for the various net.link.generic.ifdata tables
52bbd17bf8SGarrett Wollman  */
53bbd17bf8SGarrett Wollman #define	IFDATA_GENERAL	1	/* generic stats for all kinds of ifaces */
54bbd17bf8SGarrett Wollman #define	IFDATA_LINKSPECIFIC	2 /* specific to the type of interface */
5515450897SHartmut Brandt #define	IFDATA_DRIVERNAME	3 /* driver name and unit */
56bbd17bf8SGarrett Wollman 
57bbd17bf8SGarrett Wollman /*
58bbd17bf8SGarrett Wollman  * MIB tags at the net.link.generic.system level
59bbd17bf8SGarrett Wollman  */
60bbd17bf8SGarrett Wollman #define	IFMIB_IFCOUNT	1	/* number of interfaces configured */
61bbd17bf8SGarrett Wollman 
62bbd17bf8SGarrett Wollman /*
63bbd17bf8SGarrett Wollman  * MIB tags as the net.link level
64bbd17bf8SGarrett Wollman  * All of the other values are IFT_* names defined in if_types.h.
65bbd17bf8SGarrett Wollman  */
66bbd17bf8SGarrett Wollman #define	NETLINK_GENERIC	0	/* functions not specific to a type of iface */
67bbd17bf8SGarrett Wollman 
68bbd17bf8SGarrett Wollman /*
69bbd17bf8SGarrett Wollman  * The reason why the IFDATA_LINKSPECIFIC stuff is not under the
70bbd17bf8SGarrett Wollman  * net.link.<iftype> branches is twofold:
71bbd17bf8SGarrett Wollman  *   1) It's easier to code this way, and doesn't require duplication.
72bbd17bf8SGarrett Wollman  *   2) The fourth level under net.link.<iftype> is <pf>; that is to say,
73bbd17bf8SGarrett Wollman  *	the net.link.<iftype> tree instruments the adaptation layers between
74bbd17bf8SGarrett Wollman  *	<iftype> and a particular protocol family (e.g., net.link.ether.inet
75bbd17bf8SGarrett Wollman  *	instruments ARP).  This does not really leave room for anything else
76bbd17bf8SGarrett Wollman  *	that needs to have a well-known number.
77bbd17bf8SGarrett Wollman  */
781de1c452SGarrett Wollman 
791de1c452SGarrett Wollman /*
801de1c452SGarrett Wollman  * Link-specific MIB structures for various link types.
811de1c452SGarrett Wollman  */
821de1c452SGarrett Wollman 
831de1c452SGarrett Wollman /* For IFT_ETHER, IFT_ISO88023, and IFT_STARLAN, as used by RFC 1650 */
841de1c452SGarrett Wollman struct ifmib_iso_8802_3 {
851de1c452SGarrett Wollman 	u_int32_t	dot3StatsAlignmentErrors;
861de1c452SGarrett Wollman 	u_int32_t	dot3StatsFCSErrors;
871de1c452SGarrett Wollman 	u_int32_t	dot3StatsSingleCollisionFrames;
881de1c452SGarrett Wollman 	u_int32_t	dot3StatsMultipleCollisionFrames;
891de1c452SGarrett Wollman 	u_int32_t	dot3StatsSQETestErrors;
901de1c452SGarrett Wollman 	u_int32_t	dot3StatsDeferredTransmissions;
911de1c452SGarrett Wollman 	u_int32_t	dot3StatsLateCollisions;
921de1c452SGarrett Wollman 	u_int32_t	dot3StatsExcessiveCollisions;
931de1c452SGarrett Wollman 	u_int32_t	dot3StatsInternalMacTransmitErrors;
941de1c452SGarrett Wollman 	u_int32_t	dot3StatsCarrierSenseErrors;
951de1c452SGarrett Wollman 	u_int32_t	dot3StatsFrameTooLongs;
961de1c452SGarrett Wollman 	u_int32_t	dot3StatsInternalMacReceiveErrors;
971de1c452SGarrett Wollman 	u_int32_t	dot3StatsEtherChipSet;
981de1c452SGarrett Wollman 	/* Matt Thomas wants this one, not included in RFC 1650: */
991de1c452SGarrett Wollman 	u_int32_t	dot3StatsMissedFrames;
1001de1c452SGarrett Wollman 
1011de1c452SGarrett Wollman 	u_int32_t	dot3StatsCollFrequencies[16]; /* NB: index origin */
1021de1c452SGarrett Wollman 
1031de1c452SGarrett Wollman 	u_int32_t	dot3Compliance;
1041de1c452SGarrett Wollman #define	DOT3COMPLIANCE_STATS	1
1051de1c452SGarrett Wollman #define	DOT3COMPLIANCE_COLLS	2
1061de1c452SGarrett Wollman };
1071de1c452SGarrett Wollman 
1081de1c452SGarrett Wollman /*
1091de1c452SGarrett Wollman  * Chipset identifiers are normally part of the vendor's enterprise MIB.
1101de1c452SGarrett Wollman  * However, we don't want to be trying to represent arbitrary-length
1111de1c452SGarrett Wollman  * OBJECT IDENTIFIERs here (ick!), and the right value is not necessarily
1121de1c452SGarrett Wollman  * obvious to the driver implementor.  So, we define our own identification
1131de1c452SGarrett Wollman  * mechanism here, and let the agent writer deal with the translation.
1141de1c452SGarrett Wollman  */
1151de1c452SGarrett Wollman #define	DOT3CHIPSET_VENDOR(x)	((x) >> 16)
1161de1c452SGarrett Wollman #define	DOT3CHIPSET_PART(x)	((x) & 0xffff)
1171de1c452SGarrett Wollman #define	DOT3CHIPSET(v,p)	(((v) << 16) + ((p) & 0xffff))
1181de1c452SGarrett Wollman 
1191de1c452SGarrett Wollman /* Driver writers!  Add your vendors here! */
1201de1c452SGarrett Wollman enum dot3Vendors {
1211de1c452SGarrett Wollman 	dot3VendorAMD = 1,
1221de1c452SGarrett Wollman 	dot3VendorIntel = 2,
1231de1c452SGarrett Wollman 	dot3VendorNational = 4,
1241de1c452SGarrett Wollman 	dot3VendorFujitsu = 5,
1251de1c452SGarrett Wollman 	dot3VendorDigital = 6,
1268b1f0fa5SBruce Evans 	dot3VendorWesternDigital = 7
1271de1c452SGarrett Wollman };
1281de1c452SGarrett Wollman 
1291de1c452SGarrett Wollman /* Driver writers!  Add your chipsets here! */
1301de1c452SGarrett Wollman enum {
1311de1c452SGarrett Wollman 	dot3ChipSetAMD7990 = 1,
1321de1c452SGarrett Wollman 	dot3ChipSetAMD79900 = 2,
1331de1c452SGarrett Wollman 	dot3ChipSetAMD79C940 = 3
1341de1c452SGarrett Wollman };
1351de1c452SGarrett Wollman 
1361de1c452SGarrett Wollman enum {
1371de1c452SGarrett Wollman 	dot3ChipSetIntel82586 = 1,
1381de1c452SGarrett Wollman 	dot3ChipSetIntel82596 = 2,
1391de1c452SGarrett Wollman 	dot3ChipSetIntel82557 = 3
1401de1c452SGarrett Wollman };
1411de1c452SGarrett Wollman 
1421de1c452SGarrett Wollman enum {
1431de1c452SGarrett Wollman 	dot3ChipSetNational8390 = 1,
1441de1c452SGarrett Wollman 	dot3ChipSetNationalSonic = 2
1451de1c452SGarrett Wollman };
1461de1c452SGarrett Wollman 
1471de1c452SGarrett Wollman enum {
1481de1c452SGarrett Wollman 	dot3ChipSetFujitsu86950 = 1
1491de1c452SGarrett Wollman };
1501de1c452SGarrett Wollman 
1511de1c452SGarrett Wollman enum {
1521de1c452SGarrett Wollman 	dot3ChipSetDigitalDC21040 = 1,
1531de1c452SGarrett Wollman 	dot3ChipSetDigitalDC21140 = 2,
1541de1c452SGarrett Wollman 	dot3ChipSetDigitalDC21041 = 3,
1551de1c452SGarrett Wollman 	dot3ChipSetDigitalDC21140A = 4,
1561de1c452SGarrett Wollman 	dot3ChipSetDigitalDC21142 = 5
1571de1c452SGarrett Wollman };
1581de1c452SGarrett Wollman 
1591de1c452SGarrett Wollman enum {
1601de1c452SGarrett Wollman 	dot3ChipSetWesternDigital83C690 = 1,
1611de1c452SGarrett Wollman 	dot3ChipSetWesternDigital83C790 = 2
1621de1c452SGarrett Wollman };
1631de1c452SGarrett Wollman /* END of Ethernet-link MIB stuff */
1641de1c452SGarrett Wollman 
1651de1c452SGarrett Wollman /*
1661de1c452SGarrett Wollman  * Put other types of interface MIBs here, or in interface-specific
1671de1c452SGarrett Wollman  * header files if convenient ones already exist.
1681de1c452SGarrett Wollman  */
169bbd17bf8SGarrett Wollman #endif /* _NET_IF_MIB_H */
170