OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [libnetworking/] [rtems/] [rtems_showudpstat.c] - Blame information for rev 507

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: rtems_showudpstat.c,v 1.2 2001-09-27 12:02:00 chris Exp $
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
 */
26
static void
27
showudpstat (const char *name, unsigned long n)
28
{
29
        if (n)
30
                printf ("%35s%12lu\n", name, n);
31
}
32
 
33
void
34
rtems_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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.