OpenWSN Firmware
forwarding.c File Reference
#include "openwsn.h"
#include "forwarding.h"
#include "iphc.h"
#include "openqueue.h"
#include "openserial.h"
#include "idmanager.h"
#include "packetfunctions.h"
#include "neighbors.h"
#include "icmpv6.h"
#include "icmpv6rpl.h"
#include "openudp.h"
#include "opentcp.h"
#include "debugpins.h"
#include "scheduler.h"

Functions

void forwarding_getNextHop (open_addr_t *destination128b, open_addr_t *addressToWrite64b)
 Retrieve the next hop's address from routing table. More...
 
owerror_t forwarding_send_internal_RoutingTable (OpenQueueEntry_t *msg, ipv6_header_iht *ipv6_header, rpl_option_ht *rpl_option, uint32_t *flow_label, uint8_t fw_SendOrfw_Rcv)
 Send a packet using the routing table to find the next hop. More...
 
owerror_t forwarding_send_internal_SourceRouting (OpenQueueEntry_t *msg, ipv6_header_iht *ipv6_header)
 Send a packet using the source rout to find the next hop. More...
 
void forwarding_createRplOption (rpl_option_ht *rpl_option, uint8_t flags)
 Create a RPL option. More...
 
void forwarding_init ()
 Initialize this module. More...
 
owerror_t forwarding_send (OpenQueueEntry_t *msg)
 Send a packet originating at this mote. More...
 
void forwarding_sendDone (OpenQueueEntry_t *msg, owerror_t error)
 Indicates a packet has been sent. More...
 
void forwarding_receive (OpenQueueEntry_t *msg, ipv6_header_iht *ipv6_header, ipv6_hopbyhop_iht *ipv6_hop_header, rpl_option_ht *rpl_option)
 Indicates a packet was received. More...
 

Function Documentation

void forwarding_createRplOption ( rpl_option_ht rpl_option,
uint8_t  flags 
)

Create a RPL option.

Parameters
[out]rpl_optionA pointer to the structure to fill in.
[in]flagsThe flags to indicate in the RPL option.
void forwarding_getNextHop ( open_addr_t destination128b,
open_addr_t addressToWrite64b 
)

Retrieve the next hop's address from routing table.

Parameters
[in]destination128bFinal IPv6 destination address.
[out]addressToWrite64bLocation to write the EUI64 of next hop to.
owerror_t forwarding_send_internal_RoutingTable ( OpenQueueEntry_t msg,
ipv6_header_iht ipv6_header,
rpl_option_ht rpl_option,
uint32_t *  flow_label,
uint8_t  fw_SendOrfw_Rcv 
)

Send a packet using the routing table to find the next hop.

Parameters
[in,out]msgThe packet to send.
[in]ipv6_headerThe packet's IPv6 header.
[in]rpl_optionThe hop-by-hop option to add in this packet.
[in]flow_labelThe flowlabel to add in the 6LoWPAN header.
[in]fw_SendOrfw_RcvThe packet is originating from this mote (PCKTSEND), or forwarded (PCKTFORWARD).
owerror_t forwarding_send_internal_SourceRouting ( OpenQueueEntry_t msg,
ipv6_header_iht ipv6_header 
)

Send a packet using the source rout to find the next hop.

Note
This is always called for packets being forwarded.

How to process the routing header is detailed in http://tools.ietf.org/html/rfc6554#page-9.

Parameters
[in,out]msgThe packet to send.
[in]ipv6_headerThe packet's IPv6 header.