1223637Sbz/*-
2126353Smlaier * Copyright 1996 Massachusetts Institute of Technology
3126353Smlaier *
4126353Smlaier * Permission to use, copy, modify, and distribute this software and
5126353Smlaier * its documentation for any purpose and without fee is hereby
6126353Smlaier * granted, provided that both the above copyright notice and this
7126353Smlaier * permission notice appear in all copies, that both the above
8126353Smlaier * copyright notice and this permission notice appear in all
9126353Smlaier * supporting documentation, and that the name of M.I.T. not be used
10126353Smlaier * in advertising or publicity pertaining to distribution of the
11126353Smlaier * software without specific, written prior permission.  M.I.T. makes
12126353Smlaier * no representations about the suitability of this software for any
13126353Smlaier * purpose.  It is provided "as is" without express or implied
14126353Smlaier * warranty.
15126353Smlaier *
16126353Smlaier * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
17126353Smlaier * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18126353Smlaier * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19126353Smlaier * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20126353Smlaier * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21126353Smlaier * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22126353Smlaier * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23126353Smlaier * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24126353Smlaier * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25126353Smlaier * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26126353Smlaier * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27126353Smlaier * SUCH DAMAGE.
28126353Smlaier *
29126353Smlaier * $FreeBSD$
30126353Smlaier */
31126353Smlaier
32126353Smlaier#ifndef _NET_IF_MIB_H
33127082Sobrien#define	_NET_IF_MIB_H	1
34127082Sobrien
35127082Sobrienstruct ifmibdata {
36126353Smlaier	char	ifmd_name[IFNAMSIZ]; /* name of interface */
37130617Smlaier	int	ifmd_pcount;	/* number of promiscuous listeners */
38126353Smlaier	int	ifmd_flags;	/* interface flags */
39126353Smlaier	int	ifmd_snd_len;	/* instantaneous length of send queue */
40223637Sbz	int	ifmd_snd_maxlen; /* maximum length of send queue */
41223637Sbz	int	ifmd_snd_drops;	/* number of drops in send queue */
42126353Smlaier	int	ifmd_filler[4];	/* for future expansion */
43126353Smlaier	struct	if_data ifmd_data; /* generic information and statistics */
44126353Smlaier};
45126353Smlaier
46126353Smlaier/*
47126353Smlaier * sysctl MIB tags at the net.link.generic level
48126353Smlaier */
49126353Smlaier#define	IFMIB_SYSTEM	1	/* non-interface-specific */
50223637Sbz#define	IFMIB_IFDATA	2	/* per-interface data table */
51126353Smlaier
52126353Smlaier/*
53126353Smlaier * MIB tags for the various net.link.generic.ifdata tables
54127024Smlaier */
55223637Sbz#define	IFDATA_GENERAL	1	/* generic stats for all kinds of ifaces */
56126355Smlaier#define	IFDATA_LINKSPECIFIC	2 /* specific to the type of interface */
57126355Smlaier#define	IFDATA_DRIVERNAME	3 /* driver name and unit */
58126353Smlaier
59126355Smlaier/*
60130617Smlaier * MIB tags at the net.link.generic.system level
61126353Smlaier */
62126353Smlaier#define	IFMIB_IFCOUNT	1	/* number of interfaces configured */
63130617Smlaier
64126353Smlaier/*
65126353Smlaier * MIB tags as the net.link level
66130617Smlaier * All of the other values are IFT_* names defined in if_types.h.
67130617Smlaier */
68126353Smlaier#define	NETLINK_GENERIC	0	/* functions not specific to a type of iface */
69223637Sbz
70126353Smlaier/*
71126353Smlaier * The reason why the IFDATA_LINKSPECIFIC stuff is not under the
72126353Smlaier * net.link.<iftype> branches is twofold:
73126353Smlaier *   1) It's easier to code this way, and doesn't require duplication.
74126353Smlaier *   2) The fourth level under net.link.<iftype> is <pf>; that is to say,
75126353Smlaier *	the net.link.<iftype> tree instruments the adaptation layers between
76126353Smlaier *	<iftype> and a particular protocol family (e.g., net.link.ether.inet
77126353Smlaier *	instruments ARP).  This does not really leave room for anything else
78126353Smlaier *	that needs to have a well-known number.
79126353Smlaier */
80130617Smlaier
81130617Smlaier/*
82130617Smlaier * Link-specific MIB structures for various link types.
83223637Sbz */
84130617Smlaier
85223637Sbz/* For IFT_ETHER, IFT_ISO88023, and IFT_STARLAN, as used by RFC 1650 */
86126353Smlaierstruct ifmib_iso_8802_3 {
87130617Smlaier	u_int32_t	dot3StatsAlignmentErrors;
88130617Smlaier	u_int32_t	dot3StatsFCSErrors;
89171172Smlaier	u_int32_t	dot3StatsSingleCollisionFrames;
90130617Smlaier	u_int32_t	dot3StatsMultipleCollisionFrames;
91130617Smlaier	u_int32_t	dot3StatsSQETestErrors;
92130617Smlaier	u_int32_t	dot3StatsDeferredTransmissions;
93126353Smlaier	u_int32_t	dot3StatsLateCollisions;
94223637Sbz	u_int32_t	dot3StatsExcessiveCollisions;
95126353Smlaier	u_int32_t	dot3StatsInternalMacTransmitErrors;
96126353Smlaier	u_int32_t	dot3StatsCarrierSenseErrors;
97126353Smlaier	u_int32_t	dot3StatsFrameTooLongs;
98126353Smlaier	u_int32_t	dot3StatsInternalMacReceiveErrors;
99171172Smlaier	u_int32_t	dot3StatsEtherChipSet;
100171172Smlaier	/* Matt Thomas wants this one, not included in RFC 1650: */
101130617Smlaier	u_int32_t	dot3StatsMissedFrames;
102130617Smlaier
103130617Smlaier	u_int32_t	dot3StatsCollFrequencies[16]; /* NB: index origin */
104130617Smlaier
105130617Smlaier	u_int32_t	dot3Compliance;
106130617Smlaier#define	DOT3COMPLIANCE_STATS	1
107126353Smlaier#define	DOT3COMPLIANCE_COLLS	2
108130617Smlaier};
109130617Smlaier
110130617Smlaier/*
111130617Smlaier * Chipset identifiers are normally part of the vendor's enterprise MIB.
112130617Smlaier * However, we don't want to be trying to represent arbitrary-length
113130617Smlaier * OBJECT IDENTIFIERs here (ick!), and the right value is not necessarily
114130617Smlaier * obvious to the driver implementor.  So, we define our own identification
115130617Smlaier * mechanism here, and let the agent writer deal with the translation.
116130617Smlaier */
117130617Smlaier#define	DOT3CHIPSET_VENDOR(x)	((x) >> 16)
118130617Smlaier#define	DOT3CHIPSET_PART(x)	((x) & 0xffff)
119171172Smlaier#define	DOT3CHIPSET(v,p)	(((v) << 16) + ((p) & 0xffff))
120171172Smlaier
121171172Smlaier/* Driver writers!  Add your vendors here! */
122130617Smlaierenum dot3Vendors {
123130617Smlaier	dot3VendorAMD = 1,
124126353Smlaier	dot3VendorIntel = 2,
125126353Smlaier	dot3VendorNational = 4,
126126353Smlaier	dot3VendorFujitsu = 5,
127126353Smlaier	dot3VendorDigital = 6,
128126353Smlaier	dot3VendorWesternDigital = 7
129126353Smlaier};
130126353Smlaier
131126353Smlaier/* Driver writers!  Add your chipsets here! */
132126353Smlaierenum {
133126353Smlaier	dot3ChipSetAMD7990 = 1,
134126353Smlaier	dot3ChipSetAMD79900 = 2,
135126353Smlaier	dot3ChipSetAMD79C940 = 3
136126353Smlaier};
137126353Smlaier
138126353Smlaierenum {
139126353Smlaier	dot3ChipSetIntel82586 = 1,
140126353Smlaier	dot3ChipSetIntel82596 = 2,
141126353Smlaier	dot3ChipSetIntel82557 = 3
142126353Smlaier};
143126353Smlaier
144126353Smlaierenum {
145126353Smlaier	dot3ChipSetNational8390 = 1,
146126353Smlaier	dot3ChipSetNationalSonic = 2
147126353Smlaier};
148126353Smlaier
149126353Smlaierenum {
150126353Smlaier	dot3ChipSetFujitsu86950 = 1
151126353Smlaier};
152126353Smlaier
153126353Smlaierenum {
154126353Smlaier	dot3ChipSetDigitalDC21040 = 1,
155126353Smlaier	dot3ChipSetDigitalDC21140 = 2,
156126353Smlaier	dot3ChipSetDigitalDC21041 = 3,
157126353Smlaier	dot3ChipSetDigitalDC21140A = 4,
158126353Smlaier	dot3ChipSetDigitalDC21142 = 5
159126353Smlaier};
160126353Smlaier
161126353Smlaierenum {
162126353Smlaier	dot3ChipSetWesternDigital83C690 = 1,
163126353Smlaier	dot3ChipSetWesternDigital83C790 = 2
164127024Smlaier};
165127024Smlaier/* END of Ethernet-link MIB stuff */
166127024Smlaier
167126353Smlaier/*
168127024Smlaier * Put other types of interface MIBs here, or in interface-specific
169126353Smlaier * header files if convenient ones already exist.
170126353Smlaier */
171171172Smlaier#endif /* _NET_IF_MIB_H */
172223637Sbz