Blame view

RIOT/sys/include/net/netstats.h 1.56 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  /*
   * Copyright (C) 2016 INRIA
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @defgroup    net_netstats Packet statistics per module
   * @ingroup     net
   * @brief       Each module may store information about sent and received packets
   * @{
   *
   * @file
   * @brief       Definition of net statistics
   *
   * @author      Oliver Hahm <oliver.hahm@inria.fr>
   */
  
  #include <stdint.h>
  
  #ifndef NET_NETSTATS_H
  #define NET_NETSTATS_H
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @name @ref net_netstats module names
   * @{
   */
  #define NETSTATS_LAYER2     (0x01)
  #define NETSTATS_IPV6       (0x02)
  #define NETSTATS_RPL        (0x03)
  #define NETSTATS_ALL        (0xFF)
  /** @} */
  
  /**
   * @brief       Global statistics struct
   */
  typedef struct {
      uint32_t tx_unicast_count;  /**< packets sent via unicast */
      uint32_t tx_mcast_count;    /**< packets sent via multicast
                                       (including broadcast) */
      uint32_t tx_success;        /**< successful sending operations
                                       (either acknowledged or unconfirmed
                                       sending operation, e.g. multicast) */
      uint32_t tx_failed;         /**< failed sending operations */
      uint32_t tx_bytes;          /**< sent bytes */
      uint32_t rx_count;          /**< received (data) packets */
      uint32_t rx_bytes;          /**< received bytes */
  } netstats_t;
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* NET_NETSTATS_H */
  /** @} */