1139823Simp/*- 217352Swollman * Copyright 1996 Massachusetts Institute of Technology 317352Swollman * 417352Swollman * Permission to use, copy, modify, and distribute this software and 517352Swollman * its documentation for any purpose and without fee is hereby 617352Swollman * granted, provided that both the above copyright notice and this 717352Swollman * permission notice appear in all copies, that both the above 817352Swollman * copyright notice and this permission notice appear in all 917352Swollman * supporting documentation, and that the name of M.I.T. not be used 1017352Swollman * in advertising or publicity pertaining to distribution of the 1117352Swollman * software without specific, written prior permission. M.I.T. makes 1217352Swollman * no representations about the suitability of this software for any 1317352Swollman * purpose. It is provided "as is" without express or implied 1417352Swollman * warranty. 1517352Swollman * 1617352Swollman * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS 1717352Swollman * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, 1817352Swollman * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1917352Swollman * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 2017352Swollman * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2117352Swollman * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2217352Swollman * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2317352Swollman * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2417352Swollman * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2517352Swollman * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2617352Swollman * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2717352Swollman * SUCH DAMAGE. 2817352Swollman * 2950477Speter * $FreeBSD$ 3017352Swollman */ 3117352Swollman 3217352Swollman#ifndef _NET_IF_MIB_H 3317352Swollman#define _NET_IF_MIB_H 1 3417352Swollman 3517352Swollmanstruct ifmibdata { 3617352Swollman char ifmd_name[IFNAMSIZ]; /* name of interface */ 3717352Swollman int ifmd_pcount; /* number of promiscuous listeners */ 3817352Swollman int ifmd_flags; /* interface flags */ 3917352Swollman int ifmd_snd_len; /* instantaneous length of send queue */ 4017352Swollman int ifmd_snd_maxlen; /* maximum length of send queue */ 4117352Swollman int ifmd_snd_drops; /* number of drops in send queue */ 4217871Swollman int ifmd_filler[4]; /* for future expansion */ 4317871Swollman struct if_data ifmd_data; /* generic information and statistics */ 4417352Swollman}; 4517352Swollman 4617352Swollman/* 4717352Swollman * sysctl MIB tags at the net.link.generic level 4817352Swollman */ 4917352Swollman#define IFMIB_SYSTEM 1 /* non-interface-specific */ 5017352Swollman#define IFMIB_IFDATA 2 /* per-interface data table */ 5117352Swollman 5217352Swollman/* 5317352Swollman * MIB tags for the various net.link.generic.ifdata tables 5417352Swollman */ 5517352Swollman#define IFDATA_GENERAL 1 /* generic stats for all kinds of ifaces */ 5617352Swollman#define IFDATA_LINKSPECIFIC 2 /* specific to the type of interface */ 57154023Sharti#define IFDATA_DRIVERNAME 3 /* driver name and unit */ 5817352Swollman 5917352Swollman/* 6017352Swollman * MIB tags at the net.link.generic.system level 6117352Swollman */ 6217352Swollman#define IFMIB_IFCOUNT 1 /* number of interfaces configured */ 6317352Swollman 6417352Swollman/* 6517352Swollman * MIB tags as the net.link level 6617352Swollman * All of the other values are IFT_* names defined in if_types.h. 6717352Swollman */ 6817352Swollman#define NETLINK_GENERIC 0 /* functions not specific to a type of iface */ 6917352Swollman 7017352Swollman/* 7117352Swollman * The reason why the IFDATA_LINKSPECIFIC stuff is not under the 7217352Swollman * net.link.<iftype> branches is twofold: 7317352Swollman * 1) It's easier to code this way, and doesn't require duplication. 7417352Swollman * 2) The fourth level under net.link.<iftype> is <pf>; that is to say, 7517352Swollman * the net.link.<iftype> tree instruments the adaptation layers between 7617352Swollman * <iftype> and a particular protocol family (e.g., net.link.ether.inet 7717352Swollman * instruments ARP). This does not really leave room for anything else 7817352Swollman * that needs to have a well-known number. 7917352Swollman */ 8017871Swollman 8117871Swollman/* 8217871Swollman * Link-specific MIB structures for various link types. 8317871Swollman */ 8417871Swollman 8517871Swollman/* For IFT_ETHER, IFT_ISO88023, and IFT_STARLAN, as used by RFC 1650 */ 8617871Swollmanstruct ifmib_iso_8802_3 { 8717871Swollman u_int32_t dot3StatsAlignmentErrors; 8817871Swollman u_int32_t dot3StatsFCSErrors; 8917871Swollman u_int32_t dot3StatsSingleCollisionFrames; 9017871Swollman u_int32_t dot3StatsMultipleCollisionFrames; 9117871Swollman u_int32_t dot3StatsSQETestErrors; 9217871Swollman u_int32_t dot3StatsDeferredTransmissions; 9317871Swollman u_int32_t dot3StatsLateCollisions; 9417871Swollman u_int32_t dot3StatsExcessiveCollisions; 9517871Swollman u_int32_t dot3StatsInternalMacTransmitErrors; 9617871Swollman u_int32_t dot3StatsCarrierSenseErrors; 9717871Swollman u_int32_t dot3StatsFrameTooLongs; 9817871Swollman u_int32_t dot3StatsInternalMacReceiveErrors; 9917871Swollman u_int32_t dot3StatsEtherChipSet; 10017871Swollman /* Matt Thomas wants this one, not included in RFC 1650: */ 10117871Swollman u_int32_t dot3StatsMissedFrames; 10217871Swollman 10317871Swollman u_int32_t dot3StatsCollFrequencies[16]; /* NB: index origin */ 10417871Swollman 10517871Swollman u_int32_t dot3Compliance; 10617871Swollman#define DOT3COMPLIANCE_STATS 1 10717871Swollman#define DOT3COMPLIANCE_COLLS 2 10817871Swollman}; 10917871Swollman 11017871Swollman/* 11117871Swollman * Chipset identifiers are normally part of the vendor's enterprise MIB. 11217871Swollman * However, we don't want to be trying to represent arbitrary-length 11317871Swollman * OBJECT IDENTIFIERs here (ick!), and the right value is not necessarily 11417871Swollman * obvious to the driver implementor. So, we define our own identification 11517871Swollman * mechanism here, and let the agent writer deal with the translation. 11617871Swollman */ 11717871Swollman#define DOT3CHIPSET_VENDOR(x) ((x) >> 16) 11817871Swollman#define DOT3CHIPSET_PART(x) ((x) & 0xffff) 11917871Swollman#define DOT3CHIPSET(v,p) (((v) << 16) + ((p) & 0xffff)) 12017871Swollman 12117871Swollman/* Driver writers! Add your vendors here! */ 12217871Swollmanenum dot3Vendors { 12317871Swollman dot3VendorAMD = 1, 12417871Swollman dot3VendorIntel = 2, 12517871Swollman dot3VendorNational = 4, 12617871Swollman dot3VendorFujitsu = 5, 12717871Swollman dot3VendorDigital = 6, 12820653Sbde dot3VendorWesternDigital = 7 12917871Swollman}; 13017871Swollman 13117871Swollman/* Driver writers! Add your chipsets here! */ 13217871Swollmanenum { 13317871Swollman dot3ChipSetAMD7990 = 1, 13417871Swollman dot3ChipSetAMD79900 = 2, 13517871Swollman dot3ChipSetAMD79C940 = 3 13617871Swollman}; 13717871Swollman 13817871Swollmanenum { 13917871Swollman dot3ChipSetIntel82586 = 1, 14017871Swollman dot3ChipSetIntel82596 = 2, 14117871Swollman dot3ChipSetIntel82557 = 3 14217871Swollman}; 14317871Swollman 14417871Swollmanenum { 14517871Swollman dot3ChipSetNational8390 = 1, 14617871Swollman dot3ChipSetNationalSonic = 2 14717871Swollman}; 14817871Swollman 14917871Swollmanenum { 15017871Swollman dot3ChipSetFujitsu86950 = 1 15117871Swollman}; 15217871Swollman 15317871Swollmanenum { 15417871Swollman dot3ChipSetDigitalDC21040 = 1, 15517871Swollman dot3ChipSetDigitalDC21140 = 2, 15617871Swollman dot3ChipSetDigitalDC21041 = 3, 15717871Swollman dot3ChipSetDigitalDC21140A = 4, 15817871Swollman dot3ChipSetDigitalDC21142 = 5 15917871Swollman}; 16017871Swollman 16117871Swollmanenum { 16217871Swollman dot3ChipSetWesternDigital83C690 = 1, 16317871Swollman dot3ChipSetWesternDigital83C790 = 2 16417871Swollman}; 16517871Swollman/* END of Ethernet-link MIB stuff */ 16617871Swollman 16717871Swollman/* 16817871Swollman * Put other types of interface MIBs here, or in interface-specific 16917871Swollman * header files if convenient ones already exist. 17017871Swollman */ 17117352Swollman#endif /* _NET_IF_MIB_H */ 172