OpenWSN Firmware
forwarding.h
Go to the documentation of this file.
1 #ifndef __FORWARDING_H
2 #define __FORWARDING_H
3 
11 #include "iphc.h"
12 
13 //=========================== define ==========================================
14 
15 #define RPL_HOPBYHOP_HEADER_OPTION_TYPE 0x63
16 
17 enum {
18  PCKTFORWARD = 1, // used by the node to indicate is forwarding a packet -- either upstream or downstream
19  PCKTSEND = 2, // used by the node to indicate is sending a packet
20 };
21 
22 enum {
23  O_FLAG = 0x80,
24  R_FLAG = 0x40,
25  F_FLAG = 0x20,
26 };
27 
28 //=========================== typedef =========================================
29 
35 BEGIN_PACK
36 typedef struct {
37  uint8_t nextHeader;
38  uint8_t HdrExtLen;
39  uint8_t RoutingType;
40  uint8_t SegmentsLeft;
41  uint8_t CmprICmprE;
42  uint8_t PadRes;
43  uint16_t Reserved;
45 END_PACK
46 
47 //=========================== variables =======================================
48 
49 //=========================== prototypes ======================================
50 
51 void forwarding_init(void);
55  OpenQueueEntry_t* msg,
56  ipv6_header_iht* ipv6_header,
57  ipv6_hopbyhop_iht* ipv6_hop_header,
58  rpl_option_ht* rpl_option
59 );
60 
66 #endif
void forwarding_sendDone(OpenQueueEntry_t *msg, owerror_t error)
Indicates a packet has been sent.
Definition: forwarding.c:113
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.
Definition: forwarding.c:161
Definition: forwarding.h:24
uint8_t HdrExtLen
In 8-octet units, excluding first 8.
Definition: forwarding.h:38
Definition: iphc.h:118
RPL Option header type.
Definition: iphc.h:163
uint8_t PadRes
Number of padding octets. Set to 0 if using EUI64.
Definition: forwarding.h:42
uint8_t owerror_t
Definition: openwsn.h:265
Definition: forwarding.h:23
uint8_t nextHeader
Header immediately following.
Definition: forwarding.h:37
uint8_t CmprICmprE
Number of prefix octets elided for all (CmprI) and last (CmprE) segment.
Definition: forwarding.h:41
Definition: forwarding.h:19
void forwarding_init()
Initialize this module.
Definition: forwarding.c:48
IPv6 hop-by-hop option.
Definition: iphc.h:149
Definition: forwarding.h:18
Definition: forwarding.h:25
Definition: openwsn.h:288
owerror_t forwarding_send(OpenQueueEntry_t *msg)
Send a packet originating at this mote.
Definition: forwarding.c:59
uint8_t RoutingType
Set to 3 for "Source Routing Header".
Definition: forwarding.h:39
RPL source routing header.
Definition: forwarding.h:36
uint8_t SegmentsLeft
Number of addresses still to visit.
Definition: forwarding.h:40
uint16_t Reserved
Set to 0.
Definition: forwarding.h:43