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