fix cleanup on error
[moreutils.git] / ifdata.docbook
blob963943ee1bd1ae2ae3b087663a5e1d6cd961f246
1 <?xml version="1.0" encoding="utf-8"?>
3 <!--
5 Copyright 2006 Joey Hess
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15 Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 -->
23 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
24 "file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
25 []>
27 <refentry>
29 <refentryinfo>
30 <author>
31 <firstname>Joey</firstname>
32 <surname>Hess</surname>
33 </author>
34 <date>2006-03-07</date>
35 </refentryinfo>
37 <refmeta>
38 <refentrytitle>ifdata</refentrytitle>
39 <manvolnum>1</manvolnum>
40 </refmeta>
42 <refnamediv>
43 <refname>ifdata</refname>
44 <refpurpose>get network interface info without
45 parsing ifconfig output</refpurpose>
46 </refnamediv>
48 <refsynopsisdiv>
49 <cmdsynopsis>
50 <command>ifdata</command>
51 <arg>options</arg>
52 <arg choice="req"><replaceable>iface</replaceable></arg>
53 </cmdsynopsis>
54 </refsynopsisdiv>
56 <refsect1>
57 <title>DESCRIPTION</title>
59 <para>
60 <command>ifdata</command> can be used to check for
61 the existence of a network interface, or to get
62 information abut the interface, such as its IP
63 address. Unlike <command>ifconfig</command> or
64 <command>ip</command>, <command>ifdata</command>
65 has simple to parse output that is designed to be
66 easily used by a shell script.
67 </para>
69 </refsect1>
71 <refsect1>
72 <title>OPTIONS</title>
74 <variablelist>
76 <varlistentry>
77 <term><option>-h</option></term>
78 <listitem>
79 <para>Print out a help summary.</para>
80 </listitem>
81 </varlistentry>
83 <varlistentry>
84 <term><option>-e</option></term>
85 <listitem>
86 <para>Test to see if the interface exists,
87 exit nonzero if it does not.</para>
88 </listitem>
89 </varlistentry>
91 <varlistentry>
92 <term><option>-p</option></term>
93 <listitem>
94 <para>Prints out the whole configuration of
95 the interface.</para>
96 </listitem>
97 </varlistentry>
99 <varlistentry>
100 <term><option>-pe</option></term>
101 <listitem>
102 <para>Prints "yes" or "no" if the interface
103 exists or not.</para>
104 </listitem>
105 </varlistentry>
107 <varlistentry>
108 <term><option>-pa</option></term>
109 <listitem>
110 <para>Prints the IPv4 address of the
111 interface.</para>
112 </listitem>
113 </varlistentry>
115 <varlistentry>
116 <term><option>-pn</option></term>
117 <listitem>
118 <para>Prints the netmask of the
119 interface.</para>
120 </listitem>
121 </varlistentry>
123 <varlistentry>
124 <term><option>-pN</option></term>
125 <listitem>
126 <para>Prints the network address of the
127 interface.</para>
128 </listitem>
129 </varlistentry>
131 <varlistentry>
132 <term><option>-pb</option></term>
133 <listitem>
134 <para>Prints the broadcast address of the
135 interface.</para>
136 </listitem>
137 </varlistentry>
139 <varlistentry>
140 <term><option>-pm</option></term>
141 <listitem>
142 <para>Prints the MTU of the interface.</para>
143 </listitem>
144 </varlistentry>
146 </variablelist>
148 <para>Following options are Linux only.</para>
150 <variablelist>
152 <varlistentry>
153 <term><option>-ph</option></term>
154 <listitem>
155 <para>Prints the hardware address of the
156 interface.</para>
157 </listitem>
158 </varlistentry>
160 <varlistentry>
161 <term><option>-pf</option></term>
162 <listitem>
163 <para>Prints the flags of the
164 interface.</para>
165 </listitem>
166 </varlistentry>
168 <varlistentry>
169 <term><option>-si</option></term>
170 <listitem>
171 <para>Prints out all the input statistics
172 of the interface.</para>
173 </listitem>
174 </varlistentry>
176 <varlistentry>
177 <term><option>-sip</option></term>
178 <listitem>
179 <para>Prints the number of input packets.</para>
180 </listitem>
181 </varlistentry>
183 <varlistentry>
184 <term><option>-sib</option></term>
185 <listitem>
186 <para>Prints the number of input bytes.</para>
187 </listitem>
188 </varlistentry>
190 <varlistentry>
191 <term><option>-sie</option></term>
192 <listitem>
193 <para>Prints the number of input errors.</para>
194 </listitem>
195 </varlistentry>
197 <varlistentry>
198 <term><option>-sid</option></term>
199 <listitem>
200 <para>Prints the number of dropped input
201 packets.</para>
202 </listitem>
203 </varlistentry>
205 <varlistentry>
206 <term><option>-sif</option></term>
207 <listitem>
208 <para>Prints the number of input fifo overruns.</para>
209 </listitem>
210 </varlistentry>
212 <varlistentry>
213 <term><option>-sic</option></term>
214 <listitem>
215 <para>Print the number of compressed input
216 packets.</para>
217 </listitem>
218 </varlistentry>
220 <varlistentry>
221 <term><option>-sim</option></term>
222 <listitem>
223 <para>Prints the number of input
224 multicast packets.</para>
225 </listitem>
226 </varlistentry>
228 <varlistentry>
229 <term><option>-so</option></term>
230 <listitem>
231 <para>Prints out all the output statistics
232 of the interface.</para>
233 </listitem>
234 </varlistentry>
236 <varlistentry>
237 <term><option>-sop</option></term>
238 <listitem>
239 <para>Prints the number of output packets.</para>
240 </listitem>
241 </varlistentry>
243 <varlistentry>
244 <term><option>-sob</option></term>
245 <listitem>
246 <para>Prints the number of output bytes.</para>
247 </listitem>
248 </varlistentry>
250 <varlistentry>
251 <term><option>-soe</option></term>
252 <listitem>
253 <para>Prints the number of output errors.</para>
254 </listitem>
255 </varlistentry>
257 <varlistentry>
258 <term><option>-sod</option></term>
259 <listitem>
260 <para>Prints the number of dropped
261 output packets.</para>
262 </listitem>
263 </varlistentry>
265 <varlistentry>
266 <term><option>-sof</option></term>
267 <listitem>
268 <para>Prints the number of output fifo overruns.</para>
269 </listitem>
270 </varlistentry>
272 <varlistentry>
273 <term><option>-sox</option></term>
274 <listitem>
275 <para>Print the number of output collisions.</para>
276 </listitem>
277 </varlistentry>
279 <varlistentry>
280 <term><option>-soc</option></term>
281 <listitem>
282 <para>Prints the number of output carrier
283 losses.</para>
284 </listitem>
285 </varlistentry>
287 <varlistentry>
288 <term><option>-som</option></term>
289 <listitem>
290 <para>Prints the number of output multicast
291 packets.</para>
292 </listitem>
293 </varlistentry>
295 <varlistentry>
296 <term><option>-bips</option></term>
297 <listitem>
298 <para>Prints the number of bytes of
299 incoming traffic measured in one second.</para>
300 </listitem>
301 </varlistentry>
303 <varlistentry>
304 <term><option>-bops</option></term>
305 <listitem>
306 <para>Prints the number of bytes of
307 outgoing traffic measured in one second.</para>
308 </listitem>
309 </varlistentry>
311 </variablelist>
312 </refsect1>
314 <refsect1>
315 <title>AUTHOR</title>
317 <para>
318 Benjamin BAYART
319 </para>
320 </refsect1>
321 </refentry>