|
NAMEifmib —
Management Information Base for network interfaces
SYNOPSIS#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <net/if.h>
#include <net/if_mib.h>
DESCRIPTIONTheifmib facility is an application of the
sysctl(3)
interface to provide management information about network interfaces to client
applications such as
netstat(1),
slstat(8),
and SNMP management agents. This information is structured as a table, where
each row in the table represents a logical network interface (either a
hardware device or a software pseudo-device like
lo(4)). There
are two columns in the table, each containing a single structure: one column
contains generic information relevant 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 The generic interface information, common to all interfaces, can be accessed via the following procedure: int get_ifmib_general(int row, struct ifmibdata *ifmd) { int name[6]; size_t len; name[0] = CTL_NET; name[1] = PF_LINK; name[2] = NETLINK_GENERIC; name[3] = IFMIB_IFDATA; name[4] = row; name[5] = IFDATA_GENERAL; len = sizeof(*ifmd); return sysctl(name, 6, ifmd, &len, (void *)0, 0); } The fields in
Class-specific information can be retrieved by examining the
SEE ALSOsysctl(3), intro(4), ifnet(9)F. Kastenholz, Definitions of Managed Objects for the Ethernet-like Interface Types Using SMIv2, August 1994, RFC 1650. HISTORYTheifmib interface first appeared in
FreeBSD 2.2.
BUGSMany Ethernet-like interfaces do not yet support the Ethernet MIB. Regardless, all interfaces automatically support the generic MIB.
Visit the GSP FreeBSD Man Page Interface. |