39 #ifdef LINK_STATS_CONF_ETX_DIVISOR 40 #define LINK_STATS_ETX_DIVISOR LINK_STATS_CONF_ETX_DIVISOR 42 #define LINK_STATS_ETX_DIVISOR 128 46 #ifdef LINK_STATS_CONF_INIT_ETX_FROM_RSSI 47 #define LINK_STATS_INIT_ETX_FROM_RSSI LINK_STATS_CONF_INIT_ETX_FROM_RSSI 49 #define LINK_STATS_INIT_ETX_FROM_RSSI 1 53 #ifdef LINK_STATS_CONF_ETX_FROM_PACKET_COUNT 54 #define LINK_STATS_ETX_FROM_PACKET_COUNT LINK_STATS_CONF_ETX_FROM_PACKET_COUNT 56 #define LINK_STATS_ETX_FROM_PACKET_COUNT 0 60 #ifdef LINK_STATS_CONF_PACKET_COUNTERS 61 #define LINK_STATS_PACKET_COUNTERS LINK_STATS_CONF_PACKET_COUNTERS 63 #define LINK_STATS_PACKET_COUNTERS 0 66 typedef uint16_t link_packet_stat_t;
68 struct link_packet_counter {
70 link_packet_stat_t num_packets_tx;
72 link_packet_stat_t num_packets_acked;
74 link_packet_stat_t num_packets_rx;
80 clock_time_t last_tx_time;
84 #if LINK_STATS_ETX_FROM_PACKET_COUNT 89 #if LINK_STATS_PACKET_COUNTERS 90 struct link_packet_counter cnt_current;
91 struct link_packet_counter cnt_total;
96 const struct link_stats *link_stats_from_lladdr(
const linkaddr_t *lladdr);
98 const linkaddr_t *link_stats_get_lladdr(
const struct link_stats *);
100 int link_stats_is_fresh(
const struct link_stats *stats);
102 void link_stats_reset(
void);
104 void link_stats_init(
void);
106 void link_stats_packet_sent(
const linkaddr_t *lladdr,
int status,
int numtx);
108 void link_stats_input_callback(
const linkaddr_t *lladdr);
Header file for the link-layer address representation