1sg_get_network_iface_stats(3L)ibrary Functions Manuaslg_get_network_iface_stats(3)
2
3
4

NAME

6       sg_get_network_iface_stats - get network interface statistics
7

SYNOPSIS

9       #include <statgrab.h>
10
11
12       sg_network_iface_stats *sg_get_network_iface_stats(int *entries);
13

DESCRIPTION

15       The  sg_get_network_iface_stats  function  takes  a  pointer to an int,
16       entries, which is filled with the  number  of  network  interfaces  the
17       machine  has.  This  is  needed to know how many sg_network_iface_stats
18       structures have been returned. A  pointer  is  returned  to  the  first
19       sg_network_iface_stats.
20
21       sg_get_network_iface_stats  returns statistics about the network inter‐
22       faces in the machine. Specifically, it returns the speed of the  inter‐
23       face, the duplex state, and whether it is currently up.
24

RETURN VALUES

26       The sg_get_network_iface_stats returns a pointer to a structure of type
27       sg_network_iface_stats.
28
29       typedef enum{
30               SG_IFACE_DUPLEX_FULL,
31               SG_IFACE_DUPLEX_HALF,
32               SG_IFACE_DUPLEX_UNKNOWN
33       }sg_iface_duplex;
34
35
36       Note: The SG_IFACE_DUPLEX_UNKNOWN value could mean that  duplex  hasn't
37       been negotiated yet.
38
39       typedef struct{
40               char *interface_name;
41               int speed;
42               sg_iface_duplex duplex;
43               int up;
44       }sg_network_iface_stats;
45
46
47       interface_name
48              The  name known to the operating system.  (eg. on linux it might
49              be eth0)
50
51       speed  The speed of the interface, in megabits/sec.
52
53       duplex The duplex state the interface is in.  See  sg_iface_duplex  for
54              permitted values.
55
56       up     Whether the interface is up.
57

SEE ALSO

59       statgrab(3)
60

WEBSITE

62       http://www.i-scream.org/libstatgrab/
63
64
65
66i-scream                 $Date: 2005/07/13 09:31:5s3g_$get_network_iface_stats(3)
Impressum