1 /** 2 * @file 3 * Statistics API (to be used from TCPIP thread) 4 */ 5 6 /* 7 * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 * All rights reserved. 9 * 10 * Redistribution and use in source and binary forms, with or without modification, 11 * are permitted provided that the following conditions are met: 12 * 13 * 1. Redistributions of source code must retain the above copyright notice, 14 * this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright notice, 16 * this list of conditions and the following disclaimer in the documentation 17 * and/or other materials provided with the distribution. 18 * 3. The name of the author may not be used to endorse or promote products 19 * derived from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 * OF SUCH DAMAGE. 31 * 32 * This file is part of the lwIP TCP/IP stack. 33 * 34 * Author: Adam Dunkels <adam@sics.se> 35 * 36 */ 37 #ifndef LWIP_HDR_STATS_H 38 #define LWIP_HDR_STATS_H 39 40 #include "lwip/opt.h" 41 #include "netif/lowpan6_opts.h" 42 #include "lwip/mem.h" 43 #include "lwip/memp.h" 44 #include "lwip/err.h" 45 46 #if defined (__cplusplus) && __cplusplus 47 extern "C" { 48 #endif 49 50 #if LWIP_STATS 51 52 #ifndef LWIP_STATS_LARGE 53 #define LWIP_STATS_LARGE 0 54 #endif 55 56 #if LWIP_STATS_LARGE 57 #define STAT_COUNTER u32_t 58 #define STAT_COUNTER_F U32_F 59 #else 60 #define STAT_COUNTER u16_t 61 #define STAT_COUNTER_F U16_F 62 #endif 63 64 /* Protocol related stats */ 65 struct stats_proto { 66 STAT_COUNTER xmit; /* Transmitted packets. */ 67 STAT_COUNTER recv; /* Received packets. */ 68 STAT_COUNTER fw; /* Forwarded packets. */ 69 STAT_COUNTER drop; /* Dropped packets. */ 70 STAT_COUNTER chkerr; /* Checksum error. */ 71 STAT_COUNTER lenerr; /* Invalid length error. */ 72 STAT_COUNTER memerr; /* Out of memory error. */ 73 STAT_COUNTER rterr; /* Routing error. */ 74 STAT_COUNTER proterr; /* Protocol error. */ 75 STAT_COUNTER opterr; /* Error in options. */ 76 STAT_COUNTER err; /* Misc error. */ 77 STAT_COUNTER cachehit; 78 STAT_COUNTER cache_miss; /* When NCE,RLE,DCE or PLE is missded. */ 79 STAT_COUNTER cache_full; /* When NCE,RLE,DCE or PLE is full. */ 80 81 #ifdef LWIP_IPV6 82 STAT_COUNTER destunreachs; /* Destination unreachable packets */ 83 STAT_COUNTER timeexcds; /* Time exceeded packets */ 84 STAT_COUNTER parmprobs; /* Parameter problem */ 85 #endif 86 87 #if LWIP_NAT64 88 STAT_COUNTER natfw; /* Forwarded packets. */ 89 STAT_COUNTER natdrop; /* Dropped packets. */ 90 #endif 91 92 STAT_COUNTER link_rx_drop; /* Recvd frames discard count */ 93 STAT_COUNTER link_tx_drop; /* To be sent frames discard count */ 94 STAT_COUNTER link_rx_overrun; /* FIFO overrun */ 95 STAT_COUNTER ip_rx_err; /* Recvd IP packet error */ 96 STAT_COUNTER ip_tx_err; /* Sent IP packet error */ 97 STAT_COUNTER ip_rx_bytes; /* Recvd byte count at IP layer */ 98 STAT_COUNTER ip_tx_bytes; /* Sent byte count at IP layer */ 99 STAT_COUNTER reserve; /* reserve */ 100 }; 101 102 /* IGMP stats */ 103 struct stats_igmp { 104 STAT_COUNTER xmit; /* Transmitted packets. */ 105 STAT_COUNTER recv; /* Received packets. */ 106 STAT_COUNTER drop; /* Dropped packets. */ 107 STAT_COUNTER chkerr; /* Checksum error. */ 108 STAT_COUNTER lenerr; /* Invalid length error. */ 109 STAT_COUNTER memerr; /* Out of memory error. */ 110 STAT_COUNTER proterr; /* Protocol error. */ 111 STAT_COUNTER rx_v1; /* Received v1 frames. */ 112 STAT_COUNTER rx_group; /* Received group-specific queries. */ 113 STAT_COUNTER rx_general; /* Received general queries. */ 114 STAT_COUNTER rx_report; /* Received reports. */ 115 STAT_COUNTER tx_join; /* Sent joins. */ 116 STAT_COUNTER tx_leave; /* Sent leaves. */ 117 STAT_COUNTER tx_report; /* Sent reports. */ 118 }; 119 120 /* Memory stats */ 121 struct stats_mem { 122 #if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY 123 const char *name; 124 #endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */ 125 STAT_COUNTER err; 126 mem_size_t avail; 127 mem_size_t used; 128 mem_size_t max; 129 STAT_COUNTER illegal; 130 }; 131 132 /* System element stats */ 133 struct stats_syselem { 134 STAT_COUNTER used; 135 STAT_COUNTER max; 136 STAT_COUNTER err; 137 }; 138 139 /* System stats */ 140 struct stats_sys { 141 struct stats_syselem sem; 142 struct stats_syselem mutex; 143 struct stats_syselem mbox; 144 }; 145 146 /* SNMP MIB2 stats */ 147 struct stats_mib2 { 148 /* IP */ 149 u32_t ipinhdrerrors; 150 u32_t ipinaddrerrors; 151 u32_t ipinunknownprotos; 152 u32_t ipindiscards; 153 u32_t ipindelivers; 154 u32_t ipoutrequests; 155 u32_t ipoutdiscards; 156 u32_t ipoutnoroutes; 157 u32_t ipreasmoks; 158 u32_t ipreasmfails; 159 u32_t ipfragoks; 160 u32_t ipfragfails; 161 u32_t ipfragcreates; 162 u32_t ipreasmreqds; 163 u32_t ipforwdatagrams; 164 u32_t ipinreceives; 165 166 /* TCP */ 167 u32_t tcpactiveopens; 168 u32_t tcppassiveopens; 169 u32_t tcpattemptfails; 170 u32_t tcpestabresets; 171 u32_t tcpoutsegs; 172 u32_t tcpretranssegs; 173 u32_t tcpinsegs; 174 u32_t tcpinerrs; 175 u32_t tcpoutrsts; 176 177 /* UDP */ 178 u32_t udpindatagrams; 179 u32_t udpnoports; 180 u32_t udpinerrors; 181 u32_t udpoutdatagrams; 182 183 /* ICMP */ 184 u32_t icmpinmsgs; 185 u32_t icmpinerrors; 186 u32_t icmpindestunreachs; 187 u32_t icmpintimeexcds; 188 u32_t icmpinparmprobs; 189 u32_t icmpinsrcquenchs; 190 u32_t icmpinredirects; 191 u32_t icmpinechos; 192 u32_t icmpinechoreps; 193 u32_t icmpintimestamps; 194 u32_t icmpintimestampreps; 195 u32_t icmpinaddrmasks; 196 u32_t icmpinaddrmaskreps; 197 u32_t icmpoutmsgs; 198 u32_t icmpouterrors; 199 u32_t icmpoutdestunreachs; 200 u32_t icmpouttimeexcds; 201 u32_t icmpoutechos; /* can be incremented by user application ('ping') */ 202 u32_t icmpoutechoreps; 203 }; 204 205 /* 206 * @ingroup netif_mib2 207 * SNMP MIB2 interface stats 208 */ 209 struct stats_mib2_netif_ctrs { 210 /* The total number of octets received on the interface, including framing characters */ 211 u32_t ifinoctets; 212 /* The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were 213 * not addressed to a multicast or broadcast address at this sub-layer */ 214 u32_t ifinucastpkts; 215 /* The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were 216 * addressed to a multicast or broadcast address at this sub-layer */ 217 u32_t ifinnucastpkts; 218 /* The number of inbound packets which were chosen to be discarded even though no errors had 219 * been detected to prevent their being deliverable to a higher-layer protocol. One possible 220 * reason for discarding such a packet could be to free up buffer space */ 221 u32_t ifindiscards; 222 /* For packet-oriented interfaces, the number of inbound packets that contained errors 223 * preventing them from being deliverable to a higher-layer protocol. For character- 224 * oriented or fixed-length interfaces, the number of inbound transmission units that 225 * contained errors preventing them from being deliverable to a higher-layer protocol. */ 226 u32_t ifinerrors; 227 /* For packet-oriented interfaces, the number of packets received via the interface which 228 * were discarded because of an unknown or unsupported protocol. For character-oriented 229 * or fixed-length interfaces that support protocol multiplexing the number of transmission 230 * units received via the interface which were discarded because of an unknown or unsupported 231 * protocol. For any interface that does not support protocol multiplexing, this counter will 232 * always be 0 */ 233 u32_t ifinunknownprotos; 234 /* The number of inbound packets which were chosen to be discarded because of fifo overrun */ 235 u32_t ifinoverruns; 236 /* The total number of octets transmitted out of the interface, including framing characters. */ 237 u32_t ifoutoctets; 238 /* The total number of packets that higher-level protocols requested be transmitted, and 239 * which were not addressed to a multicast or broadcast address at this sub-layer, including 240 * those that were discarded or not sent. */ 241 u32_t ifoutucastpkts; 242 /* The total number of packets that higher-level protocols requested be transmitted, and which 243 * were addressed to a multicast or broadcast address at this sub-layer, including 244 * those that were discarded or not sent. */ 245 u32_t ifoutnucastpkts; 246 /* The number of outbound packets which were chosen to be discarded even though no errors had 247 * been detected to prevent their being transmitted. One possible reason for discarding 248 * such a packet could be to free up buffer space. */ 249 u32_t ifoutdiscards; 250 /* For packet-oriented interfaces, the number of outbound packets that could not be transmitted 251 * because of errors. For character-oriented or fixed-length interfaces, the number of outbound 252 * transmission units that could not be transmitted because of errors. */ 253 u32_t ifouterrors; 254 }; 255 256 /** 257 * @ingroup stats 258 * 6LOWPAN stats */ 259 struct stats_lowpan6 { 260 STAT_COUNTER pkt_from_ip; /**< Pkt received from top layer */ 261 STAT_COUNTER pkt_xmit; /**< Transmitted packets. */ 262 STAT_COUNTER comp_fail; /**< Compression Failure */ 263 264 STAT_COUNTER frag_recvd; /**< Fragments Received from network. */ 265 STAT_COUNTER pkt_recvd; /**< Packet Received from network. */ 266 STAT_COUNTER pkt_to_ip; /**< Packet sent to top layer. */ 267 268 STAT_COUNTER decomp_fail; /**< Decompression failures. */ 269 STAT_COUNTER discard_pkt; /**< Invalid packet/fragment. */ 270 STAT_COUNTER reass_tout; /**< Fragment reassemble timed out. */ 271 STAT_COUNTER dup_frag; /**< Duplicate fragment. */ 272 STAT_COUNTER oo_frag; /**< Out of Order fragments. */ 273 STAT_COUNTER rogue_frag; /**< Nth Fragment without first fragment. */ 274 STAT_COUNTER corrupt_pkt; /**< Corrupt 6lowpan frame. */ 275 }; 276 /* lwIP stats container */ 277 struct stats_ { 278 #if LINK_STATS 279 /* Link level */ 280 struct stats_proto link; 281 #endif 282 #if ETHARP_STATS 283 /* ARP */ 284 struct stats_proto etharp; 285 #endif 286 #if IPFRAG_STATS 287 /* Fragmentation */ 288 struct stats_proto ip_frag; 289 #endif 290 #if IP_STATS 291 /* IP */ 292 struct stats_proto ip; 293 #endif 294 #if ICMP_STATS 295 /* ICMP */ 296 struct stats_proto icmp; 297 #endif 298 #if IGMP_STATS 299 /* IGMP */ 300 struct stats_igmp igmp; 301 #endif 302 #if UDP_STATS 303 /* UDP */ 304 struct stats_proto udp; 305 #endif 306 #if TCP_STATS 307 /* TCP */ 308 struct stats_proto tcp; 309 #endif 310 #if MEM_STATS 311 /* Heap */ 312 struct stats_mem mem; 313 #endif 314 #if MEMP_STATS 315 /* Internal memory pools */ 316 struct stats_mem *memp[MEMP_MAX]; 317 #endif 318 #if SYS_STATS 319 /* System */ 320 struct stats_sys sys; 321 #endif 322 #if IP6_STATS 323 /* IPv6 */ 324 struct stats_proto ip6; 325 #endif 326 #if ICMP6_STATS 327 /* ICMP6 */ 328 struct stats_proto icmp6; 329 #endif 330 #if IP6_FRAG_STATS 331 /* IPv6 fragmentation */ 332 struct stats_proto ip6_frag; 333 #endif 334 #if MLD6_STATS 335 /* Multicast listener discovery */ 336 struct stats_igmp mld6; 337 #endif 338 #if ND6_STATS 339 /* Neighbor discovery */ 340 struct stats_proto nd6; 341 #endif 342 #if MIB2_STATS 343 /* SNMP MIB2 */ 344 struct stats_mib2 mib2; 345 #endif 346 #if DHCP6_STATS 347 /* DHCPv6 */ 348 struct stats_proto dhcp6; 349 #endif 350 #if LWIP_6LOWPAN 351 /** 6lowpan */ 352 struct stats_lowpan6 lowpan6; 353 #endif 354 }; 355 356 /* Global variable containing lwIP internal statistics. Add this to your debugger's watchlist. */ 357 extern struct stats_ lwip_stats; 358 359 /* Init statistics */ 360 void stats_init(void); 361 362 #define STATS_INC(x) ++lwip_stats.x 363 #define STATS_DEC(x) --lwip_stats.x 364 #define STATS_INC_USED(x, y, type) do { lwip_stats.x.used = (type)(lwip_stats.x.used + y); \ 365 if (lwip_stats.x.max < lwip_stats.x.used) { \ 366 lwip_stats.x.max = lwip_stats.x.used; \ 367 } \ 368 } while (0) 369 #define STATS_GET(x) lwip_stats.x 370 #else /* LWIP_STATS */ 371 #define stats_init() 372 #define STATS_INC(x) 373 #define STATS_DEC(x) 374 #define STATS_INC_USED(x, y, type) 375 #endif /* LWIP_STATS */ 376 377 #if TCP_STATS 378 #define TCP_STATS_INC(x) STATS_INC(x) 379 #define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") 380 #else 381 #define TCP_STATS_INC(x) 382 #define TCP_STATS_DISPLAY() 383 #endif 384 385 #if UDP_STATS 386 #define UDP_STATS_INC(x) STATS_INC(x) 387 #define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") 388 #else 389 #define UDP_STATS_INC(x) 390 #define UDP_STATS_DISPLAY() 391 #endif 392 393 #if ICMP_STATS 394 #define ICMP_STATS_INC(x) STATS_INC(x) 395 #define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") 396 #else 397 #define ICMP_STATS_INC(x) 398 #define ICMP_STATS_DISPLAY() 399 #endif 400 401 #if IGMP_STATS 402 #define IGMP_STATS_INC(x) STATS_INC(x) 403 #define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp, "IGMP") 404 #else 405 #define IGMP_STATS_INC(x) 406 #define IGMP_STATS_DISPLAY() 407 #endif 408 409 #if IP_STATS 410 #define IP_STATS_INC(x) STATS_INC(x) 411 #define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") 412 #else 413 #define IP_STATS_INC(x) 414 #define IP_STATS_DISPLAY() 415 #endif 416 417 #if IPFRAG_STATS 418 #define IPFRAG_STATS_INC(x) STATS_INC(x) 419 #define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") 420 #else 421 #define IPFRAG_STATS_INC(x) 422 #define IPFRAG_STATS_DISPLAY() 423 #endif 424 425 #if ETHARP_STATS 426 #define ETHARP_STATS_INC(x) STATS_INC(x) 427 #define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") 428 #else 429 #define ETHARP_STATS_INC(x) 430 #define ETHARP_STATS_DISPLAY() 431 #endif 432 433 #if LINK_STATS 434 #define LINK_STATS_INC(x) STATS_INC(x) 435 #define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") 436 #else 437 #define LINK_STATS_INC(x) 438 #define LINK_STATS_DISPLAY() 439 #endif 440 441 #if MEM_STATS 442 #define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y 443 #define MEM_STATS_INC(x) STATS_INC(mem.x) 444 #define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y, mem_size_t) 445 #define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x = (mem_size_t)((lwip_stats.mem.x) - (y)) 446 #define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") 447 #else 448 #define MEM_STATS_AVAIL(x, y) 449 #define MEM_STATS_INC(x) 450 #define MEM_STATS_INC_USED(x, y) 451 #define MEM_STATS_DEC_USED(x, y) 452 #define MEM_STATS_DISPLAY() 453 #endif 454 455 #if MEMP_STATS 456 #define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i]->x) 457 #define MEMP_STATS_DISPLAY(i) stats_display_memp(lwip_stats.memp[i], i) 458 #define MEMP_STATS_GET(x, i) STATS_GET(memp[i]->x) 459 #else 460 #define MEMP_STATS_DEC(x, i) 461 #define MEMP_STATS_DISPLAY(i) 462 #define MEMP_STATS_GET(x, i) 0 463 #endif 464 465 #if SYS_STATS 466 #define SYS_STATS_INC(x) STATS_INC(sys.x) 467 #define SYS_STATS_DEC(x) STATS_DEC(sys.x) 468 #define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1, STAT_COUNTER) 469 #define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) 470 #else 471 #define SYS_STATS_INC(x) 472 #define SYS_STATS_DEC(x) 473 #define SYS_STATS_INC_USED(x) 474 #define SYS_STATS_DISPLAY() 475 #endif 476 477 #if IP6_STATS 478 #define IP6_STATS_INC(x) STATS_INC(x) 479 #define IP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6, "IPv6") 480 #else 481 #define IP6_STATS_INC(x) 482 #define IP6_STATS_DISPLAY() 483 #endif 484 485 #if ICMP6_STATS 486 #define ICMP6_STATS_INC(x) STATS_INC(x) 487 #define ICMP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp6, "ICMPv6") 488 #else 489 #define ICMP6_STATS_INC(x) 490 #define ICMP6_STATS_DISPLAY() 491 #endif 492 493 #if IP6_FRAG_STATS 494 #define IP6_FRAG_STATS_INC(x) STATS_INC(x) 495 #define IP6_FRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6_frag, "IPv6 FRAG") 496 #else 497 #define IP6_FRAG_STATS_INC(x) 498 #define IP6_FRAG_STATS_DISPLAY() 499 #endif 500 501 #if MLD6_STATS 502 #define MLD6_STATS_INC(x) STATS_INC(x) 503 #define MLD6_STATS_DISPLAY() stats_display_igmp(&lwip_stats.mld6, "MLDv1") 504 #else 505 #define MLD6_STATS_INC(x) 506 #define MLD6_STATS_DISPLAY() 507 #endif 508 509 #if ND6_STATS 510 #define ND6_STATS_INC(x) STATS_INC(x) 511 #define ND6_STATS_DISPLAY() stats_display_proto(&lwip_stats.nd6, "ND") 512 #else 513 #define ND6_STATS_INC(x) 514 #define ND6_STATS_DISPLAY() 515 #endif 516 517 #if LOWPAN6_STATS 518 #define LOWPAN6_STATS_INC(x) STATS_INC(x) 519 #define LOWPAN6_STATS_DISPLAY() stats_display_lowpan6(&lwip_stats.lowpan6, "6LOWPAN") 520 #else 521 #define LOWPAN6_STATS_INC(x) 522 #define LOWPAN6_STATS_DISPLAY() 523 #endif 524 525 #if MIB2_STATS 526 #define MIB2_STATS_INC(x) STATS_INC(x) 527 #else 528 #define MIB2_STATS_INC(x) 529 #endif 530 531 #if DHCP6_STATS 532 #define DHCP6_STATS_INC(x) STATS_INC(x) 533 #define DHCP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.dhcp6, "DHCP6") 534 #else 535 #define DHCP6_STATS_INC(x) 536 #define DHCP6_STATS_DISPLAY() 537 #endif 538 539 #if LWIP_STATS /* LWIP_STATS */ 540 541 /* Display of statistics */ 542 #if LWIP_STATS_DISPLAY 543 void stats_display(void); 544 void stats_display_proto(struct stats_proto *proto, const char *name); 545 void stats_display_igmp(struct stats_igmp *igmp, const char *name); 546 void stats_display_mem(struct stats_mem *mem, const char *name); 547 void stats_display_memp(struct stats_mem *mem, int index); 548 void stats_display_sys(struct stats_sys *sys); 549 550 #if LOWPAN6_STATS 551 void stats_display_lowpan6(struct stats_lowpan6 *lowpan6, const char *name); 552 #endif 553 554 #else /* LWIP_STATS_DISPLAY */ 555 #define stats_display() 556 #define stats_display_proto(proto, name) 557 #define stats_display_igmp(igmp, name) 558 #define stats_display_mem(mem, name) 559 #define stats_display_memp(mem, index) 560 #define stats_display_sys(sys) 561 562 #if LOWPAN6_STATS 563 #define stats_display_lowpan6(lowpan6, name) 564 #endif 565 #endif /* LWIP_STATS_DISPLAY */ 566 567 #if LWIP_STATS_API 568 /* 569 * Func Name: lwip_statsapi_get_ipv6_stats 570 */ 571 /** 572 * @ingroup stats 573 * @brief 574 * This API is used to get IPv6 statistics information. 575 * 576 * @param[in,out] ipv6 Memory to get the IPv6 statistics information. 577 * 578 * @return 579 * ERR_OK: On success \n 580 * ERR_ARG: If any parameter is invalid \n 581 * -1: If lwip is not started 582 * 583 * 584 * @note 585 * 1. The statistics information provided here will have information of all the interfaces. 586 */ 587 err_t lwip_statsapi_get_ipv6_stats(struct stats_proto *ipv6); 588 589 /* 590 * Func Name: lwip_statsapi_get_icmpv6_stats 591 */ 592 /** 593 * @ingroup stats 594 * @brief 595 * This API is used to get icmpv6 statistics information. 596 * 597 * @param[in,out] icmpv6 Memory to get the icmpv6 statistics information. 598 * 599 * @return 600 * ERR_OK: On success \n 601 * ERR_ARG: If any parameter is invalid \n 602 * -1: If lwip is not started 603 * 604 * 605 * @note 606 * 1. The statistics information provided here will have information of all the interfaces. 607 */ 608 err_t lwip_statsapi_get_icmpv6_stats(struct stats_proto *icmpv6); 609 610 /* 611 * Func Name: lwip_statsapi_get_nd6_stats 612 */ 613 /** 614 * @ingroup stats 615 * @brief 616 * This API is used to get neighbor discovery protoco statistics information. 617 * 618 * @param[in,out] nd6 Memory to get the neighbor discovery protocol statistics information. 619 * 620 * @return 621 * ERR_OK: On success \n 622 * ERR_ARG: If any parameter is invalid \n 623 * -1: If lwip is not started 624 * 625 * 626 * @note 627 * 1. The statistics information provided here will have information of all the interfaces. 628 */ 629 err_t lwip_statsapi_get_nd6_stats(struct stats_proto *nd6); 630 631 /* 632 * Func Name: lwip_statsapi_get_tcp_stats 633 */ 634 /** 635 * @ingroup stats 636 * @brief 637 * This API is used to get tcp statistics information. 638 * 639 * @param[in,out] tcp Memory to get the tcp statistics information. 640 * 641 * @return 642 * ERR_OK: On success \n 643 * ERR_ARG: If any parameter is invalid \n 644 * -1: If lwip is not started 645 * 646 * 647 * @note 648 * 1. The statistics information provided here will have information of all the interfaces. 649 */ 650 err_t lwip_statsapi_get_tcp_stats(struct stats_proto *tcp); 651 652 /* 653 * Func Name: lwip_statsapi_get_udp_stats 654 */ 655 /** 656 * @ingroup stats 657 * @brief 658 * This API is used to get udp statistics information. 659 * 660 * @param[in,out] udp Memory to get the udp statistics information. 661 * 662 * @return 663 * ERR_OK: On success \n 664 * ERR_ARG: If any parameter is invalid \n 665 * -1: If lwip is not started 666 * 667 * 668 * @note 669 * 1. The statistics information provided here will have information of all the interfaces. 670 */ 671 err_t lwip_statsapi_get_udp_stats(struct stats_proto *udp); 672 673 /* 674 * Func Name: lwip_statsapi_get_lowpan6_stats 675 */ 676 /** 677 * @ingroup stats 678 * @brief 679 * This API is used to get lowpan statistics information. 680 * 681 * @param[in,out] lowpan6 Memory to get the lowpan6 statistics information. 682 * 683 * @return 684 * ERR_OK: On success \n 685 * ERR_ARG: If any parameter is invalid \n 686 * -1: If lwip is not started 687 * 688 * 689 * @note 690 * 1. The statistics information provided here will have information of all the interfaces. 691 */ 692 err_t lwip_statsapi_get_lowpan6_stats(struct stats_lowpan6 *lowpan6); 693 err_t lwip_statsapi_clear_lowpan6_stats(void); 694 #endif 695 696 #endif /* LWIP_STATS */ 697 698 #if defined (__cplusplus) && __cplusplus 699 } 700 #endif 701 702 #endif /* LWIP_HDR_STATS_H */ 703