[uClinux-dev] How to get information about Interface

Ashish Kumar Batwara ashishkb at mindtree.com
Sun Nov 11 23:09:18 EST 2001


Hi TomW,
Pls. see below for the explaination of lastchange in bold letters: It is in
BSD, I want the equivalent in Linux 2.0.38.

*****************************************************************************
*************

SYNOPSIS
     #include <sys/types.h>
     #include <sys/time.h>
     #include <sys/socket.h>
     #include <net/if.h>
     #include <net/if_var.h>
     #include <net/if_types.h>

   The if_data structure
     In 4.4BSD, a subset of the interface information believed to be of
inter-
     est to management stations was segregated from the ifnet structure and
     moved into its own if_data structure to facilitate its use by user pro-
     grams.  The following elements of the if_data structure are initialized
     by the interface and are not expected to change significantly over the
     course of normal operation:

           ifi_type        (u_char) The type of the interface, as defined in
                           <net/if_types.h> and described below in the
                           ``Interface types'' section.

           ifi_physical    (u_char) Intended to represent a selection of
phys-
                           ical layers on devices which support more than
one;
                           never implemented.


           ifi_mtu         (u_long) The maximum transmission unit of the
medi-
                           um, exclusive of any link-layer overhead.

           ifi_metric      (u_long) A dimensionless metric interpreted by a
                           user-mode routing process.

           ifi_baudrate    (u_long) The line rate of the interface, in bits
                           per second.

     The structure additionally contains generic statistics applicable to a
     variety of different interface types (except as noted, all members are
of
     type u_long):

           ifi_ipackets    Number of packets received.

           ifi_ierrors     Number of receive errors detected (e.g., FCS er-
                           rors, DMA overruns, etc.).  More detailed break-
                           downs can often be had by way of a link-specific
                           MIB.

           ifi_opackets    Number of packets transmitted.

           ifi_oerrors     Number of output errors detected (e.g., late
colli-
                           sions, DMA overruns, etc.).  More detailed break-
                           downs can often be had by way of a link-specific
                           MIB.

           ifi_collisions  Total number of collisions detected on output for
                           CSMA interfaces.  (This member is sometimes
                           [ab]used by other types of interfaces for other
                           output error counts.)

           ifi_ibytes      Total traffic received, in bytes.

           ifi_obytes      Total traffic transmitted, in bytes.

           ifi_imcasts     Number of packets received which were sent by
link-
                           layer multicast.

           ifi_omcasts     Number of packets sent by link-layer multicast.

           ifi_iqdrops     Number of packets dropped on input.  Rarely imple-
                           mented.

           ifi_noproto     Number of packets received for unknown
network-lay-
                           er protocol.

           ifi_lastchange  (struct timeval) The time of the last administra-
                           tive change to the interface (as required for
                           SNMP).


Regards

Ashish

-----Original Message-----
From: Tom Walsh [ mailto:tom at cyberiansoftware.com]
Sent: Sunday, November 11, 2001 10:11 PM
To: uclinux-dev at geekcreek.net
Subject: Re: [uClinux-dev] How to get information about Interface


Ashish Kumar Batwara wrote:
>
> Hi Thanks for your reply.
> How can i get the last_change attribute of the inteface?
>

Please explain what "last_change attribute of the inteface" means?  Are
you referring to what is seen at the MSDOS I/O address of 0x3fe?

TomW

--
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------
This message resent by the uclinux-dev at uclinux.org list server
http://www.uClinux.org/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20011112/b83493cb/attachment.html>


More information about the uClinux-dev mailing list