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
b93fefcb
Commit
b93fefcb
authored
Nov 12, 2001
by
Bernd Eckenfels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added SI unit patch from adam@cfar.umd.edu to output of ifconfig byte
counters
parent
811cf0aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
lib/interface.c
lib/interface.c
+26
-9
No files found.
lib/interface.c
View file @
b93fefcb
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
8/2000 Andi Kleen make the list operations a bit more efficient.
8/2000 Andi Kleen make the list operations a bit more efficient.
People are crazy enough to use thousands of aliases now.
People are crazy enough to use thousands of aliases now.
$Id: interface.c,v 1.1
8 2001/11/10 17:10:01
ecki Exp $
$Id: interface.c,v 1.1
9 2001/11/12 01:36:48
ecki Exp $
*/
*/
#include "config.h"
#include "config.h"
...
@@ -843,20 +843,37 @@ void ife_print_long(struct interface *ptr)
...
@@ -843,20 +843,37 @@ void ife_print_long(struct interface *ptr)
tx
=
ptr
->
stats
.
tx_bytes
;
tx
=
ptr
->
stats
.
tx_bytes
;
short_rx
=
rx
*
10
;
short_rx
=
rx
*
10
;
short_tx
=
tx
*
10
;
short_tx
=
tx
*
10
;
if
(
rx
>
1048576
)
{
if
(
rx
>
1125899906842624
)
{
short_rx
/=
1125899906842624
;
Rext
=
"PiB"
;
}
else
if
(
rx
>
1099511627776
)
{
short_rx
/=
1099511627776
;
Rext
=
"TiB"
;
}
else
if
(
rx
>
1073741824
)
{
short_rx
/=
1073741824
;
Rext
=
"GiB"
;
}
else
if
(
rx
>
1048576
)
{
short_rx
/=
1048576
;
short_rx
/=
1048576
;
Rext
=
"MB"
;
Rext
=
"M
i
B"
;
}
else
if
(
rx
>
1024
)
{
}
else
if
(
rx
>
1024
)
{
short_rx
/=
1024
;
short_rx
/=
1024
;
Rext
=
"kB"
;
Rext
=
"KiB"
;
}
}
if
(
tx
>
1048576
)
{
if
(
tx
>
1125899906842624
)
{
short_tx
/=
1125899906842624
;
Text
=
"PiB"
;
}
else
if
(
tx
>
1099511627776
)
{
short_tx
/=
1099511627776
;
Text
=
"TiB"
;
}
else
if
(
tx
>
1073741824
)
{
short_tx
/=
1073741824
;
Text
=
"GiB"
;
}
else
if
(
tx
>
1048576
)
{
short_tx
/=
1048576
;
short_tx
/=
1048576
;
Text
=
"MB"
;
Text
=
"MiB"
;
}
}
else
if
(
tx
>
1024
)
{
else
if
(
tx
>
1024
)
{
short_tx
/=
1024
;
short_tx
/=
1024
;
Text
=
"
k
B"
;
Text
=
"
Ki
B"
;
}
}
printf
(
" "
);
printf
(
" "
);
...
...
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