48 #ifndef RPL_CONF_STATS
49 #define RPL_CONF_STATS 0
57 #ifdef RPL_CONF_DAG_MC
58 #define RPL_DAG_MC RPL_CONF_DAG_MC
60 #define RPL_DAG_MC RPL_DAG_MC_ETX
69 #define RPL_OF RPL_CONF_OF
72 #define RPL_OF rpl_of_etx
76 #define RPL_DEFAULT_INSTANCE 0
80 #define RPL_ANY_INSTANCE -1
83 #define RPL_PARENT_COUNT(dag) list_length((dag)->parents)
85 typedef uint16_t rpl_rank_t;
86 typedef uint8_t rpl_lifetime_t;
87 typedef uint16_t rpl_ocp_t;
91 #define RPL_DAG_MC_NONE 0
92 #define RPL_DAG_MC_NSA 1
93 #define RPL_DAG_MC_ENERGY 2
94 #define RPL_DAG_MC_HOPCOUNT 3
95 #define RPL_DAG_MC_THROUGHPUT 4
96 #define RPL_DAG_MC_LATENCY 5
97 #define RPL_DAG_MC_LQL 6
98 #define RPL_DAG_MC_ETX 7
99 #define RPL_DAG_MC_LC 8
102 #define RPL_DAG_MC_FLAG_P 0x8
103 #define RPL_DAG_MC_FLAG_C 0x4
104 #define RPL_DAG_MC_FLAG_O 0x2
105 #define RPL_DAG_MC_FLAG_R 0x1
108 #define RPL_DAG_MC_AGGR_ADDITIVE 0
109 #define RPL_DAG_MC_AGGR_MAXIMUM 1
110 #define RPL_DAG_MC_AGGR_MINIMUM 2
111 #define RPL_DAG_MC_AGGR_MULTIPLICATIVE 3
115 #define RPL_DAG_MC_ENERGY_INCLUDED 3
116 #define RPL_DAG_MC_ENERGY_TYPE 1
117 #define RPL_DAG_MC_ENERGY_ESTIMATION 0
119 #define RPL_DAG_MC_ENERGY_TYPE_MAINS 0
120 #define RPL_DAG_MC_ENERGY_TYPE_BATTERY 1
121 #define RPL_DAG_MC_ENERGY_TYPE_SCAVENGING 2
123 struct rpl_metric_object_energy {
129 struct rpl_metric_container {
135 union metric_object {
136 struct rpl_metric_object_energy energy;
140 typedef struct rpl_metric_container rpl_metric_container_t;
145 struct rpl_parent *
next;
147 rpl_metric_container_t mc;
154 typedef struct rpl_parent rpl_parent_t;
188 void (*reset)(
struct rpl_dag *);
189 void (*parent_state_callback)(rpl_parent_t *, int, int);
190 rpl_parent_t *(*best_parent)(rpl_parent_t *, rpl_parent_t *);
191 rpl_rank_t (*calculate_rank)(rpl_parent_t *, rpl_rank_t);
192 void (*update_metric_container)(
struct rpl_dag *);
195 typedef struct rpl_of rpl_of_t;
204 typedef struct rpl_prefix rpl_prefix_t;
209 rpl_metric_container_t mc;
222 uint8_t dio_intdoubl;
224 uint8_t dio_redundancy;
225 rpl_rank_t max_rankinc;
226 rpl_rank_t min_hoprankinc;
228 uint8_t default_lifetime;
229 uint16_t lifetime_unit;
232 uint8_t dio_intcurrent;
238 uint16_t dio_totsend;
239 uint16_t dio_totrecv;
241 uint32_t dio_next_delay;
242 struct ctimer dio_timer;
243 struct ctimer dao_timer;
244 rpl_parent_t *preferred_parent;
247 rpl_prefix_t prefix_info;
249 typedef struct rpl_dag rpl_dag_t;
254 int rpl_set_prefix(rpl_dag_t *dag,
uip_ipaddr_t *prefix,
int len);
255 int rpl_repair_dag(rpl_dag_t *dag);
256 int rpl_set_default_route(rpl_dag_t *dag,
uip_ipaddr_t *from);
257 rpl_dag_t *rpl_get_dag(
int instance_id);