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

5
Last change on this file since e800b07 was e800b07, checked in by Sebastian Huber <sebastian.huber@…>, on 04/22/16 at 07:15:11

network: Fix warnings

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#if HAVE_CONFIG_H
2#include "config.h"
3#endif
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#include <rtems/rtems_bsdnet.h>
22
23/*
24 * Display UDP statistics
25 * Don't lock the rest of the network tasks out while printing.
26 * It's no big deal if the values change while being printed.
27 */
28static void
29showudpstat (const char *name, unsigned long n)
30{
31        if (n)
32                printf ("%35s%12lu\n", name, n);
33}
34
35void
36rtems_bsdnet_show_udp_stats (void)
37{
38        printf ("************ UDP Statistics ************\n");
39        showudpstat ("total input packets", udpstat.udps_ipackets);
40        showudpstat ("packet shorter than header", udpstat.udps_hdrops);
41        showudpstat ("checksum error", udpstat.udps_badsum);
42        showudpstat ("data length larger than packet", udpstat.udps_badlen);
43        showudpstat ("no socket on port", udpstat.udps_noport);
44        showudpstat ("of above, arrived as broadcast", udpstat.udps_noportbcast);
45        showudpstat ("not delivered, input socket full", udpstat.udps_fullsock);
46        showudpstat ("input packets missing pcb cache", udpstat.udpps_pcbcachemiss);
47        showudpstat ("input packets not for hashed pcb", udpstat.udpps_pcbhashmiss);
48        showudpstat ("total output packets", udpstat.udps_opackets);
49        printf ("\n");
50}
Note: See TracBrowser for help on using the repository browser.