source: rtems/c/src/libnetworking/rtems/rtems_showipstat.c @ 39e6e65a

4.104.114.84.95
Last change on this file since 39e6e65a was 39e6e65a, checked in by Joel Sherrill <joel.sherrill@…>, on 08/19/98 at 21:32:28

Base files

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