| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
|
| 3 |
<!-- |
| 4 |
|
| 5 |
Copyright 2006 Joey Hess |
| 6 |
|
| 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. |
| 11 |
|
| 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. |
| 16 |
|
| 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 |
| 20 |
|
| 21 |
--> |
| 22 |
|
| 23 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" |
| 24 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" |
| 25 |
[]> |
| 26 |
|
| 27 |
<refentry> |
| 28 |
|
| 29 |
<refentryinfo> |
| 30 |
<author> |
| 31 |
<firstname>Joey</firstname> |
| 32 |
<surname>Hess</surname> |
| 33 |
</author> |
| 34 |
<date>2006-03-07</date> |
| 35 |
</refentryinfo> |
| 36 |
|
| 37 |
<refmeta> |
| 38 |
<refentrytitle>ifdata</refentrytitle> |
| 39 |
<manvolnum>1</manvolnum> |
| 40 |
<refmiscinfo class="manual">moreutils</refmiscinfo> |
| 41 |
<refmiscinfo class="source">moreutils</refmiscinfo> |
| 42 |
</refmeta> |
| 43 |
|
| 44 |
<refnamediv> |
| 45 |
<refname>ifdata</refname> |
| 46 |
<refpurpose>get network interface info without |
| 47 |
parsing ifconfig output</refpurpose> |
| 48 |
</refnamediv> |
| 49 |
|
| 50 |
<refsynopsisdiv> |
| 51 |
<cmdsynopsis> |
| 52 |
<command>ifdata</command> |
| 53 |
<arg>options</arg> |
| 54 |
<arg choice="req"><replaceable>iface</replaceable></arg> |
| 55 |
</cmdsynopsis> |
| 56 |
</refsynopsisdiv> |
| 57 |
|
| 58 |
<refsect1> |
| 59 |
<title>DESCRIPTION</title> |
| 60 |
|
| 61 |
<para> |
| 62 |
<command>ifdata</command> can be used to check for |
| 63 |
the existence of a network interface, or to get |
| 64 |
information about the interface, such as its IP |
| 65 |
address. Unlike <command>ifconfig</command> or |
| 66 |
<command>ip</command>, <command>ifdata</command> |
| 67 |
has simple to parse output that is designed to be |
| 68 |
easily used by a shell script. |
| 69 |
</para> |
| 70 |
|
| 71 |
</refsect1> |
| 72 |
|
| 73 |
<refsect1> |
| 74 |
<title>OPTIONS</title> |
| 75 |
|
| 76 |
<variablelist> |
| 77 |
|
| 78 |
<varlistentry> |
| 79 |
<term><option>-h</option></term> |
| 80 |
<listitem> |
| 81 |
<para>Print out a help summary.</para> |
| 82 |
</listitem> |
| 83 |
</varlistentry> |
| 84 |
|
| 85 |
<varlistentry> |
| 86 |
<term><option>-e</option></term> |
| 87 |
<listitem> |
| 88 |
<para>Test to see if the interface exists, |
| 89 |
exit nonzero if it does not.</para> |
| 90 |
</listitem> |
| 91 |
</varlistentry> |
| 92 |
|
| 93 |
<varlistentry> |
| 94 |
<term><option>-p</option></term> |
| 95 |
<listitem> |
| 96 |
<para>Prints out the whole configuration of |
| 97 |
the interface.</para> |
| 98 |
</listitem> |
| 99 |
</varlistentry> |
| 100 |
|
| 101 |
<varlistentry> |
| 102 |
<term><option>-pe</option></term> |
| 103 |
<listitem> |
| 104 |
<para>Prints "yes" or "no" if the interface |
| 105 |
exists or not.</para> |
| 106 |
</listitem> |
| 107 |
</varlistentry> |
| 108 |
|
| 109 |
<varlistentry> |
| 110 |
<term><option>-pa</option></term> |
| 111 |
<listitem> |
| 112 |
<para>Prints the IPv4 address of the |
| 113 |
interface.</para> |
| 114 |
</listitem> |
| 115 |
</varlistentry> |
| 116 |
|
| 117 |
<varlistentry> |
| 118 |
<term><option>-pn</option></term> |
| 119 |
<listitem> |
| 120 |
<para>Prints the netmask of the |
| 121 |
interface.</para> |
| 122 |
</listitem> |
| 123 |
</varlistentry> |
| 124 |
|
| 125 |
<varlistentry> |
| 126 |
<term><option>-pN</option></term> |
| 127 |
<listitem> |
| 128 |
<para>Prints the network address of the |
| 129 |
interface.</para> |
| 130 |
</listitem> |
| 131 |
</varlistentry> |
| 132 |
|
| 133 |
<varlistentry> |
| 134 |
<term><option>-pb</option></term> |
| 135 |
<listitem> |
| 136 |
<para>Prints the broadcast address of the |
| 137 |
interface.</para> |
| 138 |
</listitem> |
| 139 |
</varlistentry> |
| 140 |
|
| 141 |
<varlistentry> |
| 142 |
<term><option>-pm</option></term> |
| 143 |
<listitem> |
| 144 |
<para>Prints the MTU of the interface.</para> |
| 145 |
</listitem> |
| 146 |
</varlistentry> |
| 147 |
|
| 148 |
</variablelist> |
| 149 |
|
| 150 |
<para>Following options are Linux only.</para> |
| 151 |
|
| 152 |
<variablelist> |
| 153 |
|
| 154 |
<varlistentry> |
| 155 |
<term><option>-ph</option></term> |
| 156 |
<listitem> |
| 157 |
<para>Prints the hardware address of the |
| 158 |
interface. Exit with a failure exit code |
| 159 |
if there is not hardware address for the |
| 160 |
given network interface. |
| 161 |
</para> |
| 162 |
</listitem> |
| 163 |
</varlistentry> |
| 164 |
|
| 165 |
<varlistentry> |
| 166 |
<term><option>-pf</option></term> |
| 167 |
<listitem> |
| 168 |
<para>Prints the flags of the |
| 169 |
interface.</para> |
| 170 |
</listitem> |
| 171 |
</varlistentry> |
| 172 |
|
| 173 |
<varlistentry> |
| 174 |
<term><option>-si</option></term> |
| 175 |
<listitem> |
| 176 |
<para>Prints out all the input statistics |
| 177 |
of the interface.</para> |
| 178 |
</listitem> |
| 179 |
</varlistentry> |
| 180 |
|
| 181 |
<varlistentry> |
| 182 |
<term><option>-sip</option></term> |
| 183 |
<listitem> |
| 184 |
<para>Prints the number of input packets.</para> |
| 185 |
</listitem> |
| 186 |
</varlistentry> |
| 187 |
|
| 188 |
<varlistentry> |
| 189 |
<term><option>-sib</option></term> |
| 190 |
<listitem> |
| 191 |
<para>Prints the number of input bytes.</para> |
| 192 |
</listitem> |
| 193 |
</varlistentry> |
| 194 |
|
| 195 |
<varlistentry> |
| 196 |
<term><option>-sie</option></term> |
| 197 |
<listitem> |
| 198 |
<para>Prints the number of input errors.</para> |
| 199 |
</listitem> |
| 200 |
</varlistentry> |
| 201 |
|
| 202 |
<varlistentry> |
| 203 |
<term><option>-sid</option></term> |
| 204 |
<listitem> |
| 205 |
<para>Prints the number of dropped input |
| 206 |
packets.</para> |
| 207 |
</listitem> |
| 208 |
</varlistentry> |
| 209 |
|
| 210 |
<varlistentry> |
| 211 |
<term><option>-sif</option></term> |
| 212 |
<listitem> |
| 213 |
<para>Prints the number of input fifo overruns.</para> |
| 214 |
</listitem> |
| 215 |
</varlistentry> |
| 216 |
|
| 217 |
<varlistentry> |
| 218 |
<term><option>-sic</option></term> |
| 219 |
<listitem> |
| 220 |
<para>Print the number of compressed input |
| 221 |
packets.</para> |
| 222 |
</listitem> |
| 223 |
</varlistentry> |
| 224 |
|
| 225 |
<varlistentry> |
| 226 |
<term><option>-sim</option></term> |
| 227 |
<listitem> |
| 228 |
<para>Prints the number of input |
| 229 |
multicast packets.</para> |
| 230 |
</listitem> |
| 231 |
</varlistentry> |
| 232 |
|
| 233 |
<varlistentry> |
| 234 |
<term><option>-so</option></term> |
| 235 |
<listitem> |
| 236 |
<para>Prints out all the output statistics |
| 237 |
of the interface.</para> |
| 238 |
</listitem> |
| 239 |
</varlistentry> |
| 240 |
|
| 241 |
<varlistentry> |
| 242 |
<term><option>-sop</option></term> |
| 243 |
<listitem> |
| 244 |
<para>Prints the number of output packets.</para> |
| 245 |
</listitem> |
| 246 |
</varlistentry> |
| 247 |
|
| 248 |
<varlistentry> |
| 249 |
<term><option>-sob</option></term> |
| 250 |
<listitem> |
| 251 |
<para>Prints the number of output bytes.</para> |
| 252 |
</listitem> |
| 253 |
</varlistentry> |
| 254 |
|
| 255 |
<varlistentry> |
| 256 |
<term><option>-soe</option></term> |
| 257 |
<listitem> |
| 258 |
<para>Prints the number of output errors.</para> |
| 259 |
</listitem> |
| 260 |
</varlistentry> |
| 261 |
|
| 262 |
<varlistentry> |
| 263 |
<term><option>-sod</option></term> |
| 264 |
<listitem> |
| 265 |
<para>Prints the number of dropped |
| 266 |
output packets.</para> |
| 267 |
</listitem> |
| 268 |
</varlistentry> |
| 269 |
|
| 270 |
<varlistentry> |
| 271 |
<term><option>-sof</option></term> |
| 272 |
<listitem> |
| 273 |
<para>Prints the number of output fifo overruns.</para> |
| 274 |
</listitem> |
| 275 |
</varlistentry> |
| 276 |
|
| 277 |
<varlistentry> |
| 278 |
<term><option>-sox</option></term> |
| 279 |
<listitem> |
| 280 |
<para>Print the number of output collisions.</para> |
| 281 |
</listitem> |
| 282 |
</varlistentry> |
| 283 |
|
| 284 |
<varlistentry> |
| 285 |
<term><option>-soc</option></term> |
| 286 |
<listitem> |
| 287 |
<para>Prints the number of output carrier |
| 288 |
losses.</para> |
| 289 |
</listitem> |
| 290 |
</varlistentry> |
| 291 |
|
| 292 |
<varlistentry> |
| 293 |
<term><option>-som</option></term> |
| 294 |
<listitem> |
| 295 |
<para>Prints the number of output multicast |
| 296 |
packets.</para> |
| 297 |
</listitem> |
| 298 |
</varlistentry> |
| 299 |
|
| 300 |
<varlistentry> |
| 301 |
<term><option>-bips</option></term> |
| 302 |
<listitem> |
| 303 |
<para>Prints the number of bytes of |
| 304 |
incoming traffic measured in one second.</para> |
| 305 |
</listitem> |
| 306 |
</varlistentry> |
| 307 |
|
| 308 |
<varlistentry> |
| 309 |
<term><option>-bops</option></term> |
| 310 |
<listitem> |
| 311 |
<para>Prints the number of bytes of |
| 312 |
outgoing traffic measured in one second.</para> |
| 313 |
</listitem> |
| 314 |
</varlistentry> |
| 315 |
|
| 316 |
</variablelist> |
| 317 |
</refsect1> |
| 318 |
|
| 319 |
<refsect1> |
| 320 |
<title>AUTHOR</title> |
| 321 |
|
| 322 |
<para> |
| 323 |
Benjamin BAYART |
| 324 |
</para> |
| 325 |
</refsect1> |
| 326 |
</refentry> |