MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
IFMIB(4)                 BSD Kernel Interfaces Manual                 IFMIB(4)

NAME
     ifmib -- Management Information Base for network interfaces

SYNOPSIS
     ##include <>
     ##include <>
     ##include <>
     ##include <>
     ##include <>
     ##include <>

DESCRIPTION
     The ifmib facility is an application of the sysctl(3) interface to pro-
     vide management information about network interfaces to client applica-
     tions such as netstat(1), slstat(8), and SNMP management agents.  This
     information is structured as a table, where each row in the table repre-
     sents a logical network interface (either a hardware device or a software
     pseudo-device like lo(4)).  There are two columns in the table, each con-
     taining a single structure: one column contains generic information rele-
     vant to all interfaces, and the other contains information specific to
     the particular class of interface.  (Generally the latter will implement
     the SNMP MIB defined for that particular interface class, if one exists
     and can be implemented in the kernel.)

     The ifmib facility is accessed via the ``net.link.generic'' branch of the
     sysctl(3) MIB.  The manifest constants for each level in the sysctl(3)
     name are defined in .  The index of the last row in the ta-
     ble is given by ``net.link.generic.system.ifcount'' (or, using the mani-
     fest constants, CTLNET, PFLINK, NETLINKGENERIC, IFMIBSYSTEM,
     IFMIBIFCOUNT).  A management application searching for a particular
     interface should start with row 1 and continue through the table row-by-
     row until the desired interface is found, or the interface count is
     reached.  Note that the table may be sparse, i.e., a given row may not
     exist, indicated by an errno of ENOENT.  Such an error should be ignored,
     and the next row should be checked.

     The generic interface information, common to all interfaces, can be
     accessed via the following procedure:

           int
           getifmibgeneral(int row, struct ifmibdata *ifmd)
           {
                   int name[6];
                   sizet len;

                   name[0] = CTLNET;
                   name[1] = PFLINK;
                   name[2] = NETLINKGENERIC;
                   name[3] = IFMIBIFDATA;
                   name[4] = row;
                   name[5] = IFDATAGENERAL;

                   len = sizeof(*ifmd);

                   return sysctl(name, 6, ifmd, &len, (void *)0, 0);
           }

     The fields in struct ifmibdata are as follows:

     ifmdname       (char []) the name of the interface, including the unit
                     number

     ifmdpcount     (int) the number of promiscuous listeners

     ifmdflags      (int) the interface's flags (defined in )

     ifmdsndlen    (int) the current instantaneous length of the send queue

     ifmdsnddrops  (int) the number of packets dropped at this interface
                     because the send queue was full

     ifmddata       (struct ifdata) more information from a structure
                     defined in  (see ifdata(9))

     Class-specific information can be retrieved by examining the
     IFDATALINKSPECIFIC column instead.  Note that the form and length of the
     structure will depend on the class of interface.  For IFTETHER,
     IFTISO88023, and IFTSTARLAN interfaces, the structure is called
     ``struct ifmibiso88023'' (defined in ), and implements a
     superset of the RFC 1650 MIB for Ethernet-like networks.  For IFTSLIP,
     the structure is a ``struct slsoftc'' ().

SEE ALSO
     sysctl(3), intro(4), ifnet(9)

     F. Kastenholz, Definitions of Managed Objects for the Ethernet-like
     Interface Types Using SMIv2, August 1994, RFC 1650.

BUGS
     Many Ethernet-like interfaces do not yet support the Ethernet MIB; the
     interfaces known to support it include ed(4) and de(4).  Regardless, all
     interfaces automatically support the generic MIB.

HISTORY
     The ifmib interface first appeared in FreeBSD 2.2.

BSD                            November 15, 1996                           BSD
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™