takashi yamanoue
/
XBee_API_ex3
Xbee API Test 3
> help h or help m <status-in-hex>,. ... Modem status l <cmd>,<val-in-hex>. ... exec <cmd> (AT) at this host. lset fid <val-in-hex>. ... set local frame id. default is 1. lset cmd <val-in-hex>. ... set local command. lset val <val-in-hex>. ... set local command value. q <cmd>,<val-in-hex>. ... set queue parameter value. r <cmd>,<val-in-hex>. ... exec <cmd> (AT)at remote host. rset a16 <val-in-hex>. ... set remote address high. rset a64 <val-in-hex>,<val-in-hex>. ... set remote address low. rset fid <val-in-hex>. ... set remote frame id. default is 1. > l D4,0x05 cmd=D4 val=0x05 apiId=88 object 100008c8:35 01 00 10 88 00 05 FE 04 01 00 FF l OK: > l D4,0x04 cmd=D4 val=0x04 apiId=88 object 100008c8:35 01 00 10 88 00 05 FE 04 01 00 FF l OK: >
LPC1768/lwip/include/lwip/stats.h@0:3edcfa3aba71, 2012-07-21 (annotated)
- Committer:
- takashiyamanoue
- Date:
- Sat Jul 21 04:09:54 2012 +0000
- Revision:
- 0:3edcfa3aba71
xbee test 3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takashiyamanoue | 0:3edcfa3aba71 | 1 | /* |
takashiyamanoue | 0:3edcfa3aba71 | 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
takashiyamanoue | 0:3edcfa3aba71 | 3 | * All rights reserved. |
takashiyamanoue | 0:3edcfa3aba71 | 4 | * |
takashiyamanoue | 0:3edcfa3aba71 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
takashiyamanoue | 0:3edcfa3aba71 | 6 | * are permitted provided that the following conditions are met: |
takashiyamanoue | 0:3edcfa3aba71 | 7 | * |
takashiyamanoue | 0:3edcfa3aba71 | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
takashiyamanoue | 0:3edcfa3aba71 | 9 | * this list of conditions and the following disclaimer. |
takashiyamanoue | 0:3edcfa3aba71 | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
takashiyamanoue | 0:3edcfa3aba71 | 11 | * this list of conditions and the following disclaimer in the documentation |
takashiyamanoue | 0:3edcfa3aba71 | 12 | * and/or other materials provided with the distribution. |
takashiyamanoue | 0:3edcfa3aba71 | 13 | * 3. The name of the author may not be used to endorse or promote products |
takashiyamanoue | 0:3edcfa3aba71 | 14 | * derived from this software without specific prior written permission. |
takashiyamanoue | 0:3edcfa3aba71 | 15 | * |
takashiyamanoue | 0:3edcfa3aba71 | 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
takashiyamanoue | 0:3edcfa3aba71 | 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
takashiyamanoue | 0:3edcfa3aba71 | 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
takashiyamanoue | 0:3edcfa3aba71 | 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
takashiyamanoue | 0:3edcfa3aba71 | 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
takashiyamanoue | 0:3edcfa3aba71 | 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
takashiyamanoue | 0:3edcfa3aba71 | 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
takashiyamanoue | 0:3edcfa3aba71 | 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
takashiyamanoue | 0:3edcfa3aba71 | 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
takashiyamanoue | 0:3edcfa3aba71 | 25 | * OF SUCH DAMAGE. |
takashiyamanoue | 0:3edcfa3aba71 | 26 | * |
takashiyamanoue | 0:3edcfa3aba71 | 27 | * This file is part of the lwIP TCP/IP stack. |
takashiyamanoue | 0:3edcfa3aba71 | 28 | * |
takashiyamanoue | 0:3edcfa3aba71 | 29 | * Author: Adam Dunkels <adam@sics.se> |
takashiyamanoue | 0:3edcfa3aba71 | 30 | * |
takashiyamanoue | 0:3edcfa3aba71 | 31 | */ |
takashiyamanoue | 0:3edcfa3aba71 | 32 | #ifndef __LWIP_STATS_H__ |
takashiyamanoue | 0:3edcfa3aba71 | 33 | #define __LWIP_STATS_H__ |
takashiyamanoue | 0:3edcfa3aba71 | 34 | |
takashiyamanoue | 0:3edcfa3aba71 | 35 | #include "lwip/opt.h" |
takashiyamanoue | 0:3edcfa3aba71 | 36 | |
takashiyamanoue | 0:3edcfa3aba71 | 37 | #include "lwip/mem.h" |
takashiyamanoue | 0:3edcfa3aba71 | 38 | #include "lwip/memp.h" |
takashiyamanoue | 0:3edcfa3aba71 | 39 | |
takashiyamanoue | 0:3edcfa3aba71 | 40 | #ifdef __cplusplus |
takashiyamanoue | 0:3edcfa3aba71 | 41 | extern "C" { |
takashiyamanoue | 0:3edcfa3aba71 | 42 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 43 | |
takashiyamanoue | 0:3edcfa3aba71 | 44 | #if LWIP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 45 | |
takashiyamanoue | 0:3edcfa3aba71 | 46 | #ifndef LWIP_STATS_LARGE |
takashiyamanoue | 0:3edcfa3aba71 | 47 | #define LWIP_STATS_LARGE 0 |
takashiyamanoue | 0:3edcfa3aba71 | 48 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 49 | |
takashiyamanoue | 0:3edcfa3aba71 | 50 | #if LWIP_STATS_LARGE |
takashiyamanoue | 0:3edcfa3aba71 | 51 | #define STAT_COUNTER u32_t |
takashiyamanoue | 0:3edcfa3aba71 | 52 | #define STAT_COUNTER_F U32_F |
takashiyamanoue | 0:3edcfa3aba71 | 53 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 54 | #define STAT_COUNTER u16_t |
takashiyamanoue | 0:3edcfa3aba71 | 55 | #define STAT_COUNTER_F U16_F |
takashiyamanoue | 0:3edcfa3aba71 | 56 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 57 | |
takashiyamanoue | 0:3edcfa3aba71 | 58 | struct stats_proto { |
takashiyamanoue | 0:3edcfa3aba71 | 59 | STAT_COUNTER xmit; /* Transmitted packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 60 | STAT_COUNTER recv; /* Received packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 61 | STAT_COUNTER fw; /* Forwarded packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 62 | STAT_COUNTER drop; /* Dropped packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 63 | STAT_COUNTER chkerr; /* Checksum error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 64 | STAT_COUNTER lenerr; /* Invalid length error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 65 | STAT_COUNTER memerr; /* Out of memory error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 66 | STAT_COUNTER rterr; /* Routing error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 67 | STAT_COUNTER proterr; /* Protocol error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 68 | STAT_COUNTER opterr; /* Error in options. */ |
takashiyamanoue | 0:3edcfa3aba71 | 69 | STAT_COUNTER err; /* Misc error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 70 | STAT_COUNTER cachehit; |
takashiyamanoue | 0:3edcfa3aba71 | 71 | }; |
takashiyamanoue | 0:3edcfa3aba71 | 72 | |
takashiyamanoue | 0:3edcfa3aba71 | 73 | struct stats_igmp { |
takashiyamanoue | 0:3edcfa3aba71 | 74 | STAT_COUNTER xmit; /* Transmitted packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 75 | STAT_COUNTER recv; /* Received packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 76 | STAT_COUNTER drop; /* Dropped packets. */ |
takashiyamanoue | 0:3edcfa3aba71 | 77 | STAT_COUNTER chkerr; /* Checksum error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 78 | STAT_COUNTER lenerr; /* Invalid length error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 79 | STAT_COUNTER memerr; /* Out of memory error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 80 | STAT_COUNTER proterr; /* Protocol error. */ |
takashiyamanoue | 0:3edcfa3aba71 | 81 | STAT_COUNTER rx_v1; /* Received v1 frames. */ |
takashiyamanoue | 0:3edcfa3aba71 | 82 | STAT_COUNTER rx_group; /* Received group-specific queries. */ |
takashiyamanoue | 0:3edcfa3aba71 | 83 | STAT_COUNTER rx_general; /* Received general queries. */ |
takashiyamanoue | 0:3edcfa3aba71 | 84 | STAT_COUNTER rx_report; /* Received reports. */ |
takashiyamanoue | 0:3edcfa3aba71 | 85 | STAT_COUNTER tx_join; /* Sent joins. */ |
takashiyamanoue | 0:3edcfa3aba71 | 86 | STAT_COUNTER tx_leave; /* Sent leaves. */ |
takashiyamanoue | 0:3edcfa3aba71 | 87 | STAT_COUNTER tx_report; /* Sent reports. */ |
takashiyamanoue | 0:3edcfa3aba71 | 88 | }; |
takashiyamanoue | 0:3edcfa3aba71 | 89 | |
takashiyamanoue | 0:3edcfa3aba71 | 90 | struct stats_mem { |
takashiyamanoue | 0:3edcfa3aba71 | 91 | #ifdef LWIP_DEBUG |
takashiyamanoue | 0:3edcfa3aba71 | 92 | const char *name; |
takashiyamanoue | 0:3edcfa3aba71 | 93 | #endif /* LWIP_DEBUG */ |
takashiyamanoue | 0:3edcfa3aba71 | 94 | mem_size_t avail; |
takashiyamanoue | 0:3edcfa3aba71 | 95 | mem_size_t used; |
takashiyamanoue | 0:3edcfa3aba71 | 96 | mem_size_t max; |
takashiyamanoue | 0:3edcfa3aba71 | 97 | STAT_COUNTER err; |
takashiyamanoue | 0:3edcfa3aba71 | 98 | STAT_COUNTER illegal; |
takashiyamanoue | 0:3edcfa3aba71 | 99 | }; |
takashiyamanoue | 0:3edcfa3aba71 | 100 | |
takashiyamanoue | 0:3edcfa3aba71 | 101 | struct stats_syselem { |
takashiyamanoue | 0:3edcfa3aba71 | 102 | STAT_COUNTER used; |
takashiyamanoue | 0:3edcfa3aba71 | 103 | STAT_COUNTER max; |
takashiyamanoue | 0:3edcfa3aba71 | 104 | STAT_COUNTER err; |
takashiyamanoue | 0:3edcfa3aba71 | 105 | }; |
takashiyamanoue | 0:3edcfa3aba71 | 106 | |
takashiyamanoue | 0:3edcfa3aba71 | 107 | struct stats_sys { |
takashiyamanoue | 0:3edcfa3aba71 | 108 | struct stats_syselem sem; |
takashiyamanoue | 0:3edcfa3aba71 | 109 | struct stats_syselem mutex; |
takashiyamanoue | 0:3edcfa3aba71 | 110 | struct stats_syselem mbox; |
takashiyamanoue | 0:3edcfa3aba71 | 111 | }; |
takashiyamanoue | 0:3edcfa3aba71 | 112 | |
takashiyamanoue | 0:3edcfa3aba71 | 113 | struct stats_ { |
takashiyamanoue | 0:3edcfa3aba71 | 114 | #if LINK_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 115 | struct stats_proto link; |
takashiyamanoue | 0:3edcfa3aba71 | 116 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 117 | #if ETHARP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 118 | struct stats_proto etharp; |
takashiyamanoue | 0:3edcfa3aba71 | 119 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 120 | #if IPFRAG_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 121 | struct stats_proto ip_frag; |
takashiyamanoue | 0:3edcfa3aba71 | 122 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 123 | #if IP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 124 | struct stats_proto ip; |
takashiyamanoue | 0:3edcfa3aba71 | 125 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 126 | #if ICMP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 127 | struct stats_proto icmp; |
takashiyamanoue | 0:3edcfa3aba71 | 128 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 129 | #if IGMP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 130 | struct stats_igmp igmp; |
takashiyamanoue | 0:3edcfa3aba71 | 131 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 132 | #if UDP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 133 | struct stats_proto udp; |
takashiyamanoue | 0:3edcfa3aba71 | 134 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 135 | #if TCP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 136 | struct stats_proto tcp; |
takashiyamanoue | 0:3edcfa3aba71 | 137 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 138 | #if MEM_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 139 | struct stats_mem mem; |
takashiyamanoue | 0:3edcfa3aba71 | 140 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 141 | #if MEMP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 142 | struct stats_mem memp[MEMP_MAX]; |
takashiyamanoue | 0:3edcfa3aba71 | 143 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 144 | #if SYS_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 145 | struct stats_sys sys; |
takashiyamanoue | 0:3edcfa3aba71 | 146 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 147 | }; |
takashiyamanoue | 0:3edcfa3aba71 | 148 | |
takashiyamanoue | 0:3edcfa3aba71 | 149 | extern struct stats_ lwip_stats; |
takashiyamanoue | 0:3edcfa3aba71 | 150 | |
takashiyamanoue | 0:3edcfa3aba71 | 151 | void stats_init(void); |
takashiyamanoue | 0:3edcfa3aba71 | 152 | |
takashiyamanoue | 0:3edcfa3aba71 | 153 | #define STATS_INC(x) ++lwip_stats.x |
takashiyamanoue | 0:3edcfa3aba71 | 154 | #define STATS_DEC(x) --lwip_stats.x |
takashiyamanoue | 0:3edcfa3aba71 | 155 | #define STATS_INC_USED(x, y) do { lwip_stats.x.used += y; \ |
takashiyamanoue | 0:3edcfa3aba71 | 156 | if (lwip_stats.x.max < lwip_stats.x.used) { \ |
takashiyamanoue | 0:3edcfa3aba71 | 157 | lwip_stats.x.max = lwip_stats.x.used; \ |
takashiyamanoue | 0:3edcfa3aba71 | 158 | } \ |
takashiyamanoue | 0:3edcfa3aba71 | 159 | } while(0) |
takashiyamanoue | 0:3edcfa3aba71 | 160 | #else /* LWIP_STATS */ |
takashiyamanoue | 0:3edcfa3aba71 | 161 | #define stats_init() |
takashiyamanoue | 0:3edcfa3aba71 | 162 | #define STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 163 | #define STATS_DEC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 164 | #define STATS_INC_USED(x) |
takashiyamanoue | 0:3edcfa3aba71 | 165 | #endif /* LWIP_STATS */ |
takashiyamanoue | 0:3edcfa3aba71 | 166 | |
takashiyamanoue | 0:3edcfa3aba71 | 167 | #if TCP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 168 | #define TCP_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 169 | #define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") |
takashiyamanoue | 0:3edcfa3aba71 | 170 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 171 | #define TCP_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 172 | #define TCP_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 173 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 174 | |
takashiyamanoue | 0:3edcfa3aba71 | 175 | #if UDP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 176 | #define UDP_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 177 | #define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") |
takashiyamanoue | 0:3edcfa3aba71 | 178 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 179 | #define UDP_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 180 | #define UDP_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 181 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 182 | |
takashiyamanoue | 0:3edcfa3aba71 | 183 | #if ICMP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 184 | #define ICMP_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 185 | #define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") |
takashiyamanoue | 0:3edcfa3aba71 | 186 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 187 | #define ICMP_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 188 | #define ICMP_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 189 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 190 | |
takashiyamanoue | 0:3edcfa3aba71 | 191 | #if IGMP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 192 | #define IGMP_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 193 | #define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp) |
takashiyamanoue | 0:3edcfa3aba71 | 194 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 195 | #define IGMP_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 196 | #define IGMP_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 197 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 198 | |
takashiyamanoue | 0:3edcfa3aba71 | 199 | #if IP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 200 | #define IP_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 201 | #define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") |
takashiyamanoue | 0:3edcfa3aba71 | 202 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 203 | #define IP_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 204 | #define IP_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 205 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 206 | |
takashiyamanoue | 0:3edcfa3aba71 | 207 | #if IPFRAG_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 208 | #define IPFRAG_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 209 | #define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") |
takashiyamanoue | 0:3edcfa3aba71 | 210 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 211 | #define IPFRAG_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 212 | #define IPFRAG_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 213 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 214 | |
takashiyamanoue | 0:3edcfa3aba71 | 215 | #if ETHARP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 216 | #define ETHARP_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 217 | #define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") |
takashiyamanoue | 0:3edcfa3aba71 | 218 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 219 | #define ETHARP_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 220 | #define ETHARP_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 221 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 222 | |
takashiyamanoue | 0:3edcfa3aba71 | 223 | #if LINK_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 224 | #define LINK_STATS_INC(x) STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 225 | #define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") |
takashiyamanoue | 0:3edcfa3aba71 | 226 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 227 | #define LINK_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 228 | #define LINK_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 229 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 230 | |
takashiyamanoue | 0:3edcfa3aba71 | 231 | #if MEM_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 232 | #define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y |
takashiyamanoue | 0:3edcfa3aba71 | 233 | #define MEM_STATS_INC(x) STATS_INC(mem.x) |
takashiyamanoue | 0:3edcfa3aba71 | 234 | #define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y) |
takashiyamanoue | 0:3edcfa3aba71 | 235 | #define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x -= y |
takashiyamanoue | 0:3edcfa3aba71 | 236 | #define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") |
takashiyamanoue | 0:3edcfa3aba71 | 237 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 238 | #define MEM_STATS_AVAIL(x, y) |
takashiyamanoue | 0:3edcfa3aba71 | 239 | #define MEM_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 240 | #define MEM_STATS_INC_USED(x, y) |
takashiyamanoue | 0:3edcfa3aba71 | 241 | #define MEM_STATS_DEC_USED(x, y) |
takashiyamanoue | 0:3edcfa3aba71 | 242 | #define MEM_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 243 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 244 | |
takashiyamanoue | 0:3edcfa3aba71 | 245 | #if MEMP_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 246 | #define MEMP_STATS_AVAIL(x, i, y) lwip_stats.memp[i].x = y |
takashiyamanoue | 0:3edcfa3aba71 | 247 | #define MEMP_STATS_INC(x, i) STATS_INC(memp[i].x) |
takashiyamanoue | 0:3edcfa3aba71 | 248 | #define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i].x) |
takashiyamanoue | 0:3edcfa3aba71 | 249 | #define MEMP_STATS_INC_USED(x, i) STATS_INC_USED(memp[i], 1) |
takashiyamanoue | 0:3edcfa3aba71 | 250 | #define MEMP_STATS_DISPLAY(i) stats_display_memp(&lwip_stats.memp[i], i) |
takashiyamanoue | 0:3edcfa3aba71 | 251 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 252 | #define MEMP_STATS_AVAIL(x, i, y) |
takashiyamanoue | 0:3edcfa3aba71 | 253 | #define MEMP_STATS_INC(x, i) |
takashiyamanoue | 0:3edcfa3aba71 | 254 | #define MEMP_STATS_DEC(x, i) |
takashiyamanoue | 0:3edcfa3aba71 | 255 | #define MEMP_STATS_INC_USED(x, i) |
takashiyamanoue | 0:3edcfa3aba71 | 256 | #define MEMP_STATS_DISPLAY(i) |
takashiyamanoue | 0:3edcfa3aba71 | 257 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 258 | |
takashiyamanoue | 0:3edcfa3aba71 | 259 | #if SYS_STATS |
takashiyamanoue | 0:3edcfa3aba71 | 260 | #define SYS_STATS_INC(x) STATS_INC(sys.x) |
takashiyamanoue | 0:3edcfa3aba71 | 261 | #define SYS_STATS_DEC(x) STATS_DEC(sys.x) |
takashiyamanoue | 0:3edcfa3aba71 | 262 | #define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1) |
takashiyamanoue | 0:3edcfa3aba71 | 263 | #define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) |
takashiyamanoue | 0:3edcfa3aba71 | 264 | #else |
takashiyamanoue | 0:3edcfa3aba71 | 265 | #define SYS_STATS_INC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 266 | #define SYS_STATS_DEC(x) |
takashiyamanoue | 0:3edcfa3aba71 | 267 | #define SYS_STATS_INC_USED(x) |
takashiyamanoue | 0:3edcfa3aba71 | 268 | #define SYS_STATS_DISPLAY() |
takashiyamanoue | 0:3edcfa3aba71 | 269 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 270 | |
takashiyamanoue | 0:3edcfa3aba71 | 271 | /* Display of statistics */ |
takashiyamanoue | 0:3edcfa3aba71 | 272 | #if LWIP_STATS_DISPLAY |
takashiyamanoue | 0:3edcfa3aba71 | 273 | void stats_display(void); |
takashiyamanoue | 0:3edcfa3aba71 | 274 | void stats_display_proto(struct stats_proto *proto, char *name); |
takashiyamanoue | 0:3edcfa3aba71 | 275 | void stats_display_igmp(struct stats_igmp *igmp); |
takashiyamanoue | 0:3edcfa3aba71 | 276 | void stats_display_mem(struct stats_mem *mem, char *name); |
takashiyamanoue | 0:3edcfa3aba71 | 277 | void stats_display_memp(struct stats_mem *mem, int index); |
takashiyamanoue | 0:3edcfa3aba71 | 278 | void stats_display_sys(struct stats_sys *sys); |
takashiyamanoue | 0:3edcfa3aba71 | 279 | #else /* LWIP_STATS_DISPLAY */ |
takashiyamanoue | 0:3edcfa3aba71 | 280 | #define stats_display() |
takashiyamanoue | 0:3edcfa3aba71 | 281 | #define stats_display_proto(proto, name) |
takashiyamanoue | 0:3edcfa3aba71 | 282 | #define stats_display_igmp(igmp) |
takashiyamanoue | 0:3edcfa3aba71 | 283 | #define stats_display_mem(mem, name) |
takashiyamanoue | 0:3edcfa3aba71 | 284 | #define stats_display_memp(mem, index) |
takashiyamanoue | 0:3edcfa3aba71 | 285 | #define stats_display_sys(sys) |
takashiyamanoue | 0:3edcfa3aba71 | 286 | #endif /* LWIP_STATS_DISPLAY */ |
takashiyamanoue | 0:3edcfa3aba71 | 287 | |
takashiyamanoue | 0:3edcfa3aba71 | 288 | #ifdef __cplusplus |
takashiyamanoue | 0:3edcfa3aba71 | 289 | } |
takashiyamanoue | 0:3edcfa3aba71 | 290 | #endif |
takashiyamanoue | 0:3edcfa3aba71 | 291 | |
takashiyamanoue | 0:3edcfa3aba71 | 292 | #endif /* __LWIP_STATS_H__ */ |