source: rtems/c/src/exec/libnetworking/rtems/rtems_showudpstat.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: 1.4 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 <sys/socket.h>
13#include <net/if.h>
14#include <netinet/in.h>
15#include <netinet/in_systm.h>
16#include <netinet/ip.h>
17#include <netinet/ip_var.h>
18#include <netinet/udp.h>
19#include <netinet/udp_var.h>
20
21/*
22 * Display UDP statistics
23 * Don't lock the rest of the network tasks out while printing.
24 * It's no big deal if the values change while being printed.
25 */
26static void
27showudpstat (const char *name, unsigned long n)
28{
29        if (n)
30                printf ("%35s%12lu\n", name, n);
31}
32
33void
34rtems_bsdnet_show_udp_stats (void)
35{
36        printf ("************ UDP Statistics ************\n");
37        showudpstat ("total input packets", udpstat.udps_ipackets);
38        showudpstat ("packet shorter than header", udpstat.udps_hdrops);
39        showudpstat ("checksum error", udpstat.udps_badsum);
40        showudpstat ("data length larger than packet", udpstat.udps_badlen);
41        showudpstat ("no socket on port", udpstat.udps_noport);
42        showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
43        showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
44        showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
45        showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
46        showudpstat ("total output packets", udpstat.udps_opackets);
47        printf ("\n");
48}
Note: See TracBrowser for help on using the repository browser.