53 #ifndef COLLECT_NEIGHBOR_H_
54 #define COLLECT_NEIGHBOR_H_
60 struct collect_neighbor_list {
62 struct ctimer periodic;
65 struct collect_neighbor {
66 struct collect_neighbor *next;
72 struct timer congested_timer;
75 void collect_neighbor_init(
void);
77 list_t collect_neighbor_list(
struct collect_neighbor_list *neighbor_list);
79 void collect_neighbor_list_new(
struct collect_neighbor_list *neighbor_list);
81 int collect_neighbor_list_add(
struct collect_neighbor_list *neighbor_list,
82 const linkaddr_t *addr, uint16_t rtmetric);
83 void collect_neighbor_list_remove(
struct collect_neighbor_list *neighbor_list,
84 const linkaddr_t *addr);
85 struct collect_neighbor *collect_neighbor_list_find(
struct collect_neighbor_list *neighbor_list,
86 const linkaddr_t *addr);
87 struct collect_neighbor *collect_neighbor_list_best(
struct collect_neighbor_list *neighbor_list);
88 int collect_neighbor_list_num(
struct collect_neighbor_list *neighbor_list);
89 struct collect_neighbor *collect_neighbor_list_get(
struct collect_neighbor_list *neighbor_list,
int num);
90 void collect_neighbor_list_purge(
struct collect_neighbor_list *neighbor_list);
92 void collect_neighbor_update_rtmetric(
struct collect_neighbor *n,
94 void collect_neighbor_tx(
struct collect_neighbor *n, uint16_t num_tx);
95 void collect_neighbor_rx(
struct collect_neighbor *n);
96 void collect_neighbor_tx_fail(
struct collect_neighbor *n, uint16_t num_tx);
97 void collect_neighbor_set_congested(
struct collect_neighbor *n);
98 int collect_neighbor_is_congested(
struct collect_neighbor *n);
100 uint16_t collect_neighbor_link_estimate(
struct collect_neighbor *n);
101 uint16_t collect_neighbor_rtmetric_link_estimate(
struct collect_neighbor *n);
102 uint16_t collect_neighbor_rtmetric(
struct collect_neighbor *n);
Linked list manipulation routines.
void ** list_t
The linked list type.
Header file for the Collect link estimate
#define LIST_STRUCT(name)
Declare a linked list inside a structure declaraction.
uint16_t collect_link_estimate(struct collect_link_estimate *le)
Compute the link estimate metric for a link estimate.
Header file for the Rime address representation