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
d828f5ce
Commit
d828f5ce
authored
Feb 10, 2001
by
Phil Blundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make packet/byte counters 64 bits wide
parent
778f649e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
21 deletions
+19
-21
README
README
+1
-5
include/interface.h
include/interface.h
+4
-4
lib/interface.c
lib/interface.c
+14
-12
No files found.
README
View file @
d828f5ce
...
...
@@ -32,11 +32,7 @@ Contents:
Notes
-----
This is net-tools 1.57. Notable changes since 1.55 include:
- A bug relating to IPv4 alias interfaces has been fixed.
- Support for X.25 and STRIP has been added.
- A tool for configuring MII transceivers has been added.
This is net-tools 1.58.
You need kernel 2.0 or later to use these programs. These programs
should compile cleanly with both glibc (version 2.0 or 2.1) and libc5,
...
...
include/interface.h
View file @
d828f5ce
struct
user_net_device_stats
{
unsigned
long
rx_packets
;
/* total packets received */
unsigned
long
tx_packets
;
/* total packets transmitted */
unsigned
long
rx_bytes
;
/* total bytes received */
unsigned
long
tx_bytes
;
/* total bytes transmitted */
unsigned
long
long
rx_packets
;
/* total packets received */
unsigned
long
long
tx_packets
;
/* total packets transmitted */
unsigned
long
long
rx_bytes
;
/* total bytes received */
unsigned
long
long
tx_bytes
;
/* total bytes transmitted */
unsigned
long
rx_errors
;
/* bad packets received */
unsigned
long
tx_errors
;
/* packet transmit problems */
unsigned
long
rx_dropped
;
/* no space in linux buffers */
...
...
lib/interface.c
View file @
d828f5ce
...
...
@@ -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
3 2000/12/19 01:36:27 ecki
Exp $
$Id: interface.c,v 1.1
4 2001/02/10 19:31:15 pb
Exp $
*/
#include "config.h"
...
...
@@ -239,7 +239,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
switch
(
procnetdev_vsn
)
{
case
3
:
sscanf
(
bp
,
"%l
u %lu %lu %lu %lu %lu %lu %lu %lu %
lu %lu %lu %lu %lu %lu %lu"
,
"%l
lu %llu %lu %lu %lu %lu %lu %lu %llu %l
lu %lu %lu %lu %lu %lu %lu"
,
&
ife
->
stats
.
rx_bytes
,
&
ife
->
stats
.
rx_packets
,
&
ife
->
stats
.
rx_errors
,
...
...
@@ -259,7 +259,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
&
ife
->
stats
.
tx_compressed
);
break
;
case
2
:
sscanf
(
bp
,
"%l
u %lu %lu %lu %lu %lu %lu %
lu %lu %lu %lu %lu %lu"
,
sscanf
(
bp
,
"%l
lu %llu %lu %lu %lu %lu %llu %l
lu %lu %lu %lu %lu %lu"
,
&
ife
->
stats
.
rx_bytes
,
&
ife
->
stats
.
rx_packets
,
&
ife
->
stats
.
rx_errors
,
...
...
@@ -277,7 +277,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
ife
->
stats
.
rx_multicast
=
0
;
break
;
case
1
:
sscanf
(
bp
,
"%l
u %lu %lu %lu %lu %
lu %lu %lu %lu %lu %lu"
,
sscanf
(
bp
,
"%l
lu %lu %lu %lu %lu %l
lu %lu %lu %lu %lu %lu"
,
&
ife
->
stats
.
rx_packets
,
&
ife
->
stats
.
rx_errors
,
&
ife
->
stats
.
rx_dropped
,
...
...
@@ -583,10 +583,10 @@ void ife_print_short(struct interface *ptr)
printf
(
"%5d %3d"
,
ptr
->
mtu
,
ptr
->
metric
);
/* If needed, display the interface statistics. */
if
(
ptr
->
statistics_valid
)
{
printf
(
"%8lu %6lu %6lu %6lu"
,
printf
(
"%8l
l
u %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 "
,
printf
(
"%8l
l
u %6lu %6lu %6lu "
,
ptr
->
stats
.
tx_packets
,
ptr
->
stats
.
tx_errors
,
ptr
->
stats
.
tx_dropped
,
ptr
->
stats
.
tx_fifo_errors
);
}
else
{
...
...
@@ -635,7 +635,7 @@ void ife_print_long(struct interface *ptr)
struct
hwtype
*
hw
;
int
hf
;
int
can_compress
=
0
;
unsigned
long
rx
,
tx
,
short_rx
,
short_tx
;
unsigned
long
long
rx
,
tx
,
short_rx
,
short_tx
;
char
Rext
[
5
]
=
"b"
;
char
Text
[
5
]
=
"b"
;
...
...
@@ -832,7 +832,7 @@ void ife_print_long(struct interface *ptr)
*/
printf
(
" "
);
printf
(
_
(
"RX packets:%lu errors:%lu dropped:%lu overruns:%lu frame:%lu
\n
"
),
printf
(
_
(
"RX packets:%l
l
u errors:%lu dropped:%lu overruns:%lu frame:%lu
\n
"
),
ptr
->
stats
.
rx_packets
,
ptr
->
stats
.
rx_errors
,
ptr
->
stats
.
rx_dropped
,
ptr
->
stats
.
rx_fifo_errors
,
ptr
->
stats
.
rx_frame_errors
);
...
...
@@ -849,7 +849,7 @@ void ife_print_long(struct interface *ptr)
else
if
(
tx
>
1024
)
{
short_tx
/=
1024
;
strcpy
(
Text
,
"Kb"
);
}
printf
(
" "
);
printf
(
_
(
"TX packets:%lu errors:%lu dropped:%lu overruns:%lu carrier:%lu
\n
"
),
printf
(
_
(
"TX packets:%l
l
u errors:%lu dropped:%lu overruns:%lu carrier:%lu
\n
"
),
ptr
->
stats
.
tx_packets
,
ptr
->
stats
.
tx_errors
,
ptr
->
stats
.
tx_dropped
,
ptr
->
stats
.
tx_fifo_errors
,
ptr
->
stats
.
tx_carrier_errors
);
...
...
@@ -859,9 +859,11 @@ void ife_print_long(struct interface *ptr)
if
(
ptr
->
tx_queue_len
!=
-
1
)
printf
(
_
(
"txqueuelen:%d "
),
ptr
->
tx_queue_len
);
printf
(
"
\n
"
);
printf
(
_
(
"RX bytes:%lu (%lu.%lu %s) TX bytes:%lu (%lu.%lu %s)
\n
"
),
rx
,
short_rx
/
10
,
short_rx
%
10
,
Rext
,
tx
,
short_tx
/
10
,
short_tx
%
10
,
Text
);
printf
(
_
(
"RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)
\n
"
),
rx
,
(
unsigned
long
)(
short_rx
/
10
),
(
unsigned
long
)(
short_rx
%
10
),
Rext
,
tx
,
(
unsigned
long
)(
short_tx
/
10
),
(
unsigned
long
)(
short_tx
%
10
),
Text
);
}
if
((
ptr
->
map
.
irq
||
ptr
->
map
.
mem_start
||
ptr
->
map
.
dma
||
...
...
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