source: rtems/cpukit/libnetworking/rtems/rtems_showudpstat.c @ c301570

4.104.114.84.9
Last change on this file since c301570 was c301570, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 10, 2007 at 5:12:54 AM

Include <rtems/bsd/sys/queue.h> instead of <sys/queue.h>.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  $Id$
3 */
4
5#if HAVE_CONFIG_H
6#include "config.h"
7#endif
8
9#include <sys/param.h>
10#include <rtems/bsd/sys/queue.h>
11#include <sys/systm.h>
12#include <sys/kernel.h>
13#include <sys/sysctl.h>
14#include <sys/proc.h>
15#include <sys/mbuf.h>
16#include <sys/socket.h>
17#include <net/if.h>
18#include <netinet/in.h>
19#include <netinet/in_systm.h>
20#include <netinet/ip.h>
21#include <netinet/ip_var.h>
22#include <netinet/udp.h>
23#include <netinet/udp_var.h>
24
25/*
26 * Display UDP statistics
27 * Don't lock the rest of the network tasks out while printing.
28 * It's no big deal if the values change while being printed.
29 */
30static void
31showudpstat (const char *name, unsigned long n)
32{
33        if (n)
34                printf ("%35s%12lu\n", name, n);
35}
36
37void
38rtems_bsdnet_show_udp_stats (void)
39{
40        printf ("************ UDP Statistics ************\n");
41        showudpstat ("total input packets", udpstat.udps_ipackets);
42        showudpstat ("packet shorter than header", udpstat.udps_hdrops);
43        showudpstat ("checksum error", udpstat.udps_badsum);
44        showudpstat ("data length larger than packet", udpstat.udps_badlen);
45        showudpstat ("no socket on port", udpstat.udps_noport);
46        showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
47        showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
48        showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
49        showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
50        showudpstat ("total output packets", udpstat.udps_opackets);
51        printf ("\n");
52}
Note: See TracBrowser for help on using the repository browser.