<--previous | contents | next-->

# ifstats - Per-interfaces Statistics

Interface information and traffic statistics.

## Header Files

- include/net/if.h

## Interface

    import openbsd
    n = openbsd.netstat.Netstat()
    print n.ifstats()

## Example Output

The example output below was produced using the building Python pretty-printer. See the netstat parent page for an example of how this is done.

    {
        'enc0': {   'baudrate': 0L,
                    'collisions': 0L,
                    'ibytes': 0L,
                    'ierrors': 0L,
                    'imcasts': 0L,
                    'ipackets': 0L,
                    'iqdrops': 0L,
                    'link_state': 'UNKNOWN',
                    'metric': 0L,
                    'mtu': 1536L,
                    'noproto': 0L,
                    'obytes': 0L,
                    'oerrors': 0L,
                    'omcasts': 0L,
                    'opackets': 0L},
        'fxp0': {   'baudrate': 100000000L,
                    'collisions': 0L,
                    'ibytes': 187751822L,
                    'ierrors': 0L,
                    'imcasts': 1206L,
                    'ipackets': 327092L,
                    'iqdrops': 0L,
                    'link_state': 'UP',
                    'metric': 0L,
                    'mtu': 1500L,
                    'noproto': 0L,
                    'obytes': 128783472L,
                    'oerrors': 0L,
                    'omcasts': 5L,
                    'opackets': 274509L},
        'lo0': {   'baudrate': 0L,
                   'collisions': 0L,
                   'ibytes': 4477971L,
                   'ierrors': 0L,
                   'imcasts': 0L,
                   'ipackets': 5943L,
                   'iqdrops': 0L,
                   'link_state': 'UNKNOWN',
                   'metric': 0L,
                   'mtu': 33224L,
                   'noproto': 0L,
                   'obytes': 4477971L,
                   'oerrors': 0L,
                   'omcasts': 0L,
                   'opackets': 5943L},
        'pflog0': {   'baudrate': 0L,
                      'collisions': 0L,
                      'ibytes': 0L,
                      'ierrors': 0L,
                      'imcasts': 0L,
                      'ipackets': 0L,
                      'iqdrops': 0L,
                      'link_state': 'UNKNOWN',
                      'metric': 0L,
                      'mtu': 33224L,
                      'noproto': 0L,
                      'obytes': 0L,
                      'oerrors': 0L,
                      'omcasts': 0L,
                      'opackets': 0L},
        'pfsync0': {   'baudrate': 0L,
                       'collisions': 0L,
                       'ibytes': 0L,
                       'ierrors': 0L,
                       'imcasts': 0L,
                       'ipackets': 0L,
                       'iqdrops': 0L,
                       'link_state': 'UNKNOWN',
                       'metric': 0L,
                       'mtu': 2020L,
                       'noproto': 0L,
                       'obytes': 0L,
                       'oerrors': 0L,
                       'omcasts': 0L,
                       'opackets': 0L}}

<--previous | contents | next--> | (12/21/04)

PyOpenbsd v0.1 Manual