netstats [-Aimfpcut]
This command is used to display various types of network statistics. The information displayed can be specified using command line arguments in various combinations. The arguments are interpreted as follows:
This command returns 0 on success and non-zero if an error is encountered.
NONE
The following is an example of how to use netstats:
The following is an example of using the netstats
command to print the IP routing table:
[/] $ netstats -i Destination Gateway/Mask/Hw Flags Refs Use Expire Interface default 192.168.1.14 UGS 0 0 0 eth1 192.168.1.0 255.255.255.0 U 0 0 1 eth1 192.168.1.14 00:A0:C8:1C:EE:28 UHL 1 0 1219 eth1 192.168.1.51 00:1D:7E:0C:D0:7C UHL 0 840 1202 eth1 192.168.1.151 00:1C:23:B2:0F:BB UHL 1 23 1219 eth1
The following is an example of using the netstats
command to print the MBUF statistics:
[/] $ netstats -m
************ MBUF STATISTICS ************
mbufs:2048 clusters: 128 free: 63
drops: 0 waits: 0 drains: 0
free:1967 data:79 header:2 socket:0
pcb:0 rtable:0 htable:0 atable:0
soname:0 soopts:0 ftable:0 rights:0
ifaddr:0 control:0 oobdata:0
The following is an example of using the netstats
command to print the print the interface statistics:
[/] $ netstats -f
************ INTERFACE STATISTICS ************
***** eth1 *****
Ethernet Address: 00:04:9F:00:5B:21
Address:192.168.1.244 Broadcast Address:192.168.1.255 Net mask:255.255.255.0
Flags: Up Broadcast Running Active Multicast
Send queue limit:50 length:1 Dropped:0
Rx Interrupts:889 Not First:0 Not Last:0
Giant:0 Non-octet:0
Bad CRC:0 Overrun:0 Collision:0
Tx Interrupts:867 Deferred:0 Late Collision:0
Retransmit Limit:0 Underrun:0 Misaligned:0
The following is an example of using the netstats
command to print the print IP statistics:
[/] $ netstats -p
************ IP Statistics ************
total packets received 894
packets rcvd for unreachable dest 13
datagrams delivered to upper level 881
total ip packets generated here 871
The following is an example of using the netstats
command to print the ICMP statistics:
[/] $ netstats -c
************ ICMP Statistics ************
Type 0 sent 843
number of responses 843
Type 8 received 843
The following is an example of using the netstats
command to print the UDP statistics:
[/] $ netstats -u ************ UDP Statistics ************
The following is an example of using the netstats
command to print the TCP statistics:
[/] $ netstats -t
************ TCP Statistics ************
connections accepted 1
connections established 1
segs where we tried to get rtt 34
times we succeeded 35
delayed acks sent 2
total packets sent 37
data packets sent 35
data bytes sent 2618
ack-only packets sent 2
total packets received 47
packets received in sequence 12
bytes received in sequence 307
rcvd ack packets 35
bytes acked by rcvd acks 2590
times hdr predict ok for acks 27
times hdr predict ok for data pkts 10
This command is included in the default shell command set.
When building a custom command set, define
CONFIGURE_SHELL_COMMAND_NETSTATS to have this
command included.
This command can be excluded from the shell command set by
defining CONFIGURE_SHELL_NO_COMMAND_NETSTATS when all
shell commands have been configured.
The netstats is implemented by a C language function
which has the following prototype:
int rtems_shell_rtems_main_netstats( int argc, char **argv );
The configuration structure for the netstats has the
following prototype:
extern rtems_shell_cmd_t rtems_shell_NETSTATS_Command;
Copyright © 1988-2008 OAR Corporation