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.
nwk_stats_api.h
00001 /* 00002 * Copyright (c) 2013-2017, Arm Limited and affiliates. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 #ifndef NWK_STATS_API_H 00018 #define NWK_STATS_API_H 00019 /** 00020 * \file nwk_stats_api.h 00021 * \brief 6LowPAN library network stats API 00022 * 00023 * - protocol_stats_start(), Enable stats update. 00024 * - protocol_stats_stop(), Stop stack stats update. 00025 * - protocol_stats_reset(), Reset all stats information to null. 00026 * 00027 * 00028 */ 00029 00030 #include "ns_types.h" 00031 00032 #ifdef __cplusplus 00033 extern "C" { 00034 #endif 00035 00036 /** 00037 * /struct nwk_stats_t 00038 * /brief Struct for network stats buffer structure. 00039 */ 00040 typedef struct nwk_stats_t { 00041 /* 6Lowpan */ 00042 uint32_t ip_rx_count; /**< IP RX packet count. */ 00043 uint32_t ip_tx_count; /**< IP TX packet count. */ 00044 uint32_t ip_rx_drop; /**< IP RX packet drops count. */ 00045 uint32_t ip_cksum_error; /**< IP checksum error count. */ 00046 /* IP Payload Flow */ 00047 uint32_t ip_tx_bytes; /**< IP TX bytes count. */ 00048 uint32_t ip_rx_bytes; /**< IP RX bytes count. */ 00049 uint32_t ip_routed_up; /**< IP routed UP bytes count. */ 00050 uint32_t ip_no_route; /**< IP no route count. */ 00051 /* Fragments */ 00052 uint32_t frag_rx_errors; /**< Fragmentation RX error count. */ 00053 uint32_t frag_tx_errors; /**< Fragmentation TX error count. */ 00054 /*RPL stats*/ 00055 uint32_t rpl_route_routecost_better_change; /**< RPL parent change count. */ 00056 uint32_t ip_routeloop_detect; /**< RPL route loop detection count. */ 00057 uint32_t rpl_memory_overflow; /**< RPL memory overflow count. */ 00058 uint32_t rpl_parent_tx_fail; /**< RPL transmit errors to DODAG parents. */ 00059 uint32_t rpl_unknown_instance; /**< RPL unknown instance ID count. */ 00060 uint32_t rpl_local_repair; /**< RPL local repair count. */ 00061 uint32_t rpl_global_repair; /**< RPL global repair count. */ 00062 uint32_t rpl_malformed_message; /**< RPL malformed message count. */ 00063 uint32_t rpl_time_no_next_hop; /**< RPL seconds without a next hop. */ 00064 uint32_t rpl_total_memory; /**< RPL current memory usage total. */ 00065 /* Buffers */ 00066 uint32_t buf_alloc; /**< Buffer allocation count. */ 00067 uint32_t buf_headroom_realloc; /**< Buffer headroom realloc count. */ 00068 uint32_t buf_headroom_shuffle; /**< Buffer headroom shuffle count. */ 00069 uint32_t buf_headroom_fail; /**< Buffer headroom failure count. */ 00070 /* ETX */ 00071 uint16_t etx_1st_parent; /**< Primary parent ETX. */ 00072 uint16_t etx_2nd_parent; /**< Secondary parent ETX. */ 00073 00074 } nwk_stats_t; 00075 00076 /** 00077 * \brief Enable stats collection. 00078 * 00079 * \param stats_ptr A static pointer to stack update. 00080 * 00081 */ 00082 extern void protocol_stats_start(nwk_stats_t *stats_ptr); 00083 /** 00084 * \brief Disable stats collection. 00085 * 00086 */ 00087 extern void protocol_stats_stop(void); 00088 /** 00089 * \brief Reset stats info fiels. 00090 * 00091 */ 00092 extern void protocol_stats_reset(void); 00093 #ifdef __cplusplus 00094 } 00095 #endif 00096 #endif
Generated on Tue Jul 12 2022 14:24:30 by
