⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mib.h

📁 嵌入式操作系统ECOS的网络开发包
💻 H
📖 第 1 页 / 共 2 页
字号:
//==========================================================================
//
//      ./lib/current/include/mib.h
//
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//####UCDSNMPCOPYRIGHTBEGIN####
//
// -------------------------------------------
//
// Portions of this software may have been derived from the UCD-SNMP
// project,  <http://ucd-snmp.ucdavis.edu/>  from the University of
// California at Davis, which was originally based on the Carnegie Mellon
// University SNMP implementation.  Portions of this software are therefore
// covered by the appropriate copyright disclaimers included herein.
//
// The release used was version 4.1.2 of May 2000.  "ucd-snmp-4.1.2"
// -------------------------------------------
//
//####UCDSNMPCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    hmt
// Contributors: hmt
// Date:         2000-05-30
// Purpose:      Port of UCD-SNMP distribution to eCos.
// Description:  
//              
//
//####DESCRIPTIONEND####
//
//==========================================================================
/********************************************************************
       Copyright 1989, 1991, 1992 by Carnegie Mellon University

			  Derivative Work -
Copyright 1996, 1998, 1999, 2000 The Regents of the University of California

			 All Rights Reserved

Permission to use, copy, modify and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appears in all copies and
that both that copyright notice and this permission notice appear in
supporting documentation, and that the name of CMU and The Regents of
the University of California not be used in advertising or publicity
pertaining to distribution of the software without specific written
permission.

CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL CMU OR
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*********************************************************************/
#ifndef MIB_H
#define MIB_H

#ifdef __cplusplus
extern "C" {
#endif
/*
 * mib.h - Definitions for the variables as defined in the MIB
 *
 * Update: 1998-07-17 <jhy@gsu.edu>
 * Added prototypes for print_oid_report* functions.
 */
/***********************************************************
	Copyright 1988, 1989 by Carnegie Mellon University

                      All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of CMU not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/

#ifdef CMU_COMPATIBLE

struct	mib_system {
    char    sysDescr[32];   /* textual description */
    u_char  sysObjectID[16];/* OBJECT IDENTIFIER of system */
    u_char  ObjIDLen;	    /* length of sysObjectID */
    u_int  sysUpTime;	    /* Uptime in 100/s of a second */    
};

struct mib_interface {
    int    ifNumber;	    /* number of interfaces */
};

struct mib_ifEntry {
    int    ifIndex;	    /* index of this interface	*/
    char    ifDescr[32];    /* english description of interface	*/
    int    ifType;	    /* network type of device	*/
    int    ifMtu;	    /* size of largest packet in bytes	*/
    u_int  ifSpeed;	    /* bandwidth in bits/sec	*/
    u_char  ifPhysAddress[11];	/* interface's address */
    u_char  PhysAddrLen;    /* length of physAddr */
    int    ifAdminStatus;  /* desired state of interface */
    int    ifOperStatus;   /* current operational status */
    u_int  ifLastChange;   /* value of sysUpTime when current state entered */
    u_int  ifInOctets;	    /* number of octets received on interface */
    u_int  ifInUcastPkts;  /* number of unicast packets delivered */
    u_int  ifInNUcastPkts; /* number of broadcasts or multicasts */
    u_int  ifInDiscards;   /* number of packets discarded with no error */
    u_int  ifInErrors;	    /* number of packets containing errors */
    u_int  ifInUnknownProtos;	/* number of packets with unknown protocol */
    u_int  ifOutOctets;    /* number of octets transmitted */
    u_int  ifOutUcastPkts; /* number of unicast packets sent */
    u_int  ifOutNUcastPkts;/* number of broadcast or multicast pkts */
    u_int  ifOutDiscards;  /* number of packets discarded with no error */
    u_int  ifOutErrors;    /* number of pkts discarded with an error */
    u_int  ifOutQLen;	    /* number of packets in output queue */
};

struct mib_atEntry {
    int    atIfIndex;	    /* interface on which this entry maps */
    u_char  atPhysAddress[11]; /* physical address of destination */
    u_char  PhysAddressLen; /* length of atPhysAddress */
    u_int  atNetAddress;   /* IP address of physical address */
};

struct mib_ip {
    int    ipForwarding;   /* 1 if gateway, 2 if host */
    int    ipDefaultTTL;   /* default TTL for pkts originating here */
    u_int  ipInReceives;   /* no. of IP packets received from interfaces */
    u_int  ipInHdrErrors;  /* number of pkts discarded due to header errors */
    u_int  ipInAddrErrors; /* no. of pkts discarded due to bad address */
    u_int  ipForwDatagrams;/* number pf pkts forwarded through this entity */
    u_int  ipInUnknownProtos;/* no. of local-addressed pkts w/unknown proto */
    u_int  ipInDiscards;   /* number of error-free packets discarded */
    u_int  ipInDelivers;   /* number of datagrams delivered to upper level */
    u_int  ipOutRequests;  /* number of IP datagrams originating locally */
    u_int  ipOutDiscards;  /* number of error-free output IP pkts discarded */
    u_int  ipOutNoRoutes;  /* number of IP pkts discarded due to no route */
    int    ipReasmTimeout; /* seconds fragment is held awaiting reassembly */
    u_int  ipReasmReqds;   /* no. of fragments needing reassembly (here) */
    u_int  ipReasmOKs;	    /* number of fragments reassembled */
    u_int  ipReasmFails;   /* number of failures in IP reassembly */
    u_int  ipFragOKs;	    /* number of datagrams fragmented here */
    u_int  ipFragFails;    /* no. pkts unable to be fragmented here */
    u_int  ipFragCreates;  /* number of IP fragments created here */
};

struct mib_ipAddrEntry {
    u_int  ipAdEntAddr;    /* IP address of this entry */
    int    ipAdEntIfIndex; /* IF for this entry */
    u_int  ipAdEntNetMask; /* subnet mask of this entry */
    int    ipAdEntBcastAddr;/* read the MIB for this one */
};

struct mib_ipRouteEntry {
    u_int  ipRouteDest;    /* destination IP addr for this route */
    int    ipRouteIfIndex; /* index of local IF for this route */
    int    ipRouteMetric1; /* Primary routing metric */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -