32 #ifndef LWIP_HDR_STATS_H 33 #define LWIP_HDR_STATS_H 46 #ifndef LWIP_STATS_LARGE 47 #define LWIP_STATS_LARGE 0 51 #define STAT_COUNTER u32_t 52 #define STAT_COUNTER_F U32_F 54 #define STAT_COUNTER u16_t 55 #define STAT_COUNTER_F U16_F 70 STAT_COUNTER cachehit;
82 STAT_COUNTER rx_group;
83 STAT_COUNTER rx_general;
84 STAT_COUNTER rx_report;
86 STAT_COUNTER tx_leave;
87 STAT_COUNTER tx_report;
101 struct stats_syselem {
108 struct stats_syselem sem;
109 struct stats_syselem mutex;
110 struct stats_syselem mbox;
116 u32_t ipinaddrerrors;
117 u32_t ipinunknownprotos;
129 u32_t ipforwdatagrams;
133 u32_t tcpactiveopens;
134 u32_t tcppassiveopens;
135 u32_t tcpattemptfails;
136 u32_t tcpestabresets;
138 u32_t tcpretranssegs;
144 u32_t udpindatagrams;
147 u32_t udpoutdatagrams;
152 u32_t icmpindestunreachs;
153 u32_t icmpintimeexcds;
154 u32_t icmpinparmprobs;
155 u32_t icmpinsrcquenchs;
156 u32_t icmpinredirects;
158 u32_t icmpinechoreps;
159 u32_t icmpintimestamps;
160 u32_t icmpintimestampreps;
161 u32_t icmpinaddrmasks;
162 u32_t icmpinaddrmaskreps;
165 u32_t icmpoutdestunreachs;
166 u32_t icmpouttimeexcds;
168 u32_t icmpoutechoreps;
171 struct stats_mib2_netif_ctrs {
174 u32_t ifinnucastpkts;
177 u32_t ifinunknownprotos;
179 u32_t ifoutucastpkts;
180 u32_t ifoutnucastpkts;
187 struct stats_proto link;
190 struct stats_proto etharp;
193 struct stats_proto ip_frag;
196 struct stats_proto ip;
199 struct stats_proto icmp;
202 struct stats_igmp igmp;
205 struct stats_proto udp;
208 struct stats_proto tcp;
211 struct stats_mem
mem;
217 struct stats_sys sys;
220 struct stats_proto ip6;
223 struct stats_proto icmp6;
226 struct stats_proto ip6_frag;
229 struct stats_igmp mld6;
232 struct stats_proto nd6;
235 struct stats_mib2 mib2;
239 extern struct stats_ lwip_stats;
243 #define STATS_INC(x) ++lwip_stats.x 244 #define STATS_DEC(x) --lwip_stats.x 245 #define STATS_INC_USED(x, y) do { lwip_stats.x.used += y; \ 246 if (lwip_stats.x.max < lwip_stats.x.used) { \ 247 lwip_stats.x.max = lwip_stats.x.used; \ 250 #define STATS_GET(x) lwip_stats.x 255 #define STATS_INC_USED(x) 259 #define TCP_STATS_INC(x) STATS_INC(x) 260 #define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") 262 #define TCP_STATS_INC(x) 263 #define TCP_STATS_DISPLAY() 267 #define UDP_STATS_INC(x) STATS_INC(x) 268 #define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") 270 #define UDP_STATS_INC(x) 271 #define UDP_STATS_DISPLAY() 275 #define ICMP_STATS_INC(x) STATS_INC(x) 276 #define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") 278 #define ICMP_STATS_INC(x) 279 #define ICMP_STATS_DISPLAY() 283 #define IGMP_STATS_INC(x) STATS_INC(x) 284 #define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp, "IGMP") 286 #define IGMP_STATS_INC(x) 287 #define IGMP_STATS_DISPLAY() 291 #define IP_STATS_INC(x) STATS_INC(x) 292 #define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") 294 #define IP_STATS_INC(x) 295 #define IP_STATS_DISPLAY() 299 #define IPFRAG_STATS_INC(x) STATS_INC(x) 300 #define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") 302 #define IPFRAG_STATS_INC(x) 303 #define IPFRAG_STATS_DISPLAY() 307 #define ETHARP_STATS_INC(x) STATS_INC(x) 308 #define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") 310 #define ETHARP_STATS_INC(x) 311 #define ETHARP_STATS_DISPLAY() 315 #define LINK_STATS_INC(x) STATS_INC(x) 316 #define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") 318 #define LINK_STATS_INC(x) 319 #define LINK_STATS_DISPLAY() 323 #define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y 324 #define MEM_STATS_INC(x) STATS_INC(mem.x) 325 #define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y) 326 #define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x -= y 327 #define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") 329 #define MEM_STATS_AVAIL(x, y) 330 #define MEM_STATS_INC(x) 331 #define MEM_STATS_INC_USED(x, y) 332 #define MEM_STATS_DEC_USED(x, y) 333 #define MEM_STATS_DISPLAY() 337 #define MEMP_STATS_AVAIL(x, i, y) lwip_stats.memp[i].x = y 338 #define MEMP_STATS_INC(x, i) STATS_INC(memp[i].x) 339 #define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i].x) 340 #define MEMP_STATS_INC_USED(x, i) STATS_INC_USED(memp[i], 1) 341 #define MEMP_STATS_DISPLAY(i) stats_display_memp(&lwip_stats.memp[i], i) 342 #define MEMP_STATS_GET(x, i) STATS_GET(memp[i].x) 344 #define MEMP_STATS_AVAIL(x, i, y) 345 #define MEMP_STATS_INC(x, i) 346 #define MEMP_STATS_DEC(x, i) 347 #define MEMP_STATS_INC_USED(x, i) 348 #define MEMP_STATS_DISPLAY(i) 349 #define MEMP_STATS_GET(x, i) 0 353 #define SYS_STATS_INC(x) STATS_INC(sys.x) 354 #define SYS_STATS_DEC(x) STATS_DEC(sys.x) 355 #define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1) 356 #define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) 358 #define SYS_STATS_INC(x) 359 #define SYS_STATS_DEC(x) 360 #define SYS_STATS_INC_USED(x) 361 #define SYS_STATS_DISPLAY() 365 #define IP6_STATS_INC(x) STATS_INC(x) 366 #define IP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6, "IPv6") 368 #define IP6_STATS_INC(x) 369 #define IP6_STATS_DISPLAY() 373 #define ICMP6_STATS_INC(x) STATS_INC(x) 374 #define ICMP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp6, "ICMPv6") 376 #define ICMP6_STATS_INC(x) 377 #define ICMP6_STATS_DISPLAY() 381 #define IP6_FRAG_STATS_INC(x) STATS_INC(x) 382 #define IP6_FRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6_frag, "IPv6 FRAG") 384 #define IP6_FRAG_STATS_INC(x) 385 #define IP6_FRAG_STATS_DISPLAY() 389 #define MLD6_STATS_INC(x) STATS_INC(x) 390 #define MLD6_STATS_DISPLAY() stats_display_igmp(&lwip_stats.mld6, "MLDv1") 392 #define MLD6_STATS_INC(x) 393 #define MLD6_STATS_DISPLAY() 397 #define ND6_STATS_INC(x) STATS_INC(x) 398 #define ND6_STATS_DISPLAY() stats_display_proto(&lwip_stats.nd6, "ND") 400 #define ND6_STATS_INC(x) 401 #define ND6_STATS_DISPLAY() 405 #define MIB2_STATS_INC(x) STATS_INC(x) 407 #define MIB2_STATS_INC(x) 411 #if LWIP_STATS_DISPLAY 419 #define stats_display() 420 #define stats_display_proto(proto, name) 421 #define stats_display_igmp(igmp, name) 422 #define stats_display_mem(mem, name) 423 #define stats_display_memp(mem, index) 424 #define stats_display_sys(sys)
#define stats_display_mem(mem, name)
#define stats_display_proto(proto, name)
#define stats_display_igmp(igmp, name)
#define stats_display_memp(mem, index)
#define stats_display_sys(sys)