Microchip® Advanced Software Framework

rpl-dag.c File Reference

    Logic for Directed Acyclic Graphs in RPL.
Author
Joakim Eriksson joaki.nosp@m.me@s.nosp@m.ics.s.nosp@m.e, Nicolas Tsiftes nvt@s.nosp@m.ics..nosp@m.se Contributors: George Oikonomou oikon.nosp@m.omou.nosp@m.@user.nosp@m.s.so.nosp@m.urcef.nosp@m.orge.nosp@m..net (multicast)
#include "contiki.h"
#include "net/rpl/rpl-private.h"
#include "net/ip/uip.h"
#include "net/ipv6/uip-nd6.h"
#include "net/nbr-table.h"
#include "uip-mcast6.h"
#include "list.h"
#include "memb.h"
#include "sys/ctimer.h"
#include <limits.h>
#include <string.h>
#include "net/ip/uip-debug.h"

Macros

#define _DEBUG_   0
 
#define RPL_GROUNDED   0
 

Functions

static int acceptable_rank (rpl_dag_t *dag, rpl_rank_t rank)
 
static rpl_parent_tbest_parent (rpl_dag_t *dag)
 
static void check_prefix (rpl_prefix_t *last_prefix, rpl_prefix_t *new_prefix)
 
static rpl_parent_tfind_parent_any_dag_any_instance (uip_ipaddr_t *addr)
 
static rpl_dag_tfind_parent_dag (rpl_instance_t *instance, uip_ipaddr_t *addr)
 
static rpl_dag_tget_dag (uint8_t instance_id, uip_ipaddr_t *dag_id)
 
static void global_repair (uip_ipaddr_t *from, rpl_dag_t *dag, rpl_dio_t *dio)
 
static int lollipop_greater_than (int a, int b)
 
static void nbr_callback (void *ptr)
 
 NBR_TABLE (rpl_parent_t, rpl_parents)
 
static void nullify_parents (rpl_dag_t *dag, rpl_rank_t minimum_rank)
 
static void remove_parents (rpl_dag_t *dag, rpl_rank_t minimum_rank)
 
void rpl_add_dag (uip_ipaddr_t *from, rpl_dio_t *dio)
 
rpl_parent_trpl_add_parent (rpl_dag_t *dag, rpl_dio_t *dio, uip_ipaddr_t *addr)
 
rpl_dag_trpl_alloc_dag (uint8_t instance_id, uip_ipaddr_t *dag_id)
 
rpl_instance_trpl_alloc_instance (uint8_t instance_id)
 
void rpl_dag_init (void)
 
rpl_of_trpl_find_of (rpl_ocp_t ocp)
 
rpl_parent_trpl_find_parent (rpl_dag_t *dag, uip_ipaddr_t *addr)
 
rpl_parent_trpl_find_parent_any_dag (rpl_instance_t *instance, uip_ipaddr_t *addr)
 
void rpl_free_dag (rpl_dag_t *dag)
 
void rpl_free_instance (rpl_instance_t *instance)
 
rpl_dag_trpl_get_any_dag (void)
 
rpl_instance_trpl_get_instance (uint8_t instance_id)
 
uip_ipaddr_trpl_get_parent_ipaddr (rpl_parent_t *p)
 
uint16_t rpl_get_parent_link_metric (const uip_lladdr_t *addr)
 
rpl_rank_t rpl_get_parent_rank (uip_lladdr_t *addr)
 
void rpl_join_instance (uip_ipaddr_t *from, rpl_dio_t *dio)
 
void rpl_local_repair (rpl_instance_t *instance)
 
void rpl_lock_parent (rpl_parent_t *p)
 
void rpl_move_parent (rpl_dag_t *dag_src, rpl_dag_t *dag_dst, rpl_parent_t *parent)
 
void rpl_nullify_parent (rpl_parent_t *parent)
 
void rpl_process_dio (uip_ipaddr_t *from, rpl_dio_t *dio)
 
int rpl_process_parent_event (rpl_instance_t *instance, rpl_parent_t *p)
 
void rpl_recalculate_ranks (void)
 
void rpl_remove_parent (rpl_parent_t *parent)
 
int rpl_repair_root (uint8_t instance_id)
 
rpl_dag_trpl_select_dag (rpl_instance_t *instance, rpl_parent_t *p)
 
rpl_parent_trpl_select_parent (rpl_dag_t *dag)
 
void rpl_set_default_instance (rpl_instance_t *instance)
 
int rpl_set_default_route (rpl_instance_t *instance, uip_ipaddr_t *from)
 
static void rpl_set_preferred_parent (rpl_dag_t *dag, rpl_parent_t *p)
 
int rpl_set_prefix (rpl_dag_t *dag, uip_ipaddr_t *prefix, unsigned len)
 
rpl_dag_trpl_set_root (uint8_t instance_id, uip_ipaddr_t *dag_id)
 
static void set_ip_from_prefix (uip_ipaddr_t *ipaddr, rpl_prefix_t *prefix)
 
static int should_send_dao (rpl_instance_t *instance, rpl_dio_t *dio, rpl_parent_t *p)
 

Variables

rpl_instance_tdefault_instance
 
rpl_instance_t instance_table [RPL_MAX_INSTANCES]
 
static rpl_of_t *const objective_functions [] = {&RPL_OF}
 
rpl_of_t RPL_OF