source: rtems/cpukit/libnetworking/rtems/rtems_showipstat.c @ 96b39164

4.104.114.84.95
Last change on this file since 96b39164 was 96b39164, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/98 at 21:56:40

Added CVS Ids

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <sys/param.h>
6#include <sys/queue.h>
7#include <sys/systm.h>
8#include <sys/kernel.h>
9#include <sys/sysctl.h>
10#include <sys/proc.h>
11#include <sys/mbuf.h>
12#include <netinet/in_systm.h>
13#include <netinet/in.h>
14#include <netinet/ip.h>
15#include <netinet/ip_var.h>
16
17/*
18 * Display IP statistics
19 * Don't lock the rest of the network tasks out while printing.
20 * It's no big deal if the values change while being printed.
21 */
22static void
23showipstat (const char *name, unsigned long n)
24{
25        if (n)
26                printf ("%35s%12lu\n", name, n);
27}
28
29void
30rtems_bsdnet_show_ip_stats (void)
31{
32        printf ("************ IP Statistics ************\n");
33        showipstat ("total packets received", ipstat.ips_total);
34        showipstat ("checksum bad", ipstat.ips_badsum);
35        showipstat ("packet too short", ipstat.ips_tooshort);
36        showipstat ("not enough data", ipstat.ips_toosmall);
37        showipstat ("ip header length < data size", ipstat.ips_badhlen);
38        showipstat ("ip length < ip header length", ipstat.ips_badlen);
39        showipstat ("fragments received", ipstat.ips_fragments);
40        showipstat ("frags dropped (dups, out of space)", ipstat.ips_fragdropped);
41        showipstat ("fragments timed out", ipstat.ips_fragtimeout);
42        showipstat ("packets forwarded", ipstat.ips_forward);
43        showipstat ("packets rcvd for unreachable dest", ipstat.ips_cantforward);
44        showipstat ("packets forwarded on same net", ipstat.ips_redirectsent);
45        showipstat ("unknown or unsupported protocol", ipstat.ips_noproto);
46        showipstat ("datagrams delivered to upper level", ipstat.ips_delivered);
47        showipstat ("total ip packets generated here", ipstat.ips_localout);
48        showipstat ("lost packets due to nobufs, etc.", ipstat.ips_odropped);
49        showipstat ("total packets reassembled ok", ipstat.ips_reassembled);
50        showipstat ("datagrams successfully fragmented", ipstat.ips_fragmented);
51        showipstat ("output fragments created", ipstat.ips_ofragments);
52        showipstat ("don't fragment flag was set, etc.", ipstat.ips_cantfrag);
53        showipstat ("error in option processing", ipstat.ips_badoptions);
54        showipstat ("packets discarded due to no route", ipstat.ips_noroute);
55        showipstat ("ip version != 4", ipstat.ips_badvers);
56        showipstat ("total raw ip packets generated", ipstat.ips_rawout);
57        showipstat ("ip length > max ip packet size", ipstat.ips_toolong);
58        printf ("\n");
59}
Note: See TracBrowser for help on using the repository browser.