ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/docs/get_network_iface_stats.xml
Revision: 1.1
Committed: Sat Mar 6 23:35:20 2004 UTC (20 years, 2 months ago) by tdb
Content type: text/xml
Branch: MAIN
Log Message:
Update documentation to know about the new functions and return data.

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$</date>
10 <releaseinfo>$Id$</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
69 typedef struct{
70 char *interface_name;
71 int speed;
72 statgrab_duplex dup;
73 int up;
74 }network_iface_stat_t;
75 </programlisting>
76
77 <variablelist>
78 <varlistentry>
79 <term>
80 <structfield>interface_name</structfield>
81 </term>
82 <listitem>
83 <para>
84 The name known to the operating system.
85 (eg. on linux it might be eth0)
86 </para>
87 </listitem>
88 </varlistentry>
89 <varlistentry>
90 <term>
91 <structfield>speed</structfield>
92 </term>
93 <listitem>
94 <para>
95 The speed of the interface, in megabits/sec.
96 </para>
97 </listitem>
98 </varlistentry>
99 <varlistentry>
100 <term>
101 <structfield>dup</structfield>
102 </term>
103 <listitem>
104 <para>
105 The duplex state the interface is in. See statgrab_duplex
106 for permitted values.
107 </para>
108 </listitem>
109 </varlistentry>
110 <varlistentry>
111 <term>
112 <structfield>up</structfield>
113 </term>
114 <listitem>
115 <para>
116 Whether the interface is up.
117 </para>
118 </listitem>
119 </varlistentry>
120 </variablelist>
121 </refsect1>
122
123 <refsect1>
124 <title>See Also</title>
125
126 <simplelist type="inline">
127 <member>
128 <citerefentry>
129 <refentrytitle>statgrab</refentrytitle>
130 <manvolnum>3</manvolnum>
131 </citerefentry>
132 </member>
133 </simplelist>
134 </refsect1>
135
136 <refsect1>
137 <title>Website</title>
138
139 <simplelist type="vert">
140 <member>
141 <ulink url="http://www.i-scream.org">http://www.i-scream.org</ulink>
142 </member>
143 </simplelist>
144 </refsect1>
145
146 </refentry>