Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mbed-os/features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/nanostack/nwk_stats_api.h@0:fb8047b156bb, 2020-01-15 (annotated)
- Committer:
- rahul_dahiya
- Date:
- Wed Jan 15 15:57:15 2020 +0530
- Revision:
- 0:fb8047b156bb
STM32F7 LWIP
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rahul_dahiya |
0:fb8047b156bb | 1 | /* |
| rahul_dahiya |
0:fb8047b156bb | 2 | * Copyright (c) 2013-2017 ARM Limited. All rights reserved. |
| rahul_dahiya |
0:fb8047b156bb | 3 | * |
| rahul_dahiya |
0:fb8047b156bb | 4 | * SPDX-License-Identifier: LicenseRef-PBL |
| rahul_dahiya |
0:fb8047b156bb | 5 | * |
| rahul_dahiya |
0:fb8047b156bb | 6 | * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. |
| rahul_dahiya |
0:fb8047b156bb | 7 | * You may obtain a copy of the License at |
| rahul_dahiya |
0:fb8047b156bb | 8 | * |
| rahul_dahiya |
0:fb8047b156bb | 9 | * https://www.mbed.com/licenses/PBL-1.0 |
| rahul_dahiya |
0:fb8047b156bb | 10 | * |
| rahul_dahiya |
0:fb8047b156bb | 11 | * See the License for the specific language governing permissions and limitations under the License. |
| rahul_dahiya |
0:fb8047b156bb | 12 | * |
| rahul_dahiya |
0:fb8047b156bb | 13 | */ |
| rahul_dahiya |
0:fb8047b156bb | 14 | #ifndef NWK_STATS_API_H |
| rahul_dahiya |
0:fb8047b156bb | 15 | #define NWK_STATS_API_H |
| rahul_dahiya |
0:fb8047b156bb | 16 | /** |
| rahul_dahiya |
0:fb8047b156bb | 17 | * \file nwk_stats_api.h |
| rahul_dahiya |
0:fb8047b156bb | 18 | * \brief 6LowPAN library network stats API |
| rahul_dahiya |
0:fb8047b156bb | 19 | * |
| rahul_dahiya |
0:fb8047b156bb | 20 | * - protocol_stats_start(), Enable stats update. |
| rahul_dahiya |
0:fb8047b156bb | 21 | * - protocol_stats_stop(), Stop stack stats update. |
| rahul_dahiya |
0:fb8047b156bb | 22 | * - protocol_stats_reset(), Reset all stats information to null. |
| rahul_dahiya |
0:fb8047b156bb | 23 | * |
| rahul_dahiya |
0:fb8047b156bb | 24 | * |
| rahul_dahiya |
0:fb8047b156bb | 25 | */ |
| rahul_dahiya |
0:fb8047b156bb | 26 | |
| rahul_dahiya |
0:fb8047b156bb | 27 | #include "ns_types.h" |
| rahul_dahiya |
0:fb8047b156bb | 28 | |
| rahul_dahiya |
0:fb8047b156bb | 29 | #ifdef __cplusplus |
| rahul_dahiya |
0:fb8047b156bb | 30 | extern "C" { |
| rahul_dahiya |
0:fb8047b156bb | 31 | #endif |
| rahul_dahiya |
0:fb8047b156bb | 32 | |
| rahul_dahiya |
0:fb8047b156bb | 33 | /** |
| rahul_dahiya |
0:fb8047b156bb | 34 | * /struct nwk_stats_t |
| rahul_dahiya |
0:fb8047b156bb | 35 | * /brief Struct for network stats buffer structure. |
| rahul_dahiya |
0:fb8047b156bb | 36 | */ |
| rahul_dahiya |
0:fb8047b156bb | 37 | typedef struct nwk_stats_t { |
| rahul_dahiya |
0:fb8047b156bb | 38 | /*mac stats*/ |
| rahul_dahiya |
0:fb8047b156bb | 39 | uint16_t mac_tx_buffer_overflow; /**< MAC TX queue overflow count. */ |
| rahul_dahiya |
0:fb8047b156bb | 40 | uint16_t mac_tx_queue_size; /**< MAC TX queue current size. */ |
| rahul_dahiya |
0:fb8047b156bb | 41 | uint16_t mac_tx_queue_peak; /**< MAC TX queue peak size. */ |
| rahul_dahiya |
0:fb8047b156bb | 42 | uint32_t mac_rx_count; /**< MAC RX packet count. */ |
| rahul_dahiya |
0:fb8047b156bb | 43 | uint32_t mac_tx_count; /**< MAC TX packet count. */ |
| rahul_dahiya |
0:fb8047b156bb | 44 | uint32_t mac_bc_tx_count; /**< MAC broadcast TX packet count. */ |
| rahul_dahiya |
0:fb8047b156bb | 45 | uint32_t mac_rx_drop; /**< MAC RX packet drop count. */ |
| rahul_dahiya |
0:fb8047b156bb | 46 | /* Mac Payload Flow */ |
| rahul_dahiya |
0:fb8047b156bb | 47 | uint32_t mac_tx_bytes; /**< MAC TX bytes count. */ |
| rahul_dahiya |
0:fb8047b156bb | 48 | uint32_t mac_rx_bytes; /**< MAC RX bytes count. */ |
| rahul_dahiya |
0:fb8047b156bb | 49 | uint32_t mac_tx_failed; /**< MAC TX failed count. */ |
| rahul_dahiya |
0:fb8047b156bb | 50 | uint32_t mac_tx_retry; /**< MAC TX retry count. */ |
| rahul_dahiya |
0:fb8047b156bb | 51 | uint32_t mac_tx_cca_cnt; /**< MAC TX CCA count. */ |
| rahul_dahiya |
0:fb8047b156bb | 52 | uint32_t mac_tx_failed_cca; /**< MAC failed CCA count. */ |
| rahul_dahiya |
0:fb8047b156bb | 53 | uint32_t mac_security_drop; /**< MAC security packet drops count. */ |
| rahul_dahiya |
0:fb8047b156bb | 54 | /* 6Lowpan */ |
| rahul_dahiya |
0:fb8047b156bb | 55 | uint32_t ip_rx_count; /**< IP RX packet count. */ |
| rahul_dahiya |
0:fb8047b156bb | 56 | uint32_t ip_tx_count; /**< IP TX packet count. */ |
| rahul_dahiya |
0:fb8047b156bb | 57 | uint32_t ip_rx_drop; /**< IP RX packet drops count. */ |
| rahul_dahiya |
0:fb8047b156bb | 58 | uint32_t ip_cksum_error; /**< IP checksum error count. */ |
| rahul_dahiya |
0:fb8047b156bb | 59 | /* IP Payload Flow */ |
| rahul_dahiya |
0:fb8047b156bb | 60 | uint32_t ip_tx_bytes; /**< IP TX bytes count. */ |
| rahul_dahiya |
0:fb8047b156bb | 61 | uint32_t ip_rx_bytes; /**< IP RX bytes count. */ |
| rahul_dahiya |
0:fb8047b156bb | 62 | uint32_t ip_routed_up; /**< IP routed UP bytes count. */ |
| rahul_dahiya |
0:fb8047b156bb | 63 | uint32_t ip_no_route; /**< IP no route count. */ |
| rahul_dahiya |
0:fb8047b156bb | 64 | /* Fragments */ |
| rahul_dahiya |
0:fb8047b156bb | 65 | uint32_t frag_rx_errors; /**< Fragmentation RX error count. */ |
| rahul_dahiya |
0:fb8047b156bb | 66 | uint32_t frag_tx_errors; /**< Fragmentation TX error count. */ |
| rahul_dahiya |
0:fb8047b156bb | 67 | /*RPL stats*/ |
| rahul_dahiya |
0:fb8047b156bb | 68 | uint32_t rpl_route_routecost_better_change; /**< RPL parent change count. */ |
| rahul_dahiya |
0:fb8047b156bb | 69 | uint32_t ip_routeloop_detect; /**< RPL route loop detection count. */ |
| rahul_dahiya |
0:fb8047b156bb | 70 | uint32_t rpl_memory_overflow; /**< RPL memory overflow count. */ |
| rahul_dahiya |
0:fb8047b156bb | 71 | uint32_t rpl_parent_tx_fail; /**< RPL transmit errors to DODAG parents. */ |
| rahul_dahiya |
0:fb8047b156bb | 72 | uint32_t rpl_unknown_instance; /**< RPL unknown instance ID count. */ |
| rahul_dahiya |
0:fb8047b156bb | 73 | uint32_t rpl_local_repair; /**< RPL local repair count. */ |
| rahul_dahiya |
0:fb8047b156bb | 74 | uint32_t rpl_global_repair; /**< RPL global repair count. */ |
| rahul_dahiya |
0:fb8047b156bb | 75 | uint32_t rpl_malformed_message; /**< RPL malformed message count. */ |
| rahul_dahiya |
0:fb8047b156bb | 76 | uint32_t rpl_time_no_next_hop; /**< RPL seconds without a next hop. */ |
| rahul_dahiya |
0:fb8047b156bb | 77 | uint32_t rpl_total_memory; /**< RPL current memory usage total. */ |
| rahul_dahiya |
0:fb8047b156bb | 78 | /* Buffers */ |
| rahul_dahiya |
0:fb8047b156bb | 79 | uint32_t buf_alloc; /**< Buffer allocation count. */ |
| rahul_dahiya |
0:fb8047b156bb | 80 | uint32_t buf_headroom_realloc; /**< Buffer headroom realloc count. */ |
| rahul_dahiya |
0:fb8047b156bb | 81 | uint32_t buf_headroom_shuffle; /**< Buffer headroom shuffle count. */ |
| rahul_dahiya |
0:fb8047b156bb | 82 | uint32_t buf_headroom_fail; /**< Buffer headroom failure count. */ |
| rahul_dahiya |
0:fb8047b156bb | 83 | /* ETX */ |
| rahul_dahiya |
0:fb8047b156bb | 84 | uint16_t etx_1st_parent; /**< Primary parent ETX. */ |
| rahul_dahiya |
0:fb8047b156bb | 85 | uint16_t etx_2nd_parent; /**< Secondary parent ETX. */ |
| rahul_dahiya |
0:fb8047b156bb | 86 | |
| rahul_dahiya |
0:fb8047b156bb | 87 | } nwk_stats_t; |
| rahul_dahiya |
0:fb8047b156bb | 88 | |
| rahul_dahiya |
0:fb8047b156bb | 89 | /** |
| rahul_dahiya |
0:fb8047b156bb | 90 | * \brief Enable stats collection. |
| rahul_dahiya |
0:fb8047b156bb | 91 | * |
| rahul_dahiya |
0:fb8047b156bb | 92 | * \param stats_ptr A static pointer to stack update. |
| rahul_dahiya |
0:fb8047b156bb | 93 | * |
| rahul_dahiya |
0:fb8047b156bb | 94 | */ |
| rahul_dahiya |
0:fb8047b156bb | 95 | extern void protocol_stats_start(nwk_stats_t *stats_ptr); |
| rahul_dahiya |
0:fb8047b156bb | 96 | /** |
| rahul_dahiya |
0:fb8047b156bb | 97 | * \brief Disable stats collection. |
| rahul_dahiya |
0:fb8047b156bb | 98 | * |
| rahul_dahiya |
0:fb8047b156bb | 99 | */ |
| rahul_dahiya |
0:fb8047b156bb | 100 | extern void protocol_stats_stop(void); |
| rahul_dahiya |
0:fb8047b156bb | 101 | /** |
| rahul_dahiya |
0:fb8047b156bb | 102 | * \brief Reset stats info fiels. |
| rahul_dahiya |
0:fb8047b156bb | 103 | * |
| rahul_dahiya |
0:fb8047b156bb | 104 | */ |
| rahul_dahiya |
0:fb8047b156bb | 105 | extern void protocol_stats_reset(void); |
| rahul_dahiya |
0:fb8047b156bb | 106 | #ifdef __cplusplus |
| rahul_dahiya |
0:fb8047b156bb | 107 | } |
| rahul_dahiya |
0:fb8047b156bb | 108 | #endif |
| rahul_dahiya |
0:fb8047b156bb | 109 | #endif |