xref: /dragonfly/sys/net/if_mib.h (revision 86d7f5d3)
1*86d7f5d3SJohn Marino /*
2*86d7f5d3SJohn Marino  * Copyright 1996 Massachusetts Institute of Technology
3*86d7f5d3SJohn Marino  *
4*86d7f5d3SJohn Marino  * Permission to use, copy, modify, and distribute this software and
5*86d7f5d3SJohn Marino  * its documentation for any purpose and without fee is hereby
6*86d7f5d3SJohn Marino  * granted, provided that both the above copyright notice and this
7*86d7f5d3SJohn Marino  * permission notice appear in all copies, that both the above
8*86d7f5d3SJohn Marino  * copyright notice and this permission notice appear in all
9*86d7f5d3SJohn Marino  * supporting documentation, and that the name of M.I.T. not be used
10*86d7f5d3SJohn Marino  * in advertising or publicity pertaining to distribution of the
11*86d7f5d3SJohn Marino  * software without specific, written prior permission.  M.I.T. makes
12*86d7f5d3SJohn Marino  * no representations about the suitability of this software for any
13*86d7f5d3SJohn Marino  * purpose.  It is provided "as is" without express or implied
14*86d7f5d3SJohn Marino  * warranty.
15*86d7f5d3SJohn Marino  *
16*86d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
17*86d7f5d3SJohn Marino  * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18*86d7f5d3SJohn Marino  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19*86d7f5d3SJohn Marino  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20*86d7f5d3SJohn Marino  * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21*86d7f5d3SJohn Marino  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22*86d7f5d3SJohn Marino  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23*86d7f5d3SJohn Marino  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24*86d7f5d3SJohn Marino  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25*86d7f5d3SJohn Marino  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26*86d7f5d3SJohn Marino  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*86d7f5d3SJohn Marino  * SUCH DAMAGE.
28*86d7f5d3SJohn Marino  *
29*86d7f5d3SJohn Marino  * $FreeBSD: src/sys/net/if_mib.h,v 1.6 1999/08/28 00:48:19 peter Exp $
30*86d7f5d3SJohn Marino  * $DragonFly: src/sys/net/if_mib.h,v 1.3 2006/05/20 02:42:08 dillon Exp $
31*86d7f5d3SJohn Marino  */
32*86d7f5d3SJohn Marino 
33*86d7f5d3SJohn Marino #ifndef _NET_IF_MIB_H_
34*86d7f5d3SJohn Marino #define	_NET_IF_MIB_H_
35*86d7f5d3SJohn Marino 
36*86d7f5d3SJohn Marino #ifndef _NET_IF_H_
37*86d7f5d3SJohn Marino #include <net/if.h>
38*86d7f5d3SJohn Marino #endif
39*86d7f5d3SJohn Marino 
40*86d7f5d3SJohn Marino struct ifmibdata {
41*86d7f5d3SJohn Marino 	char	ifmd_name[IFNAMSIZ]; /* name of interface */
42*86d7f5d3SJohn Marino 	int	ifmd_pcount;	/* number of promiscuous listeners */
43*86d7f5d3SJohn Marino 	int	ifmd_flags;	/* interface flags */
44*86d7f5d3SJohn Marino 	int	ifmd_snd_len;	/* instantaneous length of send queue */
45*86d7f5d3SJohn Marino 	int	ifmd_snd_maxlen; /* maximum length of send queue */
46*86d7f5d3SJohn Marino 	int	ifmd_snd_drops;	/* number of drops in send queue */
47*86d7f5d3SJohn Marino 	int	ifmd_filler[4];	/* for future expansion */
48*86d7f5d3SJohn Marino 	struct	if_data ifmd_data; /* generic information and statistics */
49*86d7f5d3SJohn Marino };
50*86d7f5d3SJohn Marino 
51*86d7f5d3SJohn Marino /*
52*86d7f5d3SJohn Marino  * sysctl MIB tags at the net.link.generic level
53*86d7f5d3SJohn Marino  */
54*86d7f5d3SJohn Marino #define	IFMIB_SYSTEM	1	/* non-interface-specific */
55*86d7f5d3SJohn Marino #define	IFMIB_IFDATA	2	/* per-interface data table */
56*86d7f5d3SJohn Marino 
57*86d7f5d3SJohn Marino /*
58*86d7f5d3SJohn Marino  * MIB tags for the various net.link.generic.ifdata tables
59*86d7f5d3SJohn Marino  */
60*86d7f5d3SJohn Marino #define	IFDATA_GENERAL	1	/* generic stats for all kinds of ifaces */
61*86d7f5d3SJohn Marino #define	IFDATA_LINKSPECIFIC	2 /* specific to the type of interface */
62*86d7f5d3SJohn Marino 
63*86d7f5d3SJohn Marino /*
64*86d7f5d3SJohn Marino  * MIB tags at the net.link.generic.system level
65*86d7f5d3SJohn Marino  */
66*86d7f5d3SJohn Marino #define	IFMIB_IFCOUNT	1	/* number of interfaces configured */
67*86d7f5d3SJohn Marino 
68*86d7f5d3SJohn Marino /*
69*86d7f5d3SJohn Marino  * MIB tags as the net.link level
70*86d7f5d3SJohn Marino  * All of the other values are IFT_* names defined in if_types.h.
71*86d7f5d3SJohn Marino  */
72*86d7f5d3SJohn Marino #define	NETLINK_GENERIC	0	/* functions not specific to a type of iface */
73*86d7f5d3SJohn Marino 
74*86d7f5d3SJohn Marino /*
75*86d7f5d3SJohn Marino  * The reason why the IFDATA_LINKSPECIFIC stuff is not under the
76*86d7f5d3SJohn Marino  * net.link.<iftype> branches is twofold:
77*86d7f5d3SJohn Marino  *   1) It's easier to code this way, and doesn't require duplication.
78*86d7f5d3SJohn Marino  *   2) The fourth level under net.link.<iftype> is <pf>; that is to say,
79*86d7f5d3SJohn Marino  *	the net.link.<iftype> tree instruments the adaptation layers between
80*86d7f5d3SJohn Marino  *	<iftype> and a particular protocol family (e.g., net.link.ether.inet
81*86d7f5d3SJohn Marino  *	instruments ARP).  This does not really leave room for anything else
82*86d7f5d3SJohn Marino  *	that needs to have a well-known number.
83*86d7f5d3SJohn Marino  */
84*86d7f5d3SJohn Marino 
85*86d7f5d3SJohn Marino /*
86*86d7f5d3SJohn Marino  * Link-specific MIB structures for various link types.
87*86d7f5d3SJohn Marino  */
88*86d7f5d3SJohn Marino 
89*86d7f5d3SJohn Marino /* For IFT_ETHER, IFT_ISO88023, and IFT_STARLAN, as used by RFC 1650 */
90*86d7f5d3SJohn Marino struct ifmib_iso_8802_3 {
91*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsAlignmentErrors;
92*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsFCSErrors;
93*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsSingleCollisionFrames;
94*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsMultipleCollisionFrames;
95*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsSQETestErrors;
96*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsDeferredTransmissions;
97*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsLateCollisions;
98*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsExcessiveCollisions;
99*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsInternalMacTransmitErrors;
100*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsCarrierSenseErrors;
101*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsFrameTooLongs;
102*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsInternalMacReceiveErrors;
103*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsEtherChipSet;
104*86d7f5d3SJohn Marino 	/* Matt Thomas wants this one, not included in RFC 1650: */
105*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsMissedFrames;
106*86d7f5d3SJohn Marino 
107*86d7f5d3SJohn Marino 	u_int32_t	dot3StatsCollFrequencies[16]; /* NB: index origin */
108*86d7f5d3SJohn Marino 
109*86d7f5d3SJohn Marino 	u_int32_t	dot3Compliance;
110*86d7f5d3SJohn Marino #define	DOT3COMPLIANCE_STATS	1
111*86d7f5d3SJohn Marino #define	DOT3COMPLIANCE_COLLS	2
112*86d7f5d3SJohn Marino };
113*86d7f5d3SJohn Marino 
114*86d7f5d3SJohn Marino /*
115*86d7f5d3SJohn Marino  * Chipset identifiers are normally part of the vendor's enterprise MIB.
116*86d7f5d3SJohn Marino  * However, we don't want to be trying to represent arbitrary-length
117*86d7f5d3SJohn Marino  * OBJECT IDENTIFIERs here (ick!), and the right value is not necessarily
118*86d7f5d3SJohn Marino  * obvious to the driver implementor.  So, we define our own identification
119*86d7f5d3SJohn Marino  * mechanism here, and let the agent writer deal with the translation.
120*86d7f5d3SJohn Marino  */
121*86d7f5d3SJohn Marino #define	DOT3CHIPSET_VENDOR(x)	((x) >> 16)
122*86d7f5d3SJohn Marino #define	DOT3CHIPSET_PART(x)	((x) & 0xffff)
123*86d7f5d3SJohn Marino #define	DOT3CHIPSET(v,p)	(((v) << 16) + ((p) & 0xffff))
124*86d7f5d3SJohn Marino 
125*86d7f5d3SJohn Marino /* Driver writers!  Add your vendors here! */
126*86d7f5d3SJohn Marino enum dot3Vendors {
127*86d7f5d3SJohn Marino 	dot3VendorAMD = 1,
128*86d7f5d3SJohn Marino 	dot3VendorIntel = 2,
129*86d7f5d3SJohn Marino 	dot3VendorNational = 4,
130*86d7f5d3SJohn Marino 	dot3VendorFujitsu = 5,
131*86d7f5d3SJohn Marino 	dot3VendorDigital = 6,
132*86d7f5d3SJohn Marino 	dot3VendorWesternDigital = 7
133*86d7f5d3SJohn Marino };
134*86d7f5d3SJohn Marino 
135*86d7f5d3SJohn Marino /* Driver writers!  Add your chipsets here! */
136*86d7f5d3SJohn Marino enum {
137*86d7f5d3SJohn Marino 	dot3ChipSetAMD7990 = 1,
138*86d7f5d3SJohn Marino 	dot3ChipSetAMD79900 = 2,
139*86d7f5d3SJohn Marino 	dot3ChipSetAMD79C940 = 3
140*86d7f5d3SJohn Marino };
141*86d7f5d3SJohn Marino 
142*86d7f5d3SJohn Marino enum {
143*86d7f5d3SJohn Marino 	dot3ChipSetIntel82586 = 1,
144*86d7f5d3SJohn Marino 	dot3ChipSetIntel82596 = 2,
145*86d7f5d3SJohn Marino 	dot3ChipSetIntel82557 = 3
146*86d7f5d3SJohn Marino };
147*86d7f5d3SJohn Marino 
148*86d7f5d3SJohn Marino enum {
149*86d7f5d3SJohn Marino 	dot3ChipSetNational8390 = 1,
150*86d7f5d3SJohn Marino 	dot3ChipSetNationalSonic = 2
151*86d7f5d3SJohn Marino };
152*86d7f5d3SJohn Marino 
153*86d7f5d3SJohn Marino enum {
154*86d7f5d3SJohn Marino 	dot3ChipSetFujitsu86950 = 1
155*86d7f5d3SJohn Marino };
156*86d7f5d3SJohn Marino 
157*86d7f5d3SJohn Marino enum {
158*86d7f5d3SJohn Marino 	dot3ChipSetDigitalDC21040 = 1,
159*86d7f5d3SJohn Marino 	dot3ChipSetDigitalDC21140 = 2,
160*86d7f5d3SJohn Marino 	dot3ChipSetDigitalDC21041 = 3,
161*86d7f5d3SJohn Marino 	dot3ChipSetDigitalDC21140A = 4,
162*86d7f5d3SJohn Marino 	dot3ChipSetDigitalDC21142 = 5
163*86d7f5d3SJohn Marino };
164*86d7f5d3SJohn Marino 
165*86d7f5d3SJohn Marino enum {
166*86d7f5d3SJohn Marino 	dot3ChipSetWesternDigital83C690 = 1,
167*86d7f5d3SJohn Marino 	dot3ChipSetWesternDigital83C790 = 2
168*86d7f5d3SJohn Marino };
169*86d7f5d3SJohn Marino /* END of Ethernet-link MIB stuff */
170*86d7f5d3SJohn Marino 
171*86d7f5d3SJohn Marino /*
172*86d7f5d3SJohn Marino  * Put other types of interface MIBs here, or in interface-specific
173*86d7f5d3SJohn Marino  * header files if convenient ones already exist.
174*86d7f5d3SJohn Marino  */
175*86d7f5d3SJohn Marino #endif /* _NET_IF_MIB_H_ */
176