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