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.6
Committed: Mon Apr 25 11:25:47 2005 UTC (19 years ago) by tdb
Content type: text/xml
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -2 lines
State: FILE REMOVED
Log Message:
Move by repocopy the libstatgrab docs in to a subdirectory. This is so
I can create separate directories for statgrab/saidar docs.

File Contents

# User Rev Content
1 tdb 1.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 tdb 1.5 <refentry id="sg_get_network_iface_stats">
7 tdb 1.1
8     <refentryinfo>
9 tdb 1.6 <date>$Date: 2004/05/02 17:21:35 $</date>
10     <releaseinfo>$Id: sg_get_network_iface_stats.xml,v 1.5 2004/05/02 17:21:35 tdb Exp $</releaseinfo>
11 tdb 1.1 </refentryinfo>
12 tdb 1.5
13 tdb 1.1 <refmeta>
14 tdb 1.5 <refentrytitle>sg_get_network_iface_stats</refentrytitle>
15 tdb 1.1 <manvolnum>3</manvolnum>
16     <refmiscinfo>i-scream</refmiscinfo>
17     </refmeta>
18 tdb 1.5
19 tdb 1.1 <refnamediv>
20 tdb 1.5 <refname>sg_get_network_iface_stats</refname>
21 tdb 1.1 <refpurpose>get network interface statistics</refpurpose>
22     </refnamediv>
23 tdb 1.5
24 tdb 1.1 <refsynopsisdiv>
25     <funcsynopsis>
26     <funcsynopsisinfo>#include &lt;statgrab.h&gt;</funcsynopsisinfo>
27     <funcprototype>
28 tdb 1.5 <funcdef>sg_network_iface_stats *<function>sg_get_network_iface_stats</function></funcdef>
29 tdb 1.1 <paramdef>int *<parameter>entries</parameter></paramdef>
30     </funcprototype>
31     </funcsynopsis>
32     </refsynopsisdiv>
33 tdb 1.5
34 tdb 1.1 <refsect1>
35     <title>Description</title>
36     <para>
37 tdb 1.5 The <function>sg_get_network_iface_stats</function> function
38 tdb 1.1 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 tdb 1.5 <structname>sg_network_iface_stats</structname> structures have
42 tdb 1.1 been returned. A pointer is returned to the first
43 tdb 1.5 <structname>sg_network_iface_stats</structname>.
44 tdb 1.1 </para>
45     <para>
46 tdb 1.5 <function>sg_get_network_iface_stats</function> returns statistics
47 tdb 1.1 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 tdb 1.5
53 tdb 1.1 <refsect1>
54     <title>Return Values</title>
55    
56     <para>
57 tdb 1.5 The <function>sg_get_network_iface_stats</function> returns a
58 tdb 1.1 pointer to a structure of type
59 tdb 1.5 <structname>sg_network_iface_stats</structname>.
60 tdb 1.1 </para>
61    
62     <programlisting>
63     typedef enum{
64 tdb 1.5 SG_IFACE_DUPLEX_FULL,
65     SG_IFACE_DUPLEX_HALF,
66     SG_IFACE_DUPLEX_UNKNOWN
67     }sg_iface_duplex;
68 tdb 1.2 </programlisting>
69 tdb 1.1
70 tdb 1.2 <para>
71 tdb 1.5 Note: The <structfield>SG_IFACE_DUPLEX_UNKNOWN</structfield>
72     value could mean that duplex hasn't been negotiated yet.
73 tdb 1.2 </para>
74    
75     <programlisting>
76 tdb 1.1 typedef struct{
77     char *interface_name;
78     int speed;
79 tdb 1.5 sg_iface_duplex dup;
80 tdb 1.1 int up;
81 tdb 1.5 }sg_network_iface_stats;
82 tdb 1.1 </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 tdb 1.5 The duplex state the interface is in. See sg_iface_duplex
113     for permitted values.
114 tdb 1.1 </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 tdb 1.5
143 tdb 1.1 <refsect1>
144     <title>Website</title>
145 tdb 1.5
146 tdb 1.1 <simplelist type="vert">
147     <member>
148 tdb 1.3 <ulink url="http://www.i-scream.org/libstatgrab/">
149     http://www.i-scream.org/libstatgrab/
150     </ulink>
151 tdb 1.1 </member>
152     </simplelist>
153     </refsect1>
154    
155     </refentry>