ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/docs/sg_get_network_iface_stats.xml
Revision: 1.2
Committed: Tue Mar 9 13:50:24 2004 UTC (20 years, 2 months ago) by tdb
Content type: text/xml
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_9
Changes since 1.1: +9 -2 lines
Log Message:
Mention what UNKNOWN_DUPLEX could mean.

File Contents

# Content
1 <?xml version="1.0"?>
2
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">
7
8 <refentryinfo>
9 <date>$Date: 2004/03/06 23:35:20 $</date>
10 <releaseinfo>$Id: get_network_iface_stats.xml,v 1.1 2004/03/06 23:35:20 tdb Exp $</releaseinfo>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>get_network_iface_stats</refentrytitle>
15 <manvolnum>3</manvolnum>
16 <refmiscinfo>i-scream</refmiscinfo>
17 </refmeta>
18
19 <refnamediv>
20 <refname>get_network_iface_stats</refname>
21 <refpurpose>get network interface statistics</refpurpose>
22 </refnamediv>
23
24 <refsynopsisdiv>
25 <funcsynopsis>
26 <funcsynopsisinfo>#include &lt;statgrab.h&gt;</funcsynopsisinfo>
27 <funcprototype>
28 <funcdef>network_iface_stat_t *<function>get_network_iface_stats</function></funcdef>
29 <paramdef>int *<parameter>entries</parameter></paramdef>
30 </funcprototype>
31 </funcsynopsis>
32 </refsynopsisdiv>
33
34 <refsect1>
35 <title>Description</title>
36 <para>
37 The <function>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
42 been returned. A pointer is returned to the first
43 <structname>network_iface_stat_t</structname>.
44 </para>
45 <para>
46 <function>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
53 <refsect1>
54 <title>Return Values</title>
55
56 <para>
57 The <function>get_network_iface_stats</function> returns a
58 pointer to a structure of type
59 <structname>network_iface_stat_t</structname>.
60 </para>
61
62 <programlisting>
63 typedef enum{
64 FULL_DUPLEX,
65 HALF_DUPLEX,
66 UNKNOWN_DUPLEX
67 }statgrab_duplex;
68 </programlisting>
69
70 <para>
71 Note: The <structfield>UNKNOWN_DUPLEX</structfield> value could mean
72 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;
80 int up;
81 }network_iface_stat_t;
82 </programlisting>
83
84 <variablelist>
85 <varlistentry>
86 <term>
87 <structfield>interface_name</structfield>
88 </term>
89 <listitem>
90 <para>
91 The name known to the operating system.
92 (eg. on linux it might be eth0)
93 </para>
94 </listitem>
95 </varlistentry>
96 <varlistentry>
97 <term>
98 <structfield>speed</structfield>
99 </term>
100 <listitem>
101 <para>
102 The speed of the interface, in megabits/sec.
103 </para>
104 </listitem>
105 </varlistentry>
106 <varlistentry>
107 <term>
108 <structfield>dup</structfield>
109 </term>
110 <listitem>
111 <para>
112 The duplex state the interface is in. See statgrab_duplex
113 for permitted values.
114 </para>
115 </listitem>
116 </varlistentry>
117 <varlistentry>
118 <term>
119 <structfield>up</structfield>
120 </term>
121 <listitem>
122 <para>
123 Whether the interface is up.
124 </para>
125 </listitem>
126 </varlistentry>
127 </variablelist>
128 </refsect1>
129
130 <refsect1>
131 <title>See Also</title>
132
133 <simplelist type="inline">
134 <member>
135 <citerefentry>
136 <refentrytitle>statgrab</refentrytitle>
137 <manvolnum>3</manvolnum>
138 </citerefentry>
139 </member>
140 </simplelist>
141 </refsect1>
142
143 <refsect1>
144 <title>Website</title>
145
146 <simplelist type="vert">
147 <member>
148 <ulink url="http://www.i-scream.org">http://www.i-scream.org</ulink>
149 </member>
150 </simplelist>
151 </refsect1>
152
153 </refentry>