2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
\r
3 * All rights reserved.
\r
5 * Redistribution and use in source and binary forms, with or without modification,
\r
6 * are permitted provided that the following conditions are met:
\r
8 * 1. Redistributions of source code must retain the above copyright notice,
\r
9 * this list of conditions and the following disclaimer.
\r
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
\r
11 * this list of conditions and the following disclaimer in the documentation
\r
12 * and/or other materials provided with the distribution.
\r
13 * 3. The name of the author may not be used to endorse or promote products
\r
14 * derived from this software without specific prior written permission.
\r
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
\r
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
\r
19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
\r
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
\r
21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
\r
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
\r
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
\r
24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
\r
27 * This file is part of the lwIP TCP/IP stack.
\r
29 * Author: Adam Dunkels <adam@sics.se>
\r
32 #ifndef __LWIP_STATS_H__
\r
33 #define __LWIP_STATS_H__
\r
35 #include "lwip/opt.h"
\r
36 #include "arch/cc.h"
\r
38 #include "lwip/mem.h"
\r
39 #include "lwip/memp.h"
\r
43 struct stats_proto {
\r
44 u16_t xmit; /* Transmitted packets. */
\r
45 u16_t rexmit; /* Retransmitted packets. */
\r
46 u16_t recv; /* Received packets. */
\r
47 u16_t fw; /* Forwarded packets. */
\r
48 u16_t drop; /* Dropped packets. */
\r
49 u16_t chkerr; /* Checksum error. */
\r
50 u16_t lenerr; /* Invalid length error. */
\r
51 u16_t memerr; /* Out of memory error. */
\r
52 u16_t rterr; /* Routing error. */
\r
53 u16_t proterr; /* Protocol error. */
\r
54 u16_t opterr; /* Error in options. */
\r
55 u16_t err; /* Misc error. */
\r
73 u16_t refresh_locked;
\r
76 struct stats_syselem {
\r
83 struct stats_syselem sem;
\r
84 struct stats_syselem mbox;
\r
88 struct stats_proto link;
\r
89 struct stats_proto ip_frag;
\r
90 struct stats_proto ip;
\r
91 struct stats_proto icmp;
\r
92 struct stats_proto udp;
\r
93 struct stats_proto tcp;
\r
94 struct stats_pbuf pbuf;
\r
95 struct stats_mem mem;
\r
96 struct stats_mem memp[MEMP_MAX];
\r
97 struct stats_sys sys;
\r
100 extern struct stats_ lwip_stats;
\r
103 void stats_init(void);
\r
105 #define STATS_INC(x) ++lwip_stats.x
\r
107 #define stats_init()
\r
108 #define STATS_INC(x)
\r
109 #endif /* LWIP_STATS */
\r
112 #define TCP_STATS_INC(x) STATS_INC(x)
\r
114 #define TCP_STATS_INC(x)
\r
118 #define UDP_STATS_INC(x) STATS_INC(x)
\r
120 #define UDP_STATS_INC(x)
\r
124 #define ICMP_STATS_INC(x) STATS_INC(x)
\r
126 #define ICMP_STATS_INC(x)
\r
130 #define IP_STATS_INC(x) STATS_INC(x)
\r
132 #define IP_STATS_INC(x)
\r
136 #define IPFRAG_STATS_INC(x) STATS_INC(x)
\r
138 #define IPFRAG_STATS_INC(x)
\r
142 #define LINK_STATS_INC(x) STATS_INC(x)
\r
144 #define LINK_STATS_INC(x)
\r
147 /* Display of statistics */
\r
148 #if LWIP_STATS_DISPLAY
\r
149 void stats_display(void);
\r
151 #define stats_display()
\r
154 #endif /* __LWIP_STATS_H__ */
\r