37#ifndef LWIP_HDR_PROT_IP6_H
38#define LWIP_HDR_PROT_IP6_H
49#ifdef PACK_STRUCT_USE_INCLUDES
54 PACK_STRUCT_FIELD(u32_t addr[4]);
57#ifdef PACK_STRUCT_USE_INCLUDES
64#define IP6_NEXTH_HOPBYHOP 0
65#define IP6_NEXTH_TCP 6
66#define IP6_NEXTH_UDP 17
67#define IP6_NEXTH_ENCAPS 41
68#define IP6_NEXTH_ROUTING 43
69#define IP6_NEXTH_FRAGMENT 44
70#define IP6_NEXTH_ICMP6 58
71#define IP6_NEXTH_NONE 59
72#define IP6_NEXTH_DESTOPTS 60
73#define IP6_NEXTH_UDPLITE 136
76#ifdef PACK_STRUCT_USE_INCLUDES
94#ifdef PACK_STRUCT_USE_INCLUDES
97#define IP6H_V(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 28) & 0x0f)
98#define IP6H_TC(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 20) & 0xff)
99#define IP6H_FL(hdr) (lwip_ntohl((hdr)->_v_tc_fl) & 0x000fffff)
100#define IP6H_PLEN(hdr) (lwip_ntohs((hdr)->_plen))
101#define IP6H_NEXTH(hdr) ((hdr)->_nexth)
102#define IP6H_NEXTH_P(hdr) ((u8_t *)(hdr) + 6)
103#define IP6H_HOPLIM(hdr) ((hdr)->_hoplim)
104#define IP6H_VTCFL_SET(hdr, v, tc, fl) (hdr)->_v_tc_fl = (lwip_htonl((((u32_t)(v)) << 28) | (((u32_t)(tc)) << 20) | (fl)))
105#define IP6H_PLEN_SET(hdr, plen) (hdr)->_plen = lwip_htons(plen)
106#define IP6H_NEXTH_SET(hdr, nexth) (hdr)->_nexth = (nexth)
107#define IP6H_HOPLIM_SET(hdr, hl) (hdr)->_hoplim = (u8_t)(hl)
110#define IP6_PAD1_OPTION 0
111#define IP6_PADN_OPTION 1
112#define IP6_ROUTER_ALERT_OPTION 5
113#define IP6_JUMBO_OPTION 194
114#define IP6_HOME_ADDRESS_OPTION 201
115#define IP6_ROUTER_ALERT_DLEN 2
116#define IP6_ROUTER_ALERT_VALUE_MLD 0
118#ifdef PACK_STRUCT_USE_INCLUDES
124 PACK_STRUCT_FLD_8(u8_t _opt_type);
126 PACK_STRUCT_FLD_8(u8_t _opt_dlen);
129#ifdef PACK_STRUCT_USE_INCLUDES
132#define IP6_OPT_HLEN 2
133#define IP6_OPT_TYPE_ACTION(hdr) ((((hdr)->_opt_type) >> 6) & 0x3)
134#define IP6_OPT_TYPE_CHANGE(hdr) ((((hdr)->_opt_type) >> 5) & 0x1)
135#define IP6_OPT_TYPE(hdr) ((hdr)->_opt_type)
136#define IP6_OPT_DLEN(hdr) ((hdr)->_opt_dlen)
139#define IP6_HBH_HLEN 2
141#ifdef PACK_STRUCT_USE_INCLUDES
147 PACK_STRUCT_FLD_8(u8_t _nexth);
149 PACK_STRUCT_FLD_8(u8_t _hlen);
152#ifdef PACK_STRUCT_USE_INCLUDES
155#define IP6_HBH_NEXTH(hdr) ((hdr)->_nexth)
158#define IP6_DEST_HLEN 2
160#ifdef PACK_STRUCT_USE_INCLUDES
166 PACK_STRUCT_FLD_8(u8_t _nexth);
168 PACK_STRUCT_FLD_8(u8_t _hlen);
171#ifdef PACK_STRUCT_USE_INCLUDES
174#define IP6_DEST_NEXTH(hdr) ((hdr)->_nexth)
177#define IP6_ROUT_TYPE2 2
178#define IP6_ROUT_RPL 3
180#ifdef PACK_STRUCT_USE_INCLUDES
186 PACK_STRUCT_FLD_8(u8_t _nexth);
188 PACK_STRUCT_FLD_8(u8_t _hlen);
190 PACK_STRUCT_FIELD(u8_t _routing_type);
192 PACK_STRUCT_FIELD(u8_t _segments_left);
195#ifdef PACK_STRUCT_USE_INCLUDES
198#define IP6_ROUT_NEXTH(hdr) ((hdr)->_nexth)
199#define IP6_ROUT_TYPE(hdr) ((hdr)->_routing_type)
200#define IP6_ROUT_SEG_LEFT(hdr) ((hdr)->_segments_left)
203#define IP6_FRAG_HLEN 8
204#define IP6_FRAG_OFFSET_MASK 0xfff8
205#define IP6_FRAG_MORE_FLAG 0x0001
207#ifdef PACK_STRUCT_USE_INCLUDES
213 PACK_STRUCT_FLD_8(u8_t _nexth);
215 PACK_STRUCT_FLD_8(u8_t reserved);
217 PACK_STRUCT_FIELD(u16_t _fragment_offset);
219 PACK_STRUCT_FIELD(u32_t _identification);
222#ifdef PACK_STRUCT_USE_INCLUDES
225#define IP6_FRAG_NEXTH(hdr) ((hdr)->_nexth)
226#define IP6_FRAG_MBIT(hdr) (lwip_ntohs((hdr)->_fragment_offset) & 0x1)
227#define IP6_FRAG_ID(hdr) (lwip_ntohl((hdr)->_identification))
#define PACK_STRUCT_END
Definition: arch.h:318
#define PACK_STRUCT_BEGIN
Definition: arch.h:309
#define PACK_STRUCT_STRUCT
Definition: arch.h:330
PACK_STRUCT_FIELD(u16_t _plen)
PACK_STRUCT_FLD_S(ip6_addr_p_t src)
PACK_STRUCT_FLD_8(u8_t _nexth)
PACK_STRUCT_FIELD(u32_t _v_tc_fl)
PACK_STRUCT_FLD_8(u8_t _hoplim)