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