blob: 2825e091014423f45ffe666a7379175b3dc5e7b5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
'\" t
.\" Title: ifdata
.\" Author: Joey Hess
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 2006-03-07
.\" Manual: moreutils
.\" Source: moreutils
.\" Language: English
.\"
.TH "IFDATA" "1" "2006\-03\-07" "moreutils" "moreutils"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ifdata \- get network interface info without parsing ifconfig output
.SH "SYNOPSIS"
.HP \w'\fBifdata\fR\ 'u
\fBifdata\fR [options] {\fIiface\fR}
.SH "DESCRIPTION"
.PP
\fBifdata\fR
can be used to check for the existence of a network interface, or to get information about the interface, such as its IP address\&. Unlike
\fBifconfig\fR
or
\fBip\fR,
\fBifdata\fR
has simple to parse output that is designed to be easily used by a shell script\&.
.SH "OPTIONS"
.PP
\fB\-h\fR
.RS 4
Print out a help summary\&.
.RE
.PP
\fB\-e\fR
.RS 4
Test to see if the interface exists, exit nonzero if it does not\&.
.RE
.PP
\fB\-p\fR
.RS 4
Prints out the whole configuration of the interface\&.
.RE
.PP
\fB\-pe\fR
.RS 4
Prints "yes" or "no" if the interface exists or not\&.
.RE
.PP
\fB\-pa\fR
.RS 4
Prints the IPv4 address of the interface\&.
.RE
.PP
\fB\-pn\fR
.RS 4
Prints the netmask of the interface\&.
.RE
.PP
\fB\-pN\fR
.RS 4
Prints the network address of the interface\&.
.RE
.PP
\fB\-pb\fR
.RS 4
Prints the broadcast address of the interface\&.
.RE
.PP
\fB\-pm\fR
.RS 4
Prints the MTU of the interface\&.
.RE
.PP
Following options are Linux only\&.
.PP
\fB\-ph\fR
.RS 4
Prints the hardware address of the interface\&. Exit with a failure exit code if there is not hardware address for the given network interface\&.
.RE
.PP
\fB\-pf\fR
.RS 4
Prints the flags of the interface\&.
.RE
.PP
\fB\-si\fR
.RS 4
Prints out all the input statistics of the interface\&.
.RE
.PP
\fB\-sip\fR
.RS 4
Prints the number of input packets\&.
.RE
.PP
\fB\-sib\fR
.RS 4
Prints the number of input bytes\&.
.RE
.PP
\fB\-sie\fR
.RS 4
Prints the number of input errors\&.
.RE
.PP
\fB\-sid\fR
.RS 4
Prints the number of dropped input packets\&.
.RE
.PP
\fB\-sif\fR
.RS 4
Prints the number of input fifo overruns\&.
.RE
.PP
\fB\-sic\fR
.RS 4
Print the number of compressed input packets\&.
.RE
.PP
\fB\-sim\fR
.RS 4
Prints the number of input multicast packets\&.
.RE
.PP
\fB\-so\fR
.RS 4
Prints out all the output statistics of the interface\&.
.RE
.PP
\fB\-sop\fR
.RS 4
Prints the number of output packets\&.
.RE
.PP
\fB\-sob\fR
.RS 4
Prints the number of output bytes\&.
.RE
.PP
\fB\-soe\fR
.RS 4
Prints the number of output errors\&.
.RE
.PP
\fB\-sod\fR
.RS 4
Prints the number of dropped output packets\&.
.RE
.PP
\fB\-sof\fR
.RS 4
Prints the number of output fifo overruns\&.
.RE
.PP
\fB\-sox\fR
.RS 4
Print the number of output collisions\&.
.RE
.PP
\fB\-soc\fR
.RS 4
Prints the number of output carrier losses\&.
.RE
.PP
\fB\-som\fR
.RS 4
Prints the number of output multicast packets\&.
.RE
.PP
\fB\-bips\fR
.RS 4
Prints the number of bytes of incoming traffic measured in one second\&.
.RE
.PP
\fB\-bops\fR
.RS 4
Prints the number of bytes of outgoing traffic measured in one second\&.
.RE
.SH "AUTHOR"
.PP
Benjamin BAYART
|