56#ifndef LWIP_HDR_PROT_IP6_H
57#define LWIP_HDR_PROT_IP6_H
68#ifdef PACK_STRUCT_USE_INCLUDES
69# include "arch/bpstruct.h"
76#ifdef PACK_STRUCT_USE_INCLUDES
77# include "arch/epstruct.h"
83#define IP6_NEXTH_HOPBYHOP 0
84#define IP6_NEXTH_TCP 6
85#define IP6_NEXTH_UDP 17
86#define IP6_NEXTH_ENCAPS 41
87#define IP6_NEXTH_ROUTING 43
88#define IP6_NEXTH_FRAGMENT 44
89#define IP6_NEXTH_ICMP6 58
90#define IP6_NEXTH_NONE 59
91#define IP6_NEXTH_DESTOPTS 60
92#define IP6_NEXTH_UDPLITE 136
95#ifdef PACK_STRUCT_USE_INCLUDES
96# include "arch/bpstruct.h"
113#ifdef PACK_STRUCT_USE_INCLUDES
114# include "arch/epstruct.h"
118#define IP6_HBH_HLEN 8
119#define IP6_PAD1_OPTION 0
120#define IP6_PADN_ALERT_OPTION 1
121#define IP6_ROUTER_ALERT_OPTION 5
122#define IP6_ROUTER_ALERT_VALUE_MLD 0
123#ifdef PACK_STRUCT_USE_INCLUDES
124# include "arch/bpstruct.h"
144#ifdef PACK_STRUCT_USE_INCLUDES
145# include "arch/epstruct.h"
149#define IP6_FRAG_HLEN 8
150#define IP6_FRAG_OFFSET_MASK 0xfff8
151#define IP6_FRAG_MORE_FLAG 0x0001
152#ifdef PACK_STRUCT_USE_INCLUDES
153# include "arch/bpstruct.h"
167#ifdef PACK_STRUCT_USE_INCLUDES
168# include "arch/epstruct.h"
171#define IP6H_V(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 28) & 0x0f)
172#define IP6H_TC(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 20) & 0xff)
173#define IP6H_FL(hdr) (lwip_ntohl((hdr)->_v_tc_fl) & 0x000fffff)
174#define IP6H_PLEN(hdr) (lwip_ntohs((hdr)->_plen))
175#define IP6H_NEXTH(hdr) ((hdr)->_nexth)
176#define IP6H_NEXTH_P(hdr) ((u8_t *)(hdr) + 6)
177#define IP6H_HOPLIM(hdr) ((hdr)->_hoplim)
179#define IP6H_VTCFL_SET(hdr, v, tc, fl) (hdr)->_v_tc_fl = (lwip_htonl((((u32_t)(v)) << 28) | (((u32_t)(tc)) << 20) | (fl)))
180#define IP6H_PLEN_SET(hdr, plen) (hdr)->_plen = lwip_htons(plen)
181#define IP6H_NEXTH_SET(hdr, nexth) (hdr)->_nexth = (nexth)
182#define IP6H_HOPLIM_SET(hdr, hl) (hdr)->_hoplim = (u8_t)(hl)
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_FLD_8(x)
#define PACK_STRUCT_FIELD(x)
#define PACK_STRUCT_FLD_S(x)
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)