-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathifstates.h
53 lines (35 loc) · 1.29 KB
/
ifstates.h
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
#ifndef _ROOT_STORAGE_0_IFSTATES_H_
#define _ROOT_STORAGE_0_IFSTATES_H_
#include <inttypes.h>
#include <stddef.h>
#include "traffic.h"
#include "../utils.h" // for Address type
#include "../ext/uthash.h"
// Per interface state. Removed/added only by interface_handler().
typedef struct {
uint32_t ifindex;
uint32_t neighbor_count;
//enum INTERFACE_TYPE interface_type; // bluetooth, ethernet, lora
//uint64_t send_broadcast_time;
// We need to forward a broadcast (RREQ) if a neighbor uses us a source.
//uint64_t recv_own_broadcast_time;
Address recv_own_broadcast_address;
uint64_t neighborhood_changed_time; // parent changed or neighbor added/removed
uint64_t send_broadcast_time;
uint64_t recv_own_broadcast_time;
uint64_t recv_required_broadcast_time;
// hm that should move to neighbor
uint32_t ROOT_CREATE_send_interval_ms;
// maybe put neighbors into her?
// TODO: use
Traffic unicast_traffic;
Traffic broadcast_traffic;
UT_hash_handle hh;
} IFState;
IFState *ifstates_all(); // TODO: remove
IFState *ifstates_find(const uint32_t ifindex);
void ifstates_remove(const uint32_t ifindex);
IFState *ifstates_create(const uint32_t ifindex);
// create non-existing entries
IFState *ifstates_get(const Address *address);
#endif