56 #ifndef LWIP_HDR_PROT_TCP_H 57 #define LWIP_HDR_PROT_TCP_H 71 #ifdef PACK_STRUCT_USE_INCLUDES 72 # include "arch/bpstruct.h" 76 PACK_STRUCT_FIELD(u16_t src);
77 PACK_STRUCT_FIELD(u16_t dest);
78 PACK_STRUCT_FIELD(u32_t seqno);
79 PACK_STRUCT_FIELD(u32_t ackno);
80 PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags);
81 PACK_STRUCT_FIELD(u16_t wnd);
82 PACK_STRUCT_FIELD(u16_t chksum);
83 PACK_STRUCT_FIELD(u16_t urgp);
86 #ifdef PACK_STRUCT_USE_INCLUDES 87 # include "arch/epstruct.h" 100 #define TCP_FLAGS 0x3fU 102 #define TCPH_HDRLEN(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) >> 12)) 103 #define TCPH_FLAGS(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)) 105 #define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | TCPH_FLAGS(phdr)) 106 #define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS(~TCP_FLAGS)) | lwip_htons(flags)) 107 #define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = (u16_t)(lwip_htons((u16_t)((len) << 12) | (flags))) 109 #define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | lwip_htons(flags)) 110 #define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~lwip_htons(flags)) #define PACK_STRUCT_BEGIN