OpenWSN Firmware
Main Page
Modules
Data Structures
Files
File List
Globals
iphc.h
Go to the documentation of this file.
1
#ifndef __IPHC_H
2
#define __IPHC_H
3
11
#include "
openwsn.h
"
12
13
//=========================== define ==========================================
14
15
#define IPHC_DEFAULT_HOP_LIMIT 65
16
#define IPv6HOP_HDR_LEN 3
17
18
enum
IPHC_enums
{
19
IPHC_DISPATCH
= 5,
20
IPHC_TF
= 3,
21
IPHC_NH
= 2,
22
IPHC_HLIM
= 0,
23
IPHC_CID
= 7,
24
IPHC_SAC
= 6,
25
IPHC_SAM
= 4,
26
IPHC_M
= 3,
27
IPHC_DAC
= 2,
28
IPHC_DAM
= 0,
29
};
30
31
enum
IPHC_DISPATCH_enums
{
32
IPHC_DISPATCH_IPHC
= 3,
33
};
34
35
enum
IPHC_TF_enums
{
36
IPHC_TF_4B
= 0,
37
IPHC_TF_3B
= 1,
38
IPHC_TF_1B
= 2,
39
IPHC_TF_ELIDED
= 3,
40
};
41
42
enum
IPHC_NH_enums
{
43
IPHC_NH_INLINE
= 0,
44
IPHC_NH_COMPRESSED
= 1,
45
};
46
47
enum
NHC_enums
{
48
// IPv6 Extension Header Encoding starts with b1110 xxxx
49
NHC_IPv6EXT_MASK
= 0xf0,
// b1111 0000
50
NHC_IPv6EXT_ID
= 0xe0,
// b1110 0000
51
// UDP Header Encoding starts with b1111 0xxx
52
NHC_UDP_MASK
= 0xf8,
// b1111 1000
53
NHC_UDP_ID
= 0xf0,
// b1111 0000
54
};
55
56
enum
NHC_IPv6HOP_enums
{
57
NHC_IPv6HOP_MASK
= 0x0e,
58
NHC_IPv6HOP_VAL
= 0x0e,
59
NHC_HOP_NH_MASK
= 0x01,
60
};
61
62
63
enum
NHC_UDP_enums
{
64
NHC_UDP_C_MASK
= 0x40,
65
NHC_UDP_PORTS_MASK
= 0x03,
66
};
67
68
enum
NHC_UDP_PORTS_enums
{
69
NHC_UDP_PORTS_INLINE
= 0,
70
NHC_UDP_PORTS_16S_8D
= 1,
71
NHC_UDP_PORTS_8S_8D
= 2,
72
NHC_UDP_PORTS_4S_4D
= 3,
73
};
74
75
enum
IPHC_HLIM_enums
{
76
IPHC_HLIM_INLINE
= 0,
77
IPHC_HLIM_1
= 1,
78
IPHC_HLIM_64
= 2,
79
IPHC_HLIM_255
= 3,
80
};
81
82
enum
IPHC_CID_enums
{
83
IPHC_CID_NO
= 0,
84
IPHC_CID_YES
= 1,
85
};
86
87
enum
IPHC_SAC_enums
{
88
IPHC_SAC_STATELESS
= 0,
89
IPHC_SAC_STATEFUL
= 1,
90
};
91
92
enum
IPHC_SAM_enums
{
93
IPHC_SAM_128B
= 0,
94
IPHC_SAM_64B
= 1,
95
IPHC_SAM_16B
= 2,
96
IPHC_SAM_ELIDED
= 3,
97
};
98
99
enum
IPHC_M_enums
{
100
IPHC_M_NO
= 0,
101
IPHC_M_YES
= 1,
102
};
103
104
enum
IPHC_DAC_enums
{
105
IPHC_DAC_STATELESS
= 0,
106
IPHC_DAC_STATEFUL
= 1,
107
};
108
109
enum
IPHC_DAM_enums
{
110
IPHC_DAM_128B
= 0,
111
IPHC_DAM_64B
= 1,
112
IPHC_DAM_16B
= 2,
113
IPHC_DAM_ELIDED
= 3,
114
};
115
116
//=========================== typedef =========================================
117
118
typedef
struct
{
119
uint8_t
traffic_class
;
120
uint32_t
flow_label
;
121
bool
next_header_compressed
;
122
uint8_t
next_header
;
123
uint8_t
hop_limit
;
124
open_addr_t
src
;
125
open_addr_t
dest
;
126
uint8_t
header_length
;
127
}
ipv6_header_iht
;
// iht for "internal header type"
128
149
typedef
struct
{
150
uint8_t
headerlen
;
151
bool
next_header_compressed
;
152
uint8_t
lowpan_nhc
;
153
uint8_t
nextHeader
;
154
uint8_t
HdrExtLen
;
155
}
ipv6_hopbyhop_iht
;
156
162
BEGIN_PACK
163
typedef
struct
{
164
uint8_t
optionType
;
165
uint8_t
optionLen
;
166
uint8_t
flags
;
167
uint8_t
rplInstanceID
;
168
uint16_t
senderRank
;
169
}
rpl_option_ht
;
170
END_PACK
171
172
//=========================== variables =======================================
173
174
//=========================== prototypes ======================================
175
176
void
iphc_init
(
void
);
177
owerror_t
iphc_sendFromForwarding
(
178
OpenQueueEntry_t
* msg,
179
ipv6_header_iht
* ipv6_header,
180
rpl_option_ht
* rpl_option,
181
uint32_t* flow_label,
182
uint8_t fw_SendOrfw_Rcv
183
);
184
owerror_t
iphc_sendFromBridge
(
OpenQueueEntry_t
*msg);
185
void
iphc_sendDone
(
OpenQueueEntry_t
*msg,
owerror_t
error);
186
void
iphc_receive
(
OpenQueueEntry_t
*msg);
187
193
#endif
NHC_UDP_PORTS_INLINE
Definition:
iphc.h:69
NHC_IPv6HOP_MASK
Definition:
iphc.h:57
IPHC_M_enums
IPHC_M_enums
Definition:
iphc.h:99
ipv6_header_iht::hop_limit
uint8_t hop_limit
Definition:
iphc.h:123
IPHC_DAM_128B
Definition:
iphc.h:110
IPHC_SAM_enums
IPHC_SAM_enums
Definition:
iphc.h:92
rpl_option_ht::optionLen
uint8_t optionLen
8-bit field indicating the length of the option, in octets, excluding the Option Type and Opt Data Le...
Definition:
iphc.h:165
ipv6_header_iht::src
open_addr_t src
Definition:
iphc.h:124
IPHC_CID_enums
IPHC_CID_enums
Definition:
iphc.h:82
IPHC_SAM_ELIDED
Definition:
iphc.h:96
IPHC_M_YES
Definition:
iphc.h:101
IPHC_NH_INLINE
Definition:
iphc.h:43
IPHC_DISPATCH
Definition:
iphc.h:19
ipv6_hopbyhop_iht::nextHeader
uint8_t nextHeader
Definition:
iphc.h:153
iphc_init
void iphc_init()
Definition:
iphc.c:51
rpl_option_ht::optionType
uint8_t optionType
RPL_HOPBYHOP_HEADER_OPTION_TYPE.
Definition:
iphc.h:164
ipv6_header_iht::flow_label
uint32_t flow_label
Definition:
iphc.h:120
NHC_UDP_enums
NHC_UDP_enums
Definition:
iphc.h:63
NHC_UDP_PORTS_16S_8D
Definition:
iphc.h:70
ipv6_header_iht
Definition:
iphc.h:118
IPHC_SAC_STATELESS
Definition:
iphc.h:88
IPHC_TF_3B
Definition:
iphc.h:37
NHC_IPv6HOP_VAL
Definition:
iphc.h:58
rpl_option_ht
RPL Option header type.
Definition:
iphc.h:163
IPHC_DAM_64B
Definition:
iphc.h:111
IPHC_SAM_64B
Definition:
iphc.h:94
ipv6_header_iht::next_header
uint8_t next_header
Definition:
iphc.h:122
NHC_HOP_NH_MASK
Definition:
iphc.h:59
IPHC_DAM_16B
Definition:
iphc.h:112
ipv6_header_iht::header_length
uint8_t header_length
Counter for internal use.
Definition:
iphc.h:126
IPHC_SAM
Definition:
iphc.h:25
NHC_UDP_PORTS_enums
NHC_UDP_PORTS_enums
Definition:
iphc.h:68
owerror_t
uint8_t owerror_t
Definition:
openwsn.h:265
IPHC_enums
IPHC_enums
Definition:
iphc.h:18
IPHC_DAC_STATEFUL
Definition:
iphc.h:106
IPHC_HLIM_1
Definition:
iphc.h:77
IPHC_SAC_enums
IPHC_SAC_enums
Definition:
iphc.h:87
rpl_option_ht::senderRank
uint16_t senderRank
RPL rank of the sender of the packet.
Definition:
iphc.h:168
IPHC_M
Definition:
iphc.h:26
NHC_UDP_PORTS_4S_4D
Definition:
iphc.h:72
rpl_option_ht::rplInstanceID
uint8_t rplInstanceID
instanceid
Definition:
iphc.h:167
NHC_IPv6EXT_MASK
Definition:
iphc.h:49
NHC_IPv6EXT_ID
Definition:
iphc.h:50
IPHC_SAC
Definition:
iphc.h:24
iphc_sendFromForwarding
owerror_t iphc_sendFromForwarding(OpenQueueEntry_t *msg, ipv6_header_iht *ipv6_header, rpl_option_ht *rpl_option, uint32_t *flow_label, uint8_t fw_SendOrfw_Rcv)
Definition:
iphc.c:55
ipv6_header_iht::dest
open_addr_t dest
Definition:
iphc.h:125
IPHC_DISPATCH_enums
IPHC_DISPATCH_enums
Definition:
iphc.h:31
IPHC_DAM
Definition:
iphc.h:28
IPHC_TF
Definition:
iphc.h:20
openwsn.h
IPHC_TF_ELIDED
Definition:
iphc.h:39
ipv6_hopbyhop_iht::HdrExtLen
uint8_t HdrExtLen
Definition:
iphc.h:154
iphc_sendFromBridge
owerror_t iphc_sendFromBridge(OpenQueueEntry_t *msg)
Definition:
iphc.c:199
IPHC_DAC_STATELESS
Definition:
iphc.h:105
IPHC_DAC
Definition:
iphc.h:27
IPHC_HLIM_enums
IPHC_HLIM_enums
Definition:
iphc.h:75
ipv6_hopbyhop_iht::lowpan_nhc
uint8_t lowpan_nhc
Definition:
iphc.h:152
open_addr_t
Definition:
openwsn.h:276
IPHC_CID
Definition:
iphc.h:23
IPHC_HLIM_64
Definition:
iphc.h:78
IPHC_DISPATCH_IPHC
Definition:
iphc.h:32
IPHC_DAM_enums
IPHC_DAM_enums
Definition:
iphc.h:109
IPHC_CID_YES
Definition:
iphc.h:84
NHC_UDP_C_MASK
Definition:
iphc.h:64
IPHC_CID_NO
Definition:
iphc.h:83
NHC_IPv6HOP_enums
NHC_IPv6HOP_enums
Definition:
iphc.h:56
IPHC_DAC_enums
IPHC_DAC_enums
Definition:
iphc.h:104
IPHC_TF_enums
IPHC_TF_enums
Definition:
iphc.h:35
NHC_UDP_PORTS_8S_8D
Definition:
iphc.h:71
IPHC_DAM_ELIDED
Definition:
iphc.h:113
IPHC_NH_COMPRESSED
Definition:
iphc.h:44
IPHC_SAM_128B
Definition:
iphc.h:93
IPHC_M_NO
Definition:
iphc.h:100
iphc_sendDone
void iphc_sendDone(OpenQueueEntry_t *msg, owerror_t error)
Definition:
iphc.c:211
ipv6_hopbyhop_iht
IPv6 hop-by-hop option.
Definition:
iphc.h:149
IPHC_NH_enums
IPHC_NH_enums
Definition:
iphc.h:42
IPHC_SAM_16B
Definition:
iphc.h:95
rpl_option_ht::flags
uint8_t flags
ORF00000.
Definition:
iphc.h:166
OpenQueueEntry_t
Definition:
openwsn.h:288
ipv6_hopbyhop_iht::next_header_compressed
bool next_header_compressed
Definition:
iphc.h:151
NHC_UDP_MASK
Definition:
iphc.h:52
IPHC_HLIM_255
Definition:
iphc.h:79
ipv6_header_iht::next_header_compressed
bool next_header_compressed
Definition:
iphc.h:121
ipv6_hopbyhop_iht::headerlen
uint8_t headerlen
Counter for internal use.
Definition:
iphc.h:150
IPHC_NH
Definition:
iphc.h:21
IPHC_HLIM_INLINE
Definition:
iphc.h:76
NHC_UDP_ID
Definition:
iphc.h:53
iphc_receive
void iphc_receive(OpenQueueEntry_t *msg)
Definition:
iphc.c:220
IPHC_TF_4B
Definition:
iphc.h:36
ipv6_header_iht::traffic_class
uint8_t traffic_class
Definition:
iphc.h:119
NHC_UDP_PORTS_MASK
Definition:
iphc.h:65
IPHC_SAC_STATEFUL
Definition:
iphc.h:89
IPHC_TF_1B
Definition:
iphc.h:38
IPHC_HLIM
Definition:
iphc.h:22
NHC_enums
NHC_enums
Definition:
iphc.h:47
firmware
openos
openwsn
03a-IPHC
iphc.h
Generated on Wed Sep 24 2014 04:39:18 for OpenWSN Firmware by
1.8.5