beostat_get_net_dev¶
Name¶
beostat_get_net_dev – get the network interface statistics on a node
Synopsis¶
#include <sys/beostat.h>
int beostat_get_net_dev (int node, struct beostat_net_dev *devs, int size);
Arguments¶
node
The node to query
devs
A pointer to a array of structures of the type
struct beostat_net_dev
, which is defined as follows:struct beostat_net_dev { char name[16]; struct beostat_net_stat recv; unsigned long frame; unsigned long multicast; struct beostat_net_stat trans; unsigned long colls; unsigned long carrier; };
where
beostat_net_stat
is defined as follows:struct beostat_net_stat { unsigned long bytes; unsigned long packets; unsigned long errs; unsigned long drop; unsigned long fifo; unsigned long compressed; };
size
The number of
beostat_net_dev
structures allocated by the caller.
Description¶
beostat_get_net_dev
executes on the master node and returns the
network interface statistics of a node. The caller must allocate the
memory for the array of structures, and a maximum of MAX_NET_DEV
or
size
entries will be filled (whichever is smaller). Unused space in
the structure(s) are filled with zeros.
Examples¶
int i;
struct beostat_net_dev net_dev[MAX_NET_DEV];
beostat_get_net_dev (3, net_dev, MAX_NET_DEV);
for (i = 0; i screen>
Return Value¶
Return 0 on success. If an error occurs, it will return -1.
Errors¶
This function relies on the Beostat
subsystem, which consists of the
proc
filesystem on the remote node, the sendstats
daemon on the
remote node, the recvstats
daemon on the master node, and two shared
memory files in the directory /var/shm
. If any part of the system
breaks down, this function could fail.