Microchip® Advanced Software Framework

rpl-private.h File Reference
#include "net/rpl/rpl.h"
#include "lib/list.h"
#include "net/ip/uip.h"
#include "sys/contiki-clock.h"
#include "sys/ctimer.h"
#include "net/ipv6/uip-ds6.h"
#include "uip-mcast6.h"

Data Structures

struct  rpl_dio
 

Macros

#define BASE_RANK   0
 
#define DAG_RANK(fixpt_rank, instance)   ((fixpt_rank) / (instance)->min_hoprankinc)
 
#define DAO_EXPIRATION_TIMEOUT   60
 
#define INFINITE_RANK   0xffff
 
#define ROOT_RANK(instance)   (instance)->min_hoprankinc
 
#define RPL_CODE_DAO   0x02 /* Destination Advertisement Option */
 
#define RPL_CODE_DAO_ACK   0x03 /* DAO acknowledgment */
 
#define RPL_CODE_DIO   0x01 /* DAG Information Option */
 
#define RPL_CODE_DIS   0x00 /* DAG Information Solicitation */
 
#define RPL_CODE_SEC_DAO   0x82 /* Secure DAO */
 
#define RPL_CODE_SEC_DAO_ACK   0x83 /* Secure DAO ACK */
 
#define RPL_CODE_SEC_DIO   0x81 /* Secure DIO */
 
#define RPL_CODE_SEC_DIS   0x80 /* Secure DIS */
 
#define RPL_DAG_MC_ETX_DIVISOR   256
 
#define RPL_DAO_D_FLAG   0x40 /* DODAG ID present */
 
#define RPL_DAO_K_FLAG   0x80 /* DAO ACK requested */
 
#define RPL_DAO_LATENCY   (CLOCK_SECOND * 4)
 
#define RPL_DIO_INTERVAL_DOUBLINGS   8
 
#define RPL_DIO_INTERVAL_MIN   12
 
#define RPL_DIO_REDUNDANCY   10
 
#define RPL_DIS_INTERVAL   60
 
#define RPL_DIS_SEND   1
 
#define RPL_DIS_START_DELAY   5
 
#define RPL_HDR_OPT_DOWN   0x80
 
#define RPL_HDR_OPT_DOWN_SHIFT   7
 
#define RPL_HDR_OPT_FWD_ERR   0x20
 
#define RPL_HDR_OPT_FWD_ERR_SHIFT   5
 
#define RPL_HDR_OPT_LEN   4
 
#define RPL_HDR_OPT_RANK_ERR   0x40
 
#define RPL_HDR_OPT_RANK_ERR_SHIFT   6
 
#define RPL_HOP_BY_HOP_LEN   (RPL_HDR_OPT_LEN + 2 + 2)
 
#define RPL_INSTANCE_D_FLAG   0x40
 
#define RPL_INSTANCE_LOCAL_FLAG   0x80
 
#define RPL_LIFETIME(instance, lifetime)   ((unsigned long)(instance)->lifetime_unit * (lifetime))
 
#define RPL_LOLLIPOP_CIRCULAR_REGION   127
 
#define RPL_LOLLIPOP_INCREMENT(counter)
 
#define RPL_LOLLIPOP_INIT   (RPL_LOLLIPOP_MAX_VALUE - RPL_LOLLIPOP_SEQUENCE_WINDOWS + 1)
 
#define RPL_LOLLIPOP_IS_INIT(counter)   ((counter) > RPL_LOLLIPOP_CIRCULAR_REGION)
 
#define RPL_LOLLIPOP_MAX_VALUE   255
 
#define RPL_LOLLIPOP_SEQUENCE_WINDOWS   16
 
#define RPL_MAX_RANKINC   (7 * RPL_MIN_HOPRANKINC)
 
#define RPL_MCAST_LIFETIME   3
 
#define RPL_MIN_HOPRANKINC   256
 
#define RPL_MOP_DEFAULT   RPL_MOP_STORING_NO_MULTICAST
 
#define RPL_MOP_NO_DOWNWARD_ROUTES   0
 
#define RPL_MOP_NON_STORING   1
 
#define RPL_MOP_STORING_MULTICAST   3
 
#define RPL_MOP_STORING_NO_MULTICAST   2
 
#define RPL_OPTION_DAG_CONF   4
 
#define RPL_OPTION_DAG_METRIC_CONTAINER   2
 
#define RPL_OPTION_PAD1   0
 
#define RPL_OPTION_PADN   1
 
#define RPL_OPTION_PREFIX_INFO   8
 
#define RPL_OPTION_ROUTE_INFO   3
 
#define RPL_OPTION_SOLICITED_INFO   7
 
#define RPL_OPTION_TARGET   5
 
#define RPL_OPTION_TARGET_DESC   9
 
#define RPL_OPTION_TRANSIT   6
 
#define RPL_ROUTE_FROM_DIO   3
 
#define RPL_ROUTE_FROM_INTERNAL   0
 
#define RPL_ROUTE_FROM_MULTICAST_DAO   2
 
#define RPL_ROUTE_FROM_UNICAST_DAO   1
 
#define RPL_STAT(code)
 
#define RPL_ZERO_LIFETIME   0
 
#define uip_create_linklocal_rplnodes_mcast(addr)   uip_ip6addr((addr), 0xff02, 0, 0, 0, 0, 0, 0, 0x001a)
 Set IP address addr to the link-local, all-rpl-nodes multicast address. More...
 
#define uip_is_addr_linklocal_rplnodes_mcast(addr)
 Is IPv6 address addr the link-local, all-RPL-nodes multicast address? More...
 

Typedefs

typedef struct rpl_dio rpl_dio_t
 

Functions

void dao_ack_output (rpl_instance_t *, uip_ipaddr_t *, uint8_t)
 
void dao_output (rpl_parent_t *, uint8_t lifetime)
 
void dao_output_target (rpl_parent_t *, uip_ipaddr_t *, uint8_t lifetime)
 
void dio_output (rpl_instance_t *, uip_ipaddr_t *uc_addr)
 
void dis_output (uip_ipaddr_t *addr)
 
void rpl_add_dag (uip_ipaddr_t *from, rpl_dio_t *dio)
 
rpl_parent_trpl_add_parent (rpl_dag_t *, rpl_dio_t *dio, uip_ipaddr_t *)
 
uip_ds6_route_trpl_add_route (rpl_dag_t *dag, uip_ipaddr_t *prefix, int prefix_len, uip_ipaddr_t *next_hop)
 
rpl_dag_trpl_alloc_dag (uint8_t, uip_ipaddr_t *)
 
rpl_instance_trpl_alloc_instance (uint8_t)
 
void rpl_cancel_dao (rpl_instance_t *instance)
 
rpl_of_trpl_find_of (rpl_ocp_t)
 
rpl_parent_trpl_find_parent (rpl_dag_t *, uip_ipaddr_t *)
 
rpl_parent_trpl_find_parent_any_dag (rpl_instance_t *instance, uip_ipaddr_t *addr)
 
void rpl_free_dag (rpl_dag_t *)
 
void rpl_free_instance (rpl_instance_t *)
 
void rpl_icmp6_register_handlers (void)
 
void rpl_ipv6_neighbor_callback (uip_ds6_nbr_t *nbr)
 
void rpl_join_dag (uip_ipaddr_t *from, rpl_dio_t *dio)
 
void rpl_join_instance (uip_ipaddr_t *from, rpl_dio_t *dio)
 
void rpl_link_neighbor_callback (const linkaddr_t *addr, int status, int numtx)
 
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 *)
 
void rpl_poison_routes (rpl_dag_t *, rpl_parent_t *)
 
void rpl_process_dio (uip_ipaddr_t *, rpl_dio_t *)
 
int rpl_process_parent_event (rpl_instance_t *, rpl_parent_t *)
 
void rpl_purge_routes (void)
 
void rpl_recalculate_ranks (void)
 
void rpl_remove_parent (rpl_parent_t *)
 
void rpl_remove_routes (rpl_dag_t *dag)
 
void rpl_remove_routes_by_nexthop (uip_ipaddr_t *nexthop, rpl_dag_t *dag)
 
void rpl_reset_dio_timer (rpl_instance_t *)
 
void rpl_reset_periodic_timer (void)
 
void rpl_schedule_dao (rpl_instance_t *)
 
void rpl_schedule_dao_immediately (rpl_instance_t *)
 
rpl_dag_trpl_select_dag (rpl_instance_t *instance, rpl_parent_t *parent)
 
rpl_parent_trpl_select_parent (rpl_dag_t *dag)
 
void rpl_set_default_instance (rpl_instance_t *instance)
 

Variables

rpl_instance_tdefault_instance
 
rpl_instance_t instance_table []
 

#define BASE_RANK   0
#define DAG_RANK (   fixpt_rank,
  instance 
)    ((fixpt_rank) / (instance)->min_hoprankinc)
#define DAO_EXPIRATION_TIMEOUT   60

Referenced by dao_input().

#define ROOT_RANK (   instance)    (instance)->min_hoprankinc
#define RPL_CODE_DAO   0x02 /* Destination Advertisement Option */

Referenced by dao_input(), and dao_output_target().

#define RPL_CODE_DAO_ACK   0x03 /* DAO acknowledgment */

Referenced by dao_ack_output().

#define RPL_CODE_DIO   0x01 /* DAG Information Option */

Referenced by dio_output().

#define RPL_CODE_DIS   0x00 /* DAG Information Solicitation */

Referenced by dis_output().

#define RPL_CODE_SEC_DAO   0x82 /* Secure DAO */
#define RPL_CODE_SEC_DAO_ACK   0x83 /* Secure DAO ACK */
#define RPL_CODE_SEC_DIO   0x81 /* Secure DIO */
#define RPL_CODE_SEC_DIS   0x80 /* Secure DIS */
#define RPL_DAO_D_FLAG   0x40 /* DODAG ID present */

Referenced by dao_input(), and dao_output_target().

#define RPL_DAO_K_FLAG   0x80 /* DAO ACK requested */

Referenced by dao_input(), and dao_output_target().

#define RPL_DAO_LATENCY   (CLOCK_SECOND * 4)

Referenced by rpl_schedule_dao().

#define RPL_DIO_INTERVAL_DOUBLINGS   8
#define RPL_DIO_INTERVAL_MIN   12
#define RPL_DIO_REDUNDANCY   10
#define RPL_DIS_INTERVAL   60
#define RPL_DIS_SEND   1
#define RPL_DIS_START_DELAY   5
#define RPL_HDR_OPT_DOWN   0x80
#define RPL_HDR_OPT_DOWN_SHIFT   7
#define RPL_HDR_OPT_FWD_ERR   0x20
#define RPL_HDR_OPT_FWD_ERR_SHIFT   5
#define RPL_HDR_OPT_LEN   4

Referenced by rpl_verify_header(), and set_rpl_opt().

#define RPL_HDR_OPT_RANK_ERR   0x40

Referenced by rpl_verify_header().

#define RPL_HDR_OPT_RANK_ERR_SHIFT   6
#define RPL_HOP_BY_HOP_LEN   (RPL_HDR_OPT_LEN + 2 + 2)
#define RPL_INSTANCE_D_FLAG   0x40
#define RPL_INSTANCE_LOCAL_FLAG   0x80
#define RPL_LIFETIME (   instance,
  lifetime 
)    ((unsigned long)(instance)->lifetime_unit * (lifetime))
#define RPL_LOLLIPOP_CIRCULAR_REGION   127

Referenced by lollipop_greater_than().

#define RPL_LOLLIPOP_INCREMENT (   counter)
Value:
do { \
} else { \
} \
} while(0)
#define RPL_LOLLIPOP_MAX_VALUE
Definition: rpl-private.h:219
unsigned int counter
Definition: winc3400/simple_roaming_https_example/main21.c:129
#define RPL_LOLLIPOP_CIRCULAR_REGION
Definition: rpl-private.h:220
if(memp!=NULL)
Definition: memp.c:407

Referenced by dao_output_target(), dio_output(), global_repair(), rpl_process_dio(), rpl_repair_root(), rpl_select_dag(), and rpl_set_root().

#define RPL_LOLLIPOP_INIT   (RPL_LOLLIPOP_MAX_VALUE - RPL_LOLLIPOP_SEQUENCE_WINDOWS + 1)

Referenced by rpl_join_instance(), and rpl_set_root().

#define RPL_LOLLIPOP_IS_INIT (   counter)    ((counter) > RPL_LOLLIPOP_CIRCULAR_REGION)
#define RPL_LOLLIPOP_MAX_VALUE   255

Referenced by lollipop_greater_than().

#define RPL_LOLLIPOP_SEQUENCE_WINDOWS   16

Referenced by lollipop_greater_than().

#define RPL_MAX_RANKINC   (7 * RPL_MIN_HOPRANKINC)

Referenced by dio_input(), and rpl_set_root().

#define RPL_MCAST_LIFETIME   3

Referenced by handle_dao_timer().

#define RPL_MIN_HOPRANKINC   256
#define RPL_MOP_DEFAULT   RPL_MOP_STORING_NO_MULTICAST

Referenced by rpl_process_dio(), and rpl_set_root().

#define RPL_MOP_NO_DOWNWARD_ROUTES   0
#define RPL_MOP_NON_STORING   1
#define RPL_MOP_STORING_MULTICAST   3

Referenced by handle_dao_timer().

#define RPL_MOP_STORING_NO_MULTICAST   2

Referenced by rpl_process_dio().

#define RPL_OPTION_DAG_CONF   4

Referenced by dio_input(), and dio_output().

#define RPL_OPTION_DAG_METRIC_CONTAINER   2

Referenced by dio_input(), and dio_output().

#define RPL_OPTION_PAD1   0

Referenced by dao_input(), and dio_input().

#define RPL_OPTION_PADN   1
#define RPL_OPTION_PREFIX_INFO   8

Referenced by dio_input(), and dio_output().

#define RPL_OPTION_ROUTE_INFO   3

Referenced by dio_input().

#define RPL_OPTION_SOLICITED_INFO   7
#define RPL_OPTION_TARGET   5

Referenced by dao_input(), and dao_output_target().

#define RPL_OPTION_TARGET_DESC   9
#define RPL_OPTION_TRANSIT   6

Referenced by dao_input(), and dao_output_target().

#define RPL_ROUTE_FROM_DIO   3
#define RPL_ROUTE_FROM_INTERNAL   0

Referenced by rpl_add_route().

#define RPL_ROUTE_FROM_MULTICAST_DAO   2

Referenced by dao_input().

#define RPL_ROUTE_FROM_UNICAST_DAO   1

Referenced by dao_input().

#define RPL_STAT (   code)
#define RPL_ZERO_LIFETIME   0
#define uip_create_linklocal_rplnodes_mcast (   addr)    uip_ip6addr((addr), 0xff02, 0, 0, 0, 0, 0, 0, 0x001a)

Set IP address addr to the link-local, all-rpl-nodes multicast address.

Referenced by dio_output(), dis_output(), and rpl_init().

#define uip_is_addr_linklocal_rplnodes_mcast (   addr)
Value:
((addr)->u8[0] == 0xff) && \
((addr)->u8[1] == 0x02) && \
((addr)->u16[1] == 0) && \
((addr)->u16[2] == 0) && \
((addr)->u16[3] == 0) && \
((addr)->u16[4] == 0) && \
((addr)->u16[5] == 0) && \
((addr)->u16[6] == 0) && \
((addr)->u8[14] == 0) && \
((addr)->u8[15] == 0x1a))
struct sockaddr_in addr
Definition: iot_cloud_demo/demo.c:226

Is IPv6 address addr the link-local, all-RPL-nodes multicast address?

typedef struct rpl_dio rpl_dio_t

void rpl_join_dag ( uip_ipaddr_t from,
rpl_dio_t dio 
)
void rpl_poison_routes ( rpl_dag_t ,
rpl_parent_t  
)