ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/docs/libstatgrab/sg_get_network_iface_stats.xml
Revision: 1.7
Committed: Wed Jul 13 09:31:53 2005 UTC (18 years, 9 months ago) by tdb
Content type: text/xml
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_17, LIBSTATGRAB_0_16, LIBSTATGRAB_0_15, LIBSTATGRAB_0_14, LIBSTATGRAB_0_13, LIBSTATGRAB_0_12, HEAD
Changes since 1.6: +4 -4 lines
Log Message:
Change the name of the duplex value from "dup" to "duplex". This will
break the ABI, but we're changing the fs stats anyway. The API change
is minimal, so hopefully won't affect too many people.

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="sg_get_network_iface_stats">
7
8 <refentryinfo>
9 <date>$Date: 2005/04/25 11:25:45 $</date>
10 <releaseinfo>$Id: sg_get_network_iface_stats.xml,v 1.6 2005/04/25 11:25:45 tdb Exp $</releaseinfo>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>sg_get_network_iface_stats</refentrytitle>
15 <manvolnum>3</manvolnum>
16 <refmiscinfo>i-scream</refmiscinfo>
17 </refmeta>
18
19 <refnamediv>
20 <refname>sg_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>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
34 <refsect1>
35 <title>Description</title>
36 <para>
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>sg_network_iface_stats</structname> structures have
42 been returned. A pointer is returned to the first
43 <structname>sg_network_iface_stats</structname>.
44 </para>
45 <para>
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
53 <refsect1>
54 <title>Return Values</title>
55
56 <para>
57 The <function>sg_get_network_iface_stats</function> returns a
58 pointer to a structure of type
59 <structname>sg_network_iface_stats</structname>.
60 </para>
61
62 <programlisting>
63 typedef enum{
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 sg_iface_duplex duplex;
80 int up;
81 }sg_network_iface_stats;
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>duplex</structfield>
109 </term>
110 <listitem>
111 <para>
112 The duplex state the interface is in. See sg_iface_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/libstatgrab/">
149 http://www.i-scream.org/libstatgrab/
150 </ulink>
151 </member>
152 </simplelist>
153 </refsect1>
154
155 </refentry>