Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
942d4deb
Commit
942d4deb
authored
Dec 19, 2000
by
Bernd Eckenfels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display all IFF_ flags for netstat -i (print_short and print_long has equal
count of printed flags now)
parent
9ae65971
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
lib/interface.c
lib/interface.c
+18
-5
netstat.c
netstat.c
+2
-2
No files found.
lib/interface.c
View file @
942d4deb
...
...
@@ -7,7 +7,7 @@
8/2000 Andi Kleen make the list operations a bit more efficient.
People are crazy enough to use thousands of aliases now.
$Id: interface.c,v 1.1
1 2000/12/19 01:01:41
ecki Exp $
$Id: interface.c,v 1.1
2 2000/12/19 01:28:34
ecki Exp $
*/
#include "config.h"
...
...
@@ -580,10 +580,10 @@ int do_if_print(struct interface *ife, void *cookie)
void
ife_print_short
(
struct
interface
*
ptr
)
{
printf
(
"%-5.5s "
,
ptr
->
name
);
printf
(
"%5d %3d
"
,
ptr
->
mtu
,
ptr
->
metric
);
printf
(
"%5d %3d"
,
ptr
->
mtu
,
ptr
->
metric
);
/* If needed, display the interface statistics. */
if
(
ptr
->
statistics_valid
)
{
printf
(
"%8lu %6lu %6lu %6lu
"
,
printf
(
"%8lu %6lu %6lu %6lu"
,
ptr
->
stats
.
rx_packets
,
ptr
->
stats
.
rx_errors
,
ptr
->
stats
.
rx_dropped
,
ptr
->
stats
.
rx_fifo_errors
);
printf
(
"%8lu %6lu %6lu %6lu "
,
...
...
@@ -592,6 +592,7 @@ void ife_print_short(struct interface *ptr)
}
else
{
printf
(
"%-56s"
,
_
(
" - no statistics available -"
));
}
/* DONT FORGET TO ADD THE FLAGS IN ife_print_long, too */
if
(
ptr
->
flags
==
0
)
printf
(
_
(
"[NO FLAGS]"
));
if
(
ptr
->
flags
&
IFF_ALLMULTI
)
...
...
@@ -602,18 +603,29 @@ void ife_print_short(struct interface *ptr)
printf
(
"D"
);
if
(
ptr
->
flags
&
IFF_LOOPBACK
)
printf
(
"L"
);
if
(
ptr
->
flags
&
IFF_
PROMISC
)
if
(
ptr
->
flags
&
IFF_
MULTICAST
)
printf
(
"M"
);
#ifdef HAVE_DYNAMIC
if
(
ptr
->
flags
&
IFF_DYNAMIC
)
printf
(
"d"
);
#endif
if
(
ptr
->
flags
&
IFF_PROMISC
)
printf
(
"P"
);
if
(
ptr
->
flags
&
IFF_NOTRAILERS
)
printf
(
"N"
);
if
(
ptr
->
flags
&
IFF_NOARP
)
printf
(
"O"
);
if
(
ptr
->
flags
&
IFF_POINTOPOINT
)
printf
(
"P"
);
if
(
ptr
->
flags
&
IFF_SLAVE
)
printf
(
"s"
);
if
(
ptr
->
flags
&
IFF_MASTER
)
printf
(
"m"
);
if
(
ptr
->
flags
&
IFF_RUNNING
)
printf
(
"R"
);
if
(
ptr
->
flags
&
IFF_UP
)
printf
(
"U"
);
/* DONT FORGET TO ADD THE FLAGS IN ife_print_long, too */
printf
(
"
\n
"
);
}
...
...
@@ -768,6 +780,7 @@ void ife_print_long(struct interface *ptr)
#endif
printf
(
" "
);
/* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
if
(
ptr
->
flags
==
0
)
printf
(
_
(
"[NO FLAGS] "
));
if
(
ptr
->
flags
&
IFF_UP
)
...
...
@@ -800,7 +813,7 @@ void ife_print_long(struct interface *ptr)
if
(
ptr
->
flags
&
IFF_DYNAMIC
)
printf
(
_
(
"DYNAMIC "
));
#endif
/* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
printf
(
_
(
" MTU:%d Metric:%d"
),
ptr
->
mtu
,
ptr
->
metric
?
ptr
->
metric
:
1
);
#ifdef SIOCSKEEPALIVE
...
...
netstat.c
View file @
942d4deb
...
...
@@ -6,7 +6,7 @@
* NET-3 Networking Distribution for the LINUX operating
* system.
*
* Version: $Id: netstat.c,v 1.
39 2000/10/08 01:00:43
ecki Exp $
* Version: $Id: netstat.c,v 1.
40 2000/12/19 01:28:34
ecki Exp $
*
* Authors: Fred Baumgarten, <dc6iq@insu1.etec.uni-karlsruhe.de>
* Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment