Contiki-NG

RPL-lite is a lightweight implementation of RPL tailored for reliability. More...

Files

file  rpl-conf.h
 Public configuration and API declarations for ContikiRPL.
 
file  rpl-const.h
 Constants for RPL.
 
file  rpl-dag-root.c
 DAG root utility functions for RPL.
 
file  rpl-dag-root.h
 DAG root utility functions for RPL.
 
file  rpl-dag.c
 Logic for Directed Acyclic Graphs in RPL.
 
file  rpl-dag.h
 Header file for rpl-dag module.
 
file  rpl-ext-header.c
 Management of extension headers for ContikiRPL.
 
file  rpl-ext-header.h
 Header file for rpl-ext-header.
 
file  rpl-icmp6.c
 ICMP6 I/O for RPL control messages.
 
file  rpl-icmp6.h
 Header file for rpl-ext-header.
 
file  rpl-mrhof.c
 The Minimum Rank with Hysteresis Objective Function (MRHOF), RFC6719.
 
file  rpl-neighbor.c
 Logic for DAG neighbors in RPL.
 
file  rpl-neighbor.h
 Header file for rpl-neighbor module.
 
file  rpl-of0.c
 An implementation of RPL's objective function 0, RFC6552.
 
file  rpl-timers.c
 RPL timer management.
 
file  rpl-timers.h
 Header file for rpl-timers module.
 
file  rpl-types.h
 RPL types and macros.
 
file  rpl.c
 ContikiRPL, an implementation of RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks (IETF RFC 6550)
 

Data Structures

struct  rpl_metric_object_energy
 Structure for RPL energy metric. More...
 
struct  rpl_metric_container
 Logical representation of a DAG Metric Container. More...
 
struct  rpl_prefix
 RPL prefix information. More...
 
struct  rpl_nbr
 All information related to a RPL neighbor. More...
 
struct  rpl_of
 API for RPL objective functions (OF) More...
 
struct  rpl_dag
 RPL DAG structure. More...
 
struct  rpl_instance
 RPL instance structure. More...
 

Macros

#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.
 
#define uip_is_addr_linklocal_rplnodes_mcast(addr)
 Is IPv6 address addr the link-local, all-RPL-nodes multicast address?
 
#define RPL_LIFETIME(lifetime)
 Compute lifetime, accounting for the lifetime unit.
 
#define ROOT_RANK   curr_instance.min_hoprankinc
 Rank of a root node.
 
#define DAG_RANK(fixpt_rank)   ((fixpt_rank) / curr_instance.min_hoprankinc)
 Return DAG RANK as per RFC 6550 (rank divided by min_hoprankinc)
 

Enumerations

enum  rpl_dag_state
 RPL DAG states.
 

Functions

void rpl_dag_root_print_links (const char *str)
 Prints a summary of all routing links. More...
 
void rpl_dag_root_set_prefix (uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
 Set a prefix in case the node is later set as dag root. More...
 
int rpl_dag_root_start (void)
 Set the node as root and start a DAG. More...
 
int rpl_dag_root_is_root (void)
 Tells whether we are DAG root or not. More...
 
const char * rpl_dag_state_to_str (enum rpl_dag_state state)
 Returns a textual description of the current DAG state. More...
 
int rpl_dag_get_root_ipaddr (uip_ipaddr_t *ipaddr)
 Returns the IPv6 address of the RPL DAG root, if any. More...
 
void rpl_dag_leave (void)
 Leaves the current DAG.
 
void rpl_dag_poison_and_leave (void)
 Start poisoning and leave the DAG after a delay.
 
void rpl_dag_periodic (unsigned seconds)
 A function called periodically. More...
 
int rpl_is_addr_in_our_dag (const uip_ipaddr_t *addr)
 Tells whether a given global IPv6 address is in our current DAG. More...
 
rpl_instance_trpl_get_default_instance (void)
 Returns pointer to the default instance (for compatibility with legagy RPL code) More...
 
rpl_dag_trpl_get_any_dag (void)
 Returns pointer to any DAG (for compatibility with legagy RPL code) More...
 
void rpl_refresh_routes (const char *str)
 Triggers a route fresh via DTSN increment. More...
 
void rpl_global_repair (const char *str)
 Triggers a RPL global repair. More...
 
void rpl_local_repair (const char *str)
 Triggers a RPL local repair. More...
 
int rpl_dag_ready_to_advertise (void)
 Tells whether RPL is ready to advertise the DAG. More...
 
void rpl_dag_update_state (void)
 Updates RPL internal state: selects preferred parent, updates rank & metreic container, triggers control traffic accordingly and updates uIP6 internal state.
 
void rpl_process_dio (uip_ipaddr_t *from, rpl_dio_t *dio)
 Processes incoming DIO. More...
 
void rpl_process_dis (uip_ipaddr_t *from, int is_multicast)
 Processes incoming DIS. More...
 
void rpl_process_dao (uip_ipaddr_t *from, rpl_dao_t *dao)
 Processes incoming DAO. More...
 
int rpl_process_hbh (rpl_nbr_t *sender, uint16_t sender_rank, int loop_detected, int rank_error_signaled)
 Processes Hop-by-Hop (HBH) Extension Header of a packet currently being forwrded. More...
 
void rpl_dag_init_root (uint8_t instance_id, uip_ipaddr_t *dag_id, uip_ipaddr_t *prefix, unsigned prefix_len, uint8_t flags)
 Initializes DAG internal structure for a root node. More...
 
void rpl_dag_init (void)
 Initializes rpl-dag module.
 
void rpl_process_dao_ack (uint8_t sequence, uint8_t status)
 Processes incoming DAO-ACK. More...
 
int rpl_ext_header_srh_get_next_hop (uip_ipaddr_t *ipaddr)
 Look for next hop from SRH of current uIP packet. More...
 
int rpl_ext_header_srh_update (void)
 Process and update SRH in-place, i.e. More...
 
int rpl_ext_header_hbh_update (uint8_t *ext_buf, int opt_offset)
 Process and update the RPL hop-by-hop extension headers of the current uIP packet. More...
 
int rpl_ext_header_update (void)
 Adds/updates all RPL extension headers to current uIP packet. More...
 
bool rpl_ext_header_remove (void)
 Removes all RPL extension headers. More...
 
uip_ds6_nbr_trpl_icmp6_update_nbr_table (uip_ipaddr_t *from, nbr_table_reason_t reason, void *data)
 Updates IPv6 neighbor cache on incoming link-local RPL ICMPv6 messages. More...
 
void rpl_icmp6_dis_output (uip_ipaddr_t *addr)
 Creates an ICMPv6 DIS packet and sends it. More...
 
void rpl_icmp6_dio_output (uip_ipaddr_t *uc_addr)
 Creates an ICMPv6 DIO packet and sends it. More...
 
void rpl_icmp6_dao_output (uint8_t lifetime)
 Creates an ICMPv6 DAO packet and sends it to the root, advertising the current preferred parent, and with our global address as prefix. More...
 
void rpl_icmp6_init (void)
 Initializes rpl-icmp6 module, registers ICMPv6 handlers for all RPL ICMPv6 messages: DIO, DIS, DAO and DAO-ACK.
 
void rpl_icmp6_dao_ack_output (uip_ipaddr_t *dest, uint8_t sequence, uint8_t status)
 Creates an ICMPv6 DAO-ACK packet and sends it to the originator of the ACK. More...
 
int rpl_neighbor_snprint (char *buf, int buflen, rpl_nbr_t *nbr)
 Print a textual description of RPL neighbor into a string. More...
 
void rpl_neighbor_print_list (const char *str)
 Prints a summary of all RPL neighbors and their properties. More...
 
int rpl_neighbor_count (void)
 Returns the number of nodes in the RPL neighbor table. More...
 
rpl_nbr_trpl_neighbor_get_from_lladdr (uip_lladdr_t *addr)
 Returns a neighbor from its link-layer address. More...
 
int rpl_neighbor_is_acceptable_parent (rpl_nbr_t *nbr)
 Tells whether a nbr is acceptable as per the OF's definition. More...
 
uint16_t rpl_neighbor_get_link_metric (rpl_nbr_t *nbr)
 Returns a neighbor's link metric. More...
 
rpl_rank_t rpl_neighbor_rank_via_nbr (rpl_nbr_t *nbr)
 Returns our rank if selecting a given parent as preferred parent. More...
 
const linkaddr_t * rpl_neighbor_get_lladdr (rpl_nbr_t *nbr)
 Returns a neighbors's link-layer address. More...
 
uip_ipaddr_t * rpl_neighbor_get_ipaddr (rpl_nbr_t *nbr)
 Returns a neighbor's (link-local) IPv6 address. More...
 
const struct link_stats * rpl_neighbor_get_link_stats (rpl_nbr_t *nbr)
 Returns a neighbor's link statistics. More...
 
int rpl_neighbor_is_fresh (rpl_nbr_t *nbr)
 Tells wether we have fresh link information towards a given neighbor. More...
 
int rpl_neighbor_is_parent (rpl_nbr_t *nbr)
 Tells whether a neighbor is in the parent set. More...
 
void rpl_neighbor_set_preferred_parent (rpl_nbr_t *nbr)
 Set current RPL preferred parent and update DS6 default route accordingly. More...
 
void rpl_neighbor_remove_all (void)
 Empty the RPL neighbor table.
 
rpl_nbr_trpl_neighbor_get_from_ipaddr (uip_ipaddr_t *addr)
 Returns a neighbor from its link-local IPv6 address. More...
 
rpl_nbr_trpl_neighbor_select_best (void)
 Returns the best candidate for preferred parent. More...
 
void rpl_neighbor_init (void)
 Initialize rpl-dag-neighbor module.
 
void rpl_timers_schedule_periodic_dis (void)
 Schedule periodic DIS with a random delay based on RPL_DIS_INTERVAL, until we join a DAG.
 
void rpl_timers_dio_reset (const char *str)
 Reset DIO Trickle timer. More...
 
void rpl_timers_schedule_unicast_dio (rpl_nbr_t *target)
 Schedule unicast DIO with no delay.
 
void rpl_timers_schedule_dao (void)
 Schedule a DAO with random delay based on RPL_DAO_DELAY.
 
void rpl_timers_unschedule_leaving (void)
 Cancel scheduled leaving if any.
 
void rpl_timers_schedule_leaving (void)
 Schedule leaving after RPL_DELAY_BEFORE_LEAVING.
 
void rpl_timers_init (void)
 Initialize rpl-timers module.
 
void rpl_timers_stop_dag_timers (void)
 Stop all timers related to the DAG.
 
void rpl_timers_unschedule_state_update (void)
 Cancelled any scheduled state update.
 
void rpl_timers_schedule_state_update (void)
 Schedule a state update ASAP. More...
 
void rpl_timers_schedule_dao_ack (uip_ipaddr_t *target, uint16_t sequence)
 Schedule a DAO-ACK with no delay.
 
void rpl_timers_notify_dao_ack (void)
 Let the rpl-timers module know that the last DAO was ACKed.
 
void rpl_schedule_probing (void)
 Schedule probing with delay RPL_PROBING_DELAY_FUNC()
 
void rpl_schedule_probing_now (void)
 Schedule probing within a few seconds.
 
int rpl_lollipop_greater_than (int a, int b)
 Greater-than function for a lollipop counter. More...
 
const uip_ipaddr_t * rpl_get_global_address (void)
 Get one of the node's global addresses. More...
 
void rpl_link_callback (const linkaddr_t *addr, int status, int numtx)
 Called by lower layers after every packet transmission. More...
 
int rpl_has_joined (void)
 Tells whether the node has joined a network or not. More...
 
int rpl_is_reachable (void)
 Get the RPL's best guess on if we are reachable via have downward route or not. More...
 
void rpl_reset_prefix (rpl_prefix_t *last_prefix)
 Removes current prefx. More...
 
int rpl_set_prefix_from_addr (uip_ipaddr_t *addr, unsigned len, uint8_t flags)
 Set prefix from an IPv6 address. More...
 
int rpl_set_prefix (rpl_prefix_t *prefix)
 Set prefix from an prefix data structure (from DIO) More...
 
void rpl_set_leaf_only (uint8_t value)
 Changes the value of the rpl_leaf_only flag, which determines if a node acts only as a leaf in the network. More...
 
uint8_t rpl_get_leaf_only (void)
 Get the value of the rpl_leaf_only flag. More...
 

Detailed Description

RPL-lite is a lightweight implementation of RPL tailored for reliability.

Supports only non-storing mode, one instance and one DAG.

Function Documentation

◆ rpl_dag_get_root_ipaddr()

int rpl_dag_get_root_ipaddr ( uip_ipaddr_t *  ipaddr)

Returns the IPv6 address of the RPL DAG root, if any.

Parameters
ipaddrA pointer where to copy the IP address of the DAG root
Returns
1 if the root address was copied, 0 otherwise

Definition at line 89 of file rpl-dag.c.

◆ rpl_dag_init_root()

void rpl_dag_init_root ( uint8_t  instance_id,
uip_ipaddr_t *  dag_id,
uip_ipaddr_t *  prefix,
unsigned  prefix_len,
uint8_t  flags 
)

Initializes DAG internal structure for a root node.

Parameters
instance_idThe instance ID
dag_idThe DAG ID
prefixThe prefix
prefix_lenThe prefix length
flagsThe prefix flags (from DIO)

Definition at line 713 of file rpl-dag.c.

◆ rpl_dag_periodic()

void rpl_dag_periodic ( unsigned  seconds)

A function called periodically.

Used to age the DAG (decrease lifetime and expire DAG accordingly)

Parameters
secondsThe number of seconds elapsted since last call

Definition at line 138 of file rpl-dag.c.

◆ rpl_dag_ready_to_advertise()

int rpl_dag_ready_to_advertise ( void  )

Tells whether RPL is ready to advertise the DAG.

Returns
1 is ready, 0 otherwise

Definition at line 255 of file rpl-dag.c.

Referenced by rpl_timers_dio_reset().

◆ rpl_dag_root_is_root()

int rpl_dag_root_is_root ( void  )

Tells whether we are DAG root or not.

Returns
1 if we are dag root, 0 otherwise

Definition at line 158 of file rpl-dag-root.c.

◆ rpl_dag_root_print_links()

void rpl_dag_root_print_links ( const char *  str)

Prints a summary of all routing links.

Parameters
strA descriptive text on the caller

Definition at line 54 of file rpl-dag-root.c.

References rpl_dag_root_is_root(), and uip_sr_num_nodes().

◆ rpl_dag_root_set_prefix()

void rpl_dag_root_set_prefix ( uip_ipaddr_t *  prefix,
uip_ipaddr_t *  iid 
)

Set a prefix in case the node is later set as dag root.

Parameters
prefixThe prefix. If NULL, uip_ds6_default_prefix() is used instead
iidThe IID. If NULL, it will be built from uip_ds6_set_addr_iid.

Definition at line 113 of file rpl-dag-root.c.

◆ rpl_dag_root_start()

int rpl_dag_root_start ( void  )

Set the node as root and start a DAG.

Returns
0 in case of success, -1 otherwise

Definition at line 124 of file rpl-dag-root.c.

◆ rpl_dag_state_to_str()

const char * rpl_dag_state_to_str ( enum rpl_dag_state  state)

Returns a textual description of the current DAG state.

Parameters
stateThe DAG state
Returns
The description string

Definition at line 72 of file rpl-dag.c.

◆ rpl_ext_header_hbh_update()

int rpl_ext_header_hbh_update ( uint8_t *  ext_buf,
int  opt_offset 
)

Process and update the RPL hop-by-hop extension headers of the current uIP packet.

Parameters
ext_bufA pointer to the ext header buffer
opt_offsetThe offset within the extension header where the option starts
Returns
1 in case the packet is valid and to be processed further, 0 in case the packet must be dropped.

Definition at line 318 of file rpl-ext-header.c.

◆ rpl_ext_header_remove()

bool rpl_ext_header_remove ( void  )

Removes all RPL extension headers.

Returns
true in case of success, false otherwise

Definition at line 469 of file rpl-ext-header.c.

◆ rpl_ext_header_srh_get_next_hop()

int rpl_ext_header_srh_get_next_hop ( uip_ipaddr_t *  ipaddr)

Look for next hop from SRH of current uIP packet.

Parameters
ipaddrA pointer to the address where to store the next hop.
Returns
1 if a next hop was found, 0 otherwise

Definition at line 58 of file rpl-ext-header.c.

◆ rpl_ext_header_srh_update()

int rpl_ext_header_srh_update ( void  )

Process and update SRH in-place, i.e.

internal address swapping as per RFC6554

Returns
1 if SRH found, 0 otherwise

Definition at line 91 of file rpl-ext-header.c.

◆ rpl_ext_header_update()

int rpl_ext_header_update ( void  )

Adds/updates all RPL extension headers to current uIP packet.

Returns
1 in case of success, 0 otherwise

Definition at line 441 of file rpl-ext-header.c.

◆ rpl_get_any_dag()

rpl_dag_t * rpl_get_any_dag ( void  )

Returns pointer to any DAG (for compatibility with legagy RPL code)

Returns
A pointer to the only supported DAG

Definition at line 171 of file rpl-dag.c.

◆ rpl_get_default_instance()

rpl_instance_t * rpl_get_default_instance ( void  )

Returns pointer to the default instance (for compatibility with legagy RPL code)

Returns
A pointer to the only supported instance

Definition at line 165 of file rpl-dag.c.

◆ rpl_get_global_address()

const uip_ipaddr_t * rpl_get_global_address ( void  )

Get one of the node's global addresses.

Returns
A (constant) pointer to the global IPv6 address found. The pointer directs to the internals of DS6, should only be used in the current function's local scope

Definition at line 71 of file rpl.c.

◆ rpl_get_leaf_only()

uint8_t rpl_get_leaf_only ( void  )

Get the value of the rpl_leaf_only flag.

Returns
The value of the rpl_leaf_only flag

Definition at line 242 of file rpl.c.

◆ rpl_global_repair()

void rpl_global_repair ( const char *  str)

Triggers a RPL global repair.

Parameters
strA textual description of the cause for triggering a repair

Definition at line 204 of file rpl-dag.c.

References rpl_dag_root_is_root().

◆ rpl_has_joined()

int rpl_has_joined ( void  )

Tells whether the node has joined a network or not.

Return values
1if we have joined a network, 0 if not.

Definition at line 121 of file rpl.c.

◆ rpl_icmp6_dao_ack_output()

void rpl_icmp6_dao_ack_output ( uip_ipaddr_t *  dest,
uint8_t  sequence,
uint8_t  status 
)

Creates an ICMPv6 DAO-ACK packet and sends it to the originator of the ACK.

Parameters
destThe DAO-ACK destination (was source of the DAO)
sequenceThe sequence number of the DAO being ACKed
statusThe status of the DAO-ACK (see RPL_DAO_ACK_* defines)

◆ rpl_icmp6_dao_output()

void rpl_icmp6_dao_output ( uint8_t  lifetime)

Creates an ICMPv6 DAO packet and sends it to the root, advertising the current preferred parent, and with our global address as prefix.

Parameters
lifetimeThe DAO lifetime. Use 0 to send a No-path DAO

Definition at line 597 of file rpl-icmp6.c.

◆ rpl_icmp6_dio_output()

void rpl_icmp6_dio_output ( uip_ipaddr_t *  uc_addr)

Creates an ICMPv6 DIO packet and sends it.

Can be unicast or multicast

Parameters
uc_addrThe link-local address of the target host, if any. Else, a multicast DIO will be sent.

Definition at line 352 of file rpl-icmp6.c.

◆ rpl_icmp6_dis_output()

void rpl_icmp6_dis_output ( uip_ipaddr_t *  addr)

Creates an ICMPv6 DIS packet and sends it.

Can be unicast or multicast.

Parameters
addrThe link-local address of the target host, if any. Else, a multicast DIS will be sent.

Definition at line 151 of file rpl-icmp6.c.

◆ rpl_icmp6_update_nbr_table()

uip_ds6_nbr_t * rpl_icmp6_update_nbr_table ( uip_ipaddr_t *  from,
nbr_table_reason_t  reason,
void *  data 
)

Updates IPv6 neighbor cache on incoming link-local RPL ICMPv6 messages.

Parameters
fromThe source link-local IPv6 address
reasonWhat triggered the update (maps to RPL packet types)
dataGeneric pointer, used for instance to store parsed DIO data
Returns
A pointer to the new neighbor cache entry, NULL if there was no space left.

Definition at line 113 of file rpl-icmp6.c.

◆ rpl_is_addr_in_our_dag()

int rpl_is_addr_in_our_dag ( const uip_ipaddr_t *  addr)

Tells whether a given global IPv6 address is in our current DAG.

Parameters
addrThe global IPv6 address to be tested
Returns
1 if addr is in our current DAG, 0 otherwise

Definition at line 158 of file rpl-dag.c.

◆ rpl_is_reachable()

int rpl_is_reachable ( void  )

Get the RPL's best guess on if we are reachable via have downward route or not.

Returns
1 if we are reachable, 0 otherwise.

Definition at line 127 of file rpl.c.

◆ rpl_link_callback()

void rpl_link_callback ( const linkaddr_t *  addr,
int  status,
int  numtx 
)

Called by lower layers after every packet transmission.

Parameters
addrThe link-layer addrress of the packet destination
statusThe transmission status (see os/net/mac/mac.h)
numtxThe total number of transmission attempts

Definition at line 97 of file rpl.c.

◆ rpl_local_repair()

void rpl_local_repair ( const char *  str)

Triggers a RPL local repair.

Parameters
strA textual description of the cause for triggering a repair

Definition at line 240 of file rpl-dag.c.

◆ rpl_lollipop_greater_than()

int rpl_lollipop_greater_than ( int  a,
int  b 
)

Greater-than function for a lollipop counter.

Parameters
aThe first counter
bThe second counter
Returns
1 is a>b else 0

Definition at line 57 of file rpl.c.

◆ rpl_neighbor_count()

int rpl_neighbor_count ( void  )

Returns the number of nodes in the RPL neighbor table.

Returns
the neighbor count

Definition at line 168 of file rpl-neighbor.c.

References count, and nbr.

◆ rpl_neighbor_get_from_ipaddr()

rpl_nbr_t * rpl_neighbor_get_from_ipaddr ( uip_ipaddr_t *  addr)

Returns a neighbor from its link-local IPv6 address.

Parameters
addrThe link-local IPv6 address
Returns
The neighbor if found, NULL otherwise

Definition at line 332 of file rpl-neighbor.c.

References addr, uip_ds6_nbr_get_ll(), and uip_ds6_nbr_lookup().

◆ rpl_neighbor_get_from_lladdr()

rpl_nbr_t * rpl_neighbor_get_from_lladdr ( uip_lladdr_t *  addr)

Returns a neighbor from its link-layer address.

Parameters
addrThe link-layer address
Returns
The neighbor if found, NULL otherwise

Definition at line 213 of file rpl-neighbor.c.

References addr.

◆ rpl_neighbor_get_ipaddr()

uip_ipaddr_t * rpl_neighbor_get_ipaddr ( rpl_nbr_t nbr)

Returns a neighbor's (link-local) IPv6 address.

Parameters
nbrThe neighbor
Returns
The link-local IPv6 address if any, NULL otherwise

Definition at line 252 of file rpl-neighbor.c.

References nbr, rpl_neighbor_get_lladdr(), and uip_ds6_nbr_ipaddr_from_lladdr().

◆ rpl_neighbor_get_link_metric()

uint16_t rpl_neighbor_get_link_metric ( rpl_nbr_t nbr)

Returns a neighbor's link metric.

Parameters
nbrThe neighbor
Returns
The link metric if any, 0xffff otherwise

Definition at line 228 of file rpl-neighbor.c.

References nbr.

◆ rpl_neighbor_get_link_stats()

const struct link_stats * rpl_neighbor_get_link_stats ( rpl_nbr_t nbr)

Returns a neighbor's link statistics.

Parameters
nbrThe neighbor
Returns
The link_stats structure address if any, NULL otherwise

Definition at line 259 of file rpl-neighbor.c.

References nbr, and rpl_neighbor_get_lladdr().

Referenced by rpl_neighbor_is_fresh().

◆ rpl_neighbor_get_lladdr()

const linkaddr_t * rpl_neighbor_get_lladdr ( rpl_nbr_t nbr)

Returns a neighbors's link-layer address.

Parameters
nbrThe neighbor
Returns
The link-layer address if any, NULL otherwise

Definition at line 246 of file rpl-neighbor.c.

References nbr.

Referenced by rpl_neighbor_get_ipaddr(), and rpl_neighbor_get_link_stats().

◆ rpl_neighbor_is_acceptable_parent()

int rpl_neighbor_is_acceptable_parent ( rpl_nbr_t nbr)

Tells whether a nbr is acceptable as per the OF's definition.

Parameters
nbrThe neighbor
Returns
1 if acceptable, 0 otherwise

Definition at line 219 of file rpl-neighbor.c.

References nbr.

◆ rpl_neighbor_is_fresh()

int rpl_neighbor_is_fresh ( rpl_nbr_t nbr)

Tells wether we have fresh link information towards a given neighbor.

Parameters
nbrThe neighbor
Returns
1 if we have fresh link information, 0 otherwise

Definition at line 266 of file rpl-neighbor.c.

References nbr, and rpl_neighbor_get_link_stats().

◆ rpl_neighbor_is_parent()

int rpl_neighbor_is_parent ( rpl_nbr_t nbr)

Tells whether a neighbor is in the parent set.

Parameters
nbrThe neighbor to be tested
Returns
1 if nbr is in the parent set, 0 otherwise

Definition at line 273 of file rpl-neighbor.c.

References nbr.

◆ rpl_neighbor_print_list()

void rpl_neighbor_print_list ( const char *  str)

Prints a summary of all RPL neighbors and their properties.

Parameters
strA descriptive text on the caller

Definition at line 143 of file rpl-neighbor.c.

◆ rpl_neighbor_rank_via_nbr()

rpl_rank_t rpl_neighbor_rank_via_nbr ( rpl_nbr_t nbr)

Returns our rank if selecting a given parent as preferred parent.

Parameters
nbrThe neighbor
Returns
The resulting rank if any, RPL_INFINITE_RANK otherwise

Definition at line 237 of file rpl-neighbor.c.

References nbr.

◆ rpl_neighbor_select_best()

rpl_nbr_t * rpl_neighbor_select_best ( void  )

Returns the best candidate for preferred parent.

Returns
The best candidate, NULL if no usable parent is found

Definition at line 378 of file rpl-neighbor.c.

References rpl_dag_root_is_root().

◆ rpl_neighbor_set_preferred_parent()

void rpl_neighbor_set_preferred_parent ( rpl_nbr_t nbr)

Set current RPL preferred parent and update DS6 default route accordingly.

Parameters
nbrThe new preferred parent

Definition at line 279 of file rpl-neighbor.c.

◆ rpl_neighbor_snprint()

int rpl_neighbor_snprint ( char *  buf,
int  buflen,
rpl_nbr_t nbr 
)

Print a textual description of RPL neighbor into a string.

Parameters
bufThe buffer where to write content
buflenThe buffer len
nbrA pointer to a RPL neighbor that will be written to the buffer
Returns
Identical to snprintf: number of bytes written excluding ending null byte. A value >= buflen if the buffer was too small.

Definition at line 90 of file rpl-neighbor.c.

◆ rpl_process_dao()

void rpl_process_dao ( uip_ipaddr_t *  from,
rpl_dao_t *  dao 
)

Processes incoming DAO.

Parameters
fromThe IPv6 address of the originator
daoA pointer to a parsed DAO

Definition at line 633 of file rpl-dag.c.

References uip_sr_expire_parent().

◆ rpl_process_dao_ack()

void rpl_process_dao_ack ( uint8_t  sequence,
uint8_t  status 
)

Processes incoming DAO-ACK.

Parameters
sequenceThe DAO-ACK sequence number
statusThe DAO-ACK status (see RPL_DAO_ACK_* defines)

◆ rpl_process_dio()

void rpl_process_dio ( uip_ipaddr_t *  from,
rpl_dio_t *  dio 
)

Processes incoming DIO.

Parameters
fromThe IPv6 address of the originator
dioA pointer to a parsed DIO

Definition at line 600 of file rpl-dag.c.

◆ rpl_process_dis()

void rpl_process_dis ( uip_ipaddr_t *  from,
int  is_multicast 
)

Processes incoming DIS.

Parameters
fromThe IPv6 address of the originator
is_multicastSet to 1 for multicast DIS, 0 for unicast DIS

Definition at line 619 of file rpl-dag.c.

References rpl_icmp6_update_nbr_table(), and rpl_timers_dio_reset().

◆ rpl_process_hbh()

int rpl_process_hbh ( rpl_nbr_t sender,
uint16_t  sender_rank,
int  loop_detected,
int  rank_error_signaled 
)

Processes Hop-by-Hop (HBH) Extension Header of a packet currently being forwrded.

Parameters
senderThe IPv6 address of the originator
sender_rankThe rank advertised by the sender in the HBH header
loop_detected1 if we could detect a loop while forwarding, 0 otherwise
rank_error_signaled1 if the HBH header advertises a rank error, 0 otherwise
Returns
1 if the packet is to be forwarded, 0 if it is to be dropped

Definition at line 680 of file rpl-dag.c.

References rpl_timers_dio_reset().

◆ rpl_refresh_routes()

void rpl_refresh_routes ( const char *  str)

Triggers a route fresh via DTSN increment.

Parameters
stra textual description of the cause for refresh

Definition at line 189 of file rpl-dag.c.

References rpl_dag_root_is_root().

◆ rpl_reset_prefix()

void rpl_reset_prefix ( rpl_prefix_t last_prefix)

Removes current prefx.

Parameters
last_prefixThe last prefix (which is to be removed)

Definition at line 141 of file rpl.c.

References ipaddr.

◆ rpl_set_leaf_only()

void rpl_set_leaf_only ( uint8_t  value)

Changes the value of the rpl_leaf_only flag, which determines if a node acts only as a leaf in the network.

Parameters
valuethe value to set: 0-disable, 1-enable

Definition at line 236 of file rpl.c.

◆ rpl_set_prefix()

int rpl_set_prefix ( rpl_prefix_t prefix)

Set prefix from an prefix data structure (from DIO)

Parameters
prefixThe prefix
Returns
1 if success, 0 otherwise

Definition at line 185 of file rpl.c.

◆ rpl_set_prefix_from_addr()

int rpl_set_prefix_from_addr ( uip_ipaddr_t *  addr,
unsigned  len,
uint8_t  flags 
)

Set prefix from an IPv6 address.

Parameters
addrThe prefix
lenThe prefix length
flagsThe DIO prefix flags
Returns
1 if success, 0 otherwise

Definition at line 157 of file rpl.c.

References addr, and ipaddr.

◆ rpl_timers_dio_reset()

void rpl_timers_dio_reset ( const char *  str)

Reset DIO Trickle timer.

Parameters
strA textual description of caused the DIO timer reset

Definition at line 150 of file rpl-timers.c.

References rpl_dag_ready_to_advertise().

Referenced by rpl_process_dis(), and rpl_process_hbh().

◆ rpl_timers_schedule_state_update()

void rpl_timers_schedule_state_update ( void  )

Schedule a state update ASAP.

Useful to force an update from a context where updating directly would be unsafe.

Definition at line 563 of file rpl-timers.c.