| 3 |
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
| 4 |
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
| 5 |
|
|
| 6 |
< |
<refentry id="get_network_iface_stats"> |
| 6 |
> |
<refentry id="sg_get_network_iface_stats"> |
| 7 |
|
|
| 8 |
|
<refentryinfo> |
| 9 |
|
<date>$Date$</date> |
| 10 |
|
<releaseinfo>$Id$</releaseinfo> |
| 11 |
|
</refentryinfo> |
| 12 |
< |
|
| 12 |
> |
|
| 13 |
|
<refmeta> |
| 14 |
< |
<refentrytitle>get_network_iface_stats</refentrytitle> |
| 14 |
> |
<refentrytitle>sg_get_network_iface_stats</refentrytitle> |
| 15 |
|
<manvolnum>3</manvolnum> |
| 16 |
|
<refmiscinfo>i-scream</refmiscinfo> |
| 17 |
|
</refmeta> |
| 18 |
< |
|
| 18 |
> |
|
| 19 |
|
<refnamediv> |
| 20 |
< |
<refname>get_network_iface_stats</refname> |
| 20 |
> |
<refname>sg_get_network_iface_stats</refname> |
| 21 |
|
<refpurpose>get network interface statistics</refpurpose> |
| 22 |
|
</refnamediv> |
| 23 |
< |
|
| 23 |
> |
|
| 24 |
|
<refsynopsisdiv> |
| 25 |
|
<funcsynopsis> |
| 26 |
|
<funcsynopsisinfo>#include <statgrab.h></funcsynopsisinfo> |
| 27 |
|
<funcprototype> |
| 28 |
< |
<funcdef>network_iface_stat_t *<function>get_network_iface_stats</function></funcdef> |
| 28 |
> |
<funcdef>sg_network_iface_stats *<function>sg_get_network_iface_stats</function></funcdef> |
| 29 |
|
<paramdef>int *<parameter>entries</parameter></paramdef> |
| 30 |
|
</funcprototype> |
| 31 |
|
</funcsynopsis> |
| 32 |
|
</refsynopsisdiv> |
| 33 |
< |
|
| 33 |
> |
|
| 34 |
|
<refsect1> |
| 35 |
|
<title>Description</title> |
| 36 |
|
<para> |
| 37 |
< |
The <function>get_network_iface_stats</function> function |
| 37 |
> |
The <function>sg_get_network_iface_stats</function> function |
| 38 |
|
takes a pointer to an int, <parameter>entries</parameter>, |
| 39 |
|
which is filled with the number of network interfaces the |
| 40 |
|
machine has. This is needed to know how many |
| 41 |
< |
<structname>network_iface_stat_t</structname> structures have |
| 41 |
> |
<structname>sg_network_iface_stats</structname> structures have |
| 42 |
|
been returned. A pointer is returned to the first |
| 43 |
< |
<structname>network_iface_stat_t</structname>. |
| 43 |
> |
<structname>sg_network_iface_stats</structname>. |
| 44 |
|
</para> |
| 45 |
|
<para> |
| 46 |
< |
<function>get_network_iface_stats</function> returns statistics |
| 46 |
> |
<function>sg_get_network_iface_stats</function> returns statistics |
| 47 |
|
about the network interfaces in the machine. Specifically, |
| 48 |
|
it returns the speed of the interface, the duplex state, and |
| 49 |
|
whether it is currently up. |
| 50 |
|
</para> |
| 51 |
|
</refsect1> |
| 52 |
< |
|
| 52 |
> |
|
| 53 |
|
<refsect1> |
| 54 |
|
<title>Return Values</title> |
| 55 |
|
|
| 56 |
|
<para> |
| 57 |
< |
The <function>get_network_iface_stats</function> returns a |
| 57 |
> |
The <function>sg_get_network_iface_stats</function> returns a |
| 58 |
|
pointer to a structure of type |
| 59 |
< |
<structname>network_iface_stat_t</structname>. |
| 59 |
> |
<structname>sg_network_iface_stats</structname>. |
| 60 |
|
</para> |
| 61 |
|
|
| 62 |
|
<programlisting> |
| 63 |
|
typedef enum{ |
| 64 |
< |
FULL_DUPLEX, |
| 65 |
< |
HALF_DUPLEX, |
| 66 |
< |
UNKNOWN_DUPLEX |
| 67 |
< |
}statgrab_duplex; |
| 64 |
> |
SG_IFACE_DUPLEX_FULL, |
| 65 |
> |
SG_IFACE_DUPLEX_HALF, |
| 66 |
> |
SG_IFACE_DUPLEX_UNKNOWN |
| 67 |
> |
}sg_iface_duplex; |
| 68 |
> |
</programlisting> |
| 69 |
|
|
| 70 |
+ |
<para> |
| 71 |
+ |
Note: The <structfield>SG_IFACE_DUPLEX_UNKNOWN</structfield> |
| 72 |
+ |
value could mean that duplex hasn't been negotiated yet. |
| 73 |
+ |
</para> |
| 74 |
+ |
|
| 75 |
+ |
<programlisting> |
| 76 |
|
typedef struct{ |
| 77 |
|
char *interface_name; |
| 78 |
|
int speed; |
| 79 |
< |
statgrab_duplex dup; |
| 79 |
> |
sg_iface_duplex dup; |
| 80 |
|
int up; |
| 81 |
< |
}network_iface_stat_t; |
| 81 |
> |
}sg_network_iface_stats; |
| 82 |
|
</programlisting> |
| 83 |
|
|
| 84 |
|
<variablelist> |
| 109 |
|
</term> |
| 110 |
|
<listitem> |
| 111 |
|
<para> |
| 112 |
< |
The duplex state the interface is in. See statgrab_duplex |
| 113 |
< |
for permitted values. |
| 112 |
> |
The duplex state the interface is in. See sg_iface_duplex |
| 113 |
> |
for permitted values. |
| 114 |
|
</para> |
| 115 |
|
</listitem> |
| 116 |
|
</varlistentry> |
| 139 |
|
</member> |
| 140 |
|
</simplelist> |
| 141 |
|
</refsect1> |
| 142 |
< |
|
| 142 |
> |
|
| 143 |
|
<refsect1> |
| 144 |
|
<title>Website</title> |
| 145 |
< |
|
| 145 |
> |
|
| 146 |
|
<simplelist type="vert"> |
| 147 |
|
<member> |
| 148 |
< |
<ulink url="http://www.i-scream.org">http://www.i-scream.org</ulink> |
| 148 |
> |
<ulink url="http://www.i-scream.org/libstatgrab/"> |
| 149 |
> |
http://www.i-scream.org/libstatgrab/ |
| 150 |
> |
</ulink> |
| 151 |
|
</member> |
| 152 |
|
</simplelist> |
| 153 |
|
</refsect1> |