]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
de355530 A |
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. | |
1c79356b | 11 | * |
de355530 A |
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 | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
de355530 A |
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. | |
1c79356b A |
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 | * | |
9bccf70c | 50 | * $FreeBSD: src/sys/net/if_mib.h,v 1.6 1999/08/28 00:48:19 peter Exp $ |
1c79356b A |
51 | */ |
52 | ||
53 | #ifndef _NET_IF_MIB_H | |
54 | #define _NET_IF_MIB_H 1 | |
9bccf70c | 55 | #include <sys/appleapiopts.h> |
1c79356b | 56 | |
9bccf70c | 57 | #ifdef __APPLE_API_UNSTABLE |
1c79356b A |
58 | struct ifmibdata { |
59 | char ifmd_name[IFNAMSIZ]; /* name of interface */ | |
60 | int ifmd_pcount; /* number of promiscuous listeners */ | |
61 | int ifmd_flags; /* interface flags */ | |
62 | int ifmd_snd_len; /* instantaneous length of send queue */ | |
63 | int ifmd_snd_maxlen; /* maximum length of send queue */ | |
64 | int ifmd_snd_drops; /* number of drops in send queue */ | |
65 | int ifmd_filler[4]; /* for future expansion */ | |
66 | struct if_data ifmd_data; /* generic information and statistics */ | |
67 | }; | |
68 | ||
69 | /* | |
70 | * sysctl MIB tags at the net.link.generic level | |
71 | */ | |
72 | #define IFMIB_SYSTEM 1 /* non-interface-specific */ | |
73 | #define IFMIB_IFDATA 2 /* per-interface data table */ | |
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 | ||
81 | /* | |
82 | * MIB tags at the net.link.generic.system level | |
83 | */ | |
84 | #define IFMIB_IFCOUNT 1 /* number of interfaces configured */ | |
85 | ||
86 | /* | |
87 | * MIB tags as the net.link level | |
88 | * All of the other values are IFT_* names defined in if_types.h. | |
89 | */ | |
90 | #define NETLINK_GENERIC 0 /* functions not specific to a type of iface */ | |
91 | ||
92 | /* | |
93 | * The reason why the IFDATA_LINKSPECIFIC stuff is not under the | |
94 | * net.link.<iftype> branches is twofold: | |
95 | * 1) It's easier to code this way, and doesn't require duplication. | |
96 | * 2) The fourth level under net.link.<iftype> is <pf>; that is to say, | |
97 | * the net.link.<iftype> tree instruments the adaptation layers between | |
98 | * <iftype> and a particular protocol family (e.g., net.link.ether.inet | |
99 | * instruments ARP). This does not really leave room for anything else | |
100 | * that needs to have a well-known number. | |
101 | */ | |
102 | ||
103 | /* | |
104 | * Link-specific MIB structures for various link types. | |
105 | */ | |
106 | ||
107 | /* For IFT_ETHER, IFT_ISO88023, and IFT_STARLAN, as used by RFC 1650 */ | |
108 | struct ifmib_iso_8802_3 { | |
109 | u_int32_t dot3StatsAlignmentErrors; | |
110 | u_int32_t dot3StatsFCSErrors; | |
111 | u_int32_t dot3StatsSingleCollisionFrames; | |
112 | u_int32_t dot3StatsMultipleCollisionFrames; | |
113 | u_int32_t dot3StatsSQETestErrors; | |
114 | u_int32_t dot3StatsDeferredTransmissions; | |
115 | u_int32_t dot3StatsLateCollisions; | |
116 | u_int32_t dot3StatsExcessiveCollisions; | |
117 | u_int32_t dot3StatsInternalMacTransmitErrors; | |
118 | u_int32_t dot3StatsCarrierSenseErrors; | |
119 | u_int32_t dot3StatsFrameTooLongs; | |
120 | u_int32_t dot3StatsInternalMacReceiveErrors; | |
121 | u_int32_t dot3StatsEtherChipSet; | |
122 | /* Matt Thomas wants this one, not included in RFC 1650: */ | |
123 | u_int32_t dot3StatsMissedFrames; | |
124 | ||
125 | u_int32_t dot3StatsCollFrequencies[16]; /* NB: index origin */ | |
126 | ||
127 | u_int32_t dot3Compliance; | |
128 | #define DOT3COMPLIANCE_STATS 1 | |
129 | #define DOT3COMPLIANCE_COLLS 2 | |
130 | }; | |
131 | ||
132 | /* | |
133 | * Chipset identifiers are normally part of the vendor's enterprise MIB. | |
134 | * However, we don't want to be trying to represent arbitrary-length | |
135 | * OBJECT IDENTIFIERs here (ick!), and the right value is not necessarily | |
136 | * obvious to the driver implementor. So, we define our own identification | |
137 | * mechanism here, and let the agent writer deal with the translation. | |
138 | */ | |
139 | #define DOT3CHIPSET_VENDOR(x) ((x) >> 16) | |
140 | #define DOT3CHIPSET_PART(x) ((x) & 0xffff) | |
141 | #define DOT3CHIPSET(v,p) (((v) << 16) + ((p) & 0xffff)) | |
142 | ||
143 | /* Driver writers! Add your vendors here! */ | |
144 | enum dot3Vendors { | |
145 | dot3VendorAMD = 1, | |
146 | dot3VendorIntel = 2, | |
147 | dot3VendorNational = 4, | |
148 | dot3VendorFujitsu = 5, | |
149 | dot3VendorDigital = 6, | |
150 | dot3VendorWesternDigital = 7 | |
151 | }; | |
152 | ||
153 | /* Driver writers! Add your chipsets here! */ | |
154 | enum { | |
155 | dot3ChipSetAMD7990 = 1, | |
156 | dot3ChipSetAMD79900 = 2, | |
157 | dot3ChipSetAMD79C940 = 3 | |
158 | }; | |
159 | ||
160 | enum { | |
161 | dot3ChipSetIntel82586 = 1, | |
162 | dot3ChipSetIntel82596 = 2, | |
163 | dot3ChipSetIntel82557 = 3 | |
164 | }; | |
165 | ||
166 | enum { | |
167 | dot3ChipSetNational8390 = 1, | |
168 | dot3ChipSetNationalSonic = 2 | |
169 | }; | |
170 | ||
171 | enum { | |
172 | dot3ChipSetFujitsu86950 = 1 | |
173 | }; | |
174 | ||
175 | enum { | |
176 | dot3ChipSetDigitalDC21040 = 1, | |
177 | dot3ChipSetDigitalDC21140 = 2, | |
178 | dot3ChipSetDigitalDC21041 = 3, | |
179 | dot3ChipSetDigitalDC21140A = 4, | |
180 | dot3ChipSetDigitalDC21142 = 5 | |
181 | }; | |
182 | ||
183 | enum { | |
184 | dot3ChipSetWesternDigital83C690 = 1, | |
185 | dot3ChipSetWesternDigital83C790 = 2 | |
186 | }; | |
187 | /* END of Ethernet-link MIB stuff */ | |
188 | ||
189 | /* | |
190 | * Put other types of interface MIBs here, or in interface-specific | |
191 | * header files if convenient ones already exist. | |
192 | */ | |
9bccf70c | 193 | #endif /* __APPLE_API_UNSTABLE */ |
1c79356b | 194 | #endif /* _NET_IF_MIB_H */ |