Contiki-NG
Data Fields
routing_driver Struct Reference

The structure of a routing protocol driver. More...

#include <os/net/routing/routing.h>

Data Fields

void(* init )(void)
 Initialize the routing protocol.
 
void(* root_set_prefix )(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
 Set the prefix, for nodes that will operate as root. More...
 
int(* root_start )(void)
 Set the node as root and start a network. More...
 
int(* node_is_root )(void)
 Tells whether the node is a network root or not. More...
 
int(* get_root_ipaddr )(uip_ipaddr_t *ipaddr)
 Returns the IPv6 address of the network root, if any. More...
 
int(* get_sr_node_ipaddr )(uip_ipaddr_t *addr, const uip_sr_node_t *node)
 Returns the global IPv6 address of a source routing node. More...
 
void(* leave_network )(void)
 Leave the network the node is part of. More...
 
int(* node_has_joined )(void)
 Tells whether the node is currently part of a network. More...
 
int(* node_is_reachable )(void)
 Tells whether the node is currently reachable as part of the network. More...
 
void(* global_repair )(const char *str)
 Triggers a global topology repair. More...
 
void(* local_repair )(const char *str)
 Triggers a RPL local topology repair. More...
 
bool(* ext_header_remove )(void)
 Removes all extension headers that pertain to the routing protocol. More...
 
int(* ext_header_update )(void)
 Adds/updates routing protocol extension headers to current uIP packet. More...
 
int(* ext_header_hbh_update )(uint8_t *ext_buf, int opt_offset)
 Process and update the routing protocol hob-by-hop extention headers of the current uIP packet. More...
 
int(* ext_header_srh_update )(void)
 Process and update SRH in-place, i.e. More...
 
int(* ext_header_srh_get_next_hop )(uip_ipaddr_t *ipaddr)
 Look for next hop from SRH of current uIP packet. More...
 
void(* link_callback )(const linkaddr_t *addr, int status, int numtx)
 Called by lower layers after every packet transmission. More...
 
void(* neighbor_state_changed )(uip_ds6_nbr_t *nbr)
 Called by uIP to notify addition/removal of IPv6 neighbor entries. More...
 
void(* drop_route )(uip_ds6_route_t *route)
 Called by uIP if it has decided to drop a route because. More...
 
uint8_t(* is_in_leaf_mode )(void)
 Tells whether the protocol is in leaf mode. More...
 

Detailed Description

The structure of a routing protocol driver.

Definition at line 60 of file routing.h.

Field Documentation

◆ drop_route

void(* routing_driver::drop_route) (uip_ds6_route_t *route)

Called by uIP if it has decided to drop a route because.

Parameters
routeThe route that will be dropped after this function returns

Definition at line 184 of file routing.h.

◆ ext_header_hbh_update

int(* routing_driver::ext_header_hbh_update) (uint8_t *ext_buf, int opt_offset)

Process and update the routing protocol hob-by-hop extention 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 149 of file routing.h.

◆ ext_header_remove

bool(* routing_driver::ext_header_remove) (void)

Removes all extension headers that pertain to the routing protocol.

Returns
true in case of success, false otherwise

Definition at line 132 of file routing.h.

◆ ext_header_srh_get_next_hop

int(* routing_driver::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 162 of file routing.h.

◆ ext_header_srh_update

int(* routing_driver::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 155 of file routing.h.

◆ ext_header_update

int(* routing_driver::ext_header_update) (void)

Adds/updates routing protocol extension headers to current uIP packet.

Returns
1 in case of success, 0 otherwise

Definition at line 138 of file routing.h.

◆ get_root_ipaddr

int(* routing_driver::get_root_ipaddr) (uip_ipaddr_t *ipaddr)

Returns the IPv6 address of the network root, if any.

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

Definition at line 89 of file routing.h.

◆ get_sr_node_ipaddr

int(* routing_driver::get_sr_node_ipaddr) (uip_ipaddr_t *addr, const uip_sr_node_t *node)

Returns the global IPv6 address of a source routing node.

Parameters
ipaddrA pointer where to copy the IP address of the node
nodeThe source routing node
Returns
1 if the global node address was copied, 0 otherwise

Definition at line 97 of file routing.h.

◆ global_repair

void(* routing_driver::global_repair) (const char *str)

Triggers a global topology repair.

Parameters
strA textual description of the cause for triggering a repair

Definition at line 120 of file routing.h.

◆ is_in_leaf_mode

uint8_t(* routing_driver::is_in_leaf_mode) (void)

Tells whether the protocol is in leaf mode.

Return values
1if the protocol is in leaf mode, 0 if not.

Definition at line 190 of file routing.h.

◆ leave_network

void(* routing_driver::leave_network) (void)

Leave the network the node is part of.

Definition at line 102 of file routing.h.

◆ link_callback

void(* routing_driver::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 170 of file routing.h.

◆ local_repair

void(* routing_driver::local_repair) (const char *str)

Triggers a RPL local topology repair.

Parameters
strA textual description of the cause for triggering a repair

Definition at line 126 of file routing.h.

◆ neighbor_state_changed

void(* routing_driver::neighbor_state_changed) (uip_ds6_nbr_t *nbr)

Called by uIP to notify addition/removal of IPv6 neighbor entries.

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 178 of file routing.h.

◆ node_has_joined

int(* routing_driver::node_has_joined) (void)

Tells whether the node is currently part of a network.

Returns
1 if we have joined a network, 0 otherwise.

Definition at line 108 of file routing.h.

◆ node_is_reachable

int(* routing_driver::node_is_reachable) (void)

Tells whether the node is currently reachable as part of the network.

Returns
1 if we are reachable, 0 otherwise.

Definition at line 114 of file routing.h.

◆ node_is_root

int(* routing_driver::node_is_root) (void)

Tells whether the node is a network root or not.

Returns
1 if we are root, 0 otherwise

Definition at line 82 of file routing.h.

◆ root_set_prefix

void(* routing_driver::root_set_prefix) (uip_ipaddr_t *prefix, uip_ipaddr_t *iid)

Set the prefix, for nodes that will operate as 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 70 of file routing.h.

◆ root_start

int(* routing_driver::root_start) (void)

Set the node as root and start a network.

Returns
0 in case of success, -1 otherwise

Definition at line 76 of file routing.h.