1 <?xml version=
"1.0" encoding=
"utf-8"?>
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
23 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook V4.4//EN"
24 "file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
31 <firstname>Joey
</firstname>
32 <surname>Hess
</surname>
34 <date>2006-
03-
07</date>
38 <refentrytitle>ifdata
</refentrytitle>
39 <manvolnum>1</manvolnum>
43 <refname>ifdata
</refname>
44 <refpurpose>get network interface info without
45 parsing ifconfig output
</refpurpose>
50 <command>ifdata
</command>
52 <arg><replaceable>iface
</replaceable></arg>
57 <title>DESCRIPTION
</title>
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.
72 <title>OPTIONS
</title>
77 <term><option>-h
</option></term>
79 <para>Print out a help summary.
</para>
84 <term><option>-e
</option></term>
86 <para>Test to see if the interface exists,
87 exit nonzero if it does not.
</para>
92 <term><option>-p
</option></term>
94 <para>Prints out the whole configuration of
100 <term><option>-pe
</option></term>
102 <para>Prints
"yes" or
"no" if the interface
103 exists or not.
</para>
108 <term><option>-ph
</option></term>
110 <para>Prints the hardware address of the
116 <term><option>-pa
</option></term>
118 <para>Prints the IPv4 address of the
124 <term><option>-pn
</option></term>
126 <para>Prints the netmask of the
132 <term><option>-pN
</option></term>
134 <para>Prints the network address of the
140 <term><option>-pb
</option></term>
142 <para>Prints the broadcast address of the
148 <term><option>-pm
</option></term>
150 <para>Prints the MTU of the interface.
</para>
155 <term><option>-pf
</option></term>
157 <para>Prints the flags of the
163 <term><option>-si
</option></term>
165 <para>Prints out all the input statistics
166 of the interface.
</para>
171 <term><option>-sip
</option></term>
173 <para>Prints the number of input packets.
</para>
178 <term><option>-sib
</option></term>
180 <para>Prints the number of input bytes.
</para>
185 <term><option>-sie
</option></term>
187 <para>Prints the number of input errors.
</para>
192 <term><option>-sid
</option></term>
194 <para>Prints the number of dropped input
200 <term><option>-sif
</option></term>
202 <para>Prints the number of input fifo overruns.
</para>
207 <term><option>-sic
</option></term>
209 <para>Print the number of compressed input
215 <term><option>-sim
</option></term>
217 <para>Prints the number of input
218 multicast packets.
</para>
223 <term><option>-so
</option></term>
225 <para>Prints out all the output statistics
226 of the interface.
</para>
231 <term><option>-sop
</option></term>
233 <para>Prints the number of output packets.
</para>
238 <term><option>-sob
</option></term>
240 <para>Prints the number of output bytes.
</para>
245 <term><option>-soe
</option></term>
247 <para>Prints the number of output errors.
</para>
252 <term><option>-sod
</option></term>
254 <para>Prints the number of dropped
255 output packets.
</para>
260 <term><option>-sof
</option></term>
262 <para>Prints the number of output fifo overruns.
</para>
267 <term><option>-sox
</option></term>
269 <para>Print the number of output collisions.
</para>
274 <term><option>-soc
</option></term>
276 <para>Prints the number of output carrier
282 <term><option>-som
</option></term>
284 <para>Prints the number of output multicast
290 <term><option>-bips
</option></term>
292 <para>Prints the number of bytes of
293 incoming traffic measured in one second.
</para>
298 <term><option>-bops
</option></term>
300 <para>Prints the number of bytes of
301 outgoing traffic measured in one second.
</para>