ReactOS 0.4.16-dev-258-g81860b4
tcp.h File Reference
#include "lwip/arch.h"
Include dependency graph for tcp.h:

Go to the source code of this file.

Classes

struct  tcp_hdr
 

Macros

#define TCP_HLEN   20
 
#define TCP_FIN   0x01U
 
#define TCP_SYN   0x02U
 
#define TCP_RST   0x04U
 
#define TCP_PSH   0x08U
 
#define TCP_ACK   0x10U
 
#define TCP_URG   0x20U
 
#define TCP_ECE   0x40U
 
#define TCP_CWR   0x80U
 
#define TCP_FLAGS   0x3fU
 
#define TCP_MAX_OPTION_BYTES   40
 
#define TCPH_HDRLEN(phdr)   ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) >> 12))
 
#define TCPH_HDRLEN_BYTES(phdr)   ((u8_t)(TCPH_HDRLEN(phdr) << 2))
 
#define TCPH_FLAGS(phdr)   ((u8_t)((lwip_ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)))
 
#define TCPH_HDRLEN_SET(phdr, len)   (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | TCPH_FLAGS(phdr))
 
#define TCPH_FLAGS_SET(phdr, flags)   (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS(~TCP_FLAGS)) | lwip_htons(flags))
 
#define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags)   (phdr)->_hdrlen_rsvd_flags = (u16_t)(lwip_htons((u16_t)((len) << 12) | (flags)))
 
#define TCPH_SET_FLAG(phdr, flags)   (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | lwip_htons(flags))
 
#define TCPH_UNSET_FLAG(phdr, flags)   (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~lwip_htons(flags))
 

Variables

PACK_STRUCT_BEGIN struct tcp_hdr PACK_STRUCT_STRUCT
 

Detailed Description

TCP protocol definitions

Definition in file tcp.h.

Macro Definition Documentation

◆ TCP_ACK

#define TCP_ACK   0x10U

Definition at line 76 of file tcp.h.

◆ TCP_CWR

#define TCP_CWR   0x80U

Definition at line 79 of file tcp.h.

◆ TCP_ECE

#define TCP_ECE   0x40U

Definition at line 78 of file tcp.h.

◆ TCP_FIN

#define TCP_FIN   0x01U

Definition at line 72 of file tcp.h.

◆ TCP_FLAGS

#define TCP_FLAGS   0x3fU

Definition at line 81 of file tcp.h.

◆ TCP_HLEN

#define TCP_HLEN   20

Definition at line 47 of file tcp.h.

◆ TCP_MAX_OPTION_BYTES

#define TCP_MAX_OPTION_BYTES   40

Definition at line 83 of file tcp.h.

◆ TCP_PSH

#define TCP_PSH   0x08U

Definition at line 75 of file tcp.h.

◆ TCP_RST

#define TCP_RST   0x04U

Definition at line 74 of file tcp.h.

◆ TCP_SYN

#define TCP_SYN   0x02U

Definition at line 73 of file tcp.h.

◆ TCP_URG

#define TCP_URG   0x20U

Definition at line 77 of file tcp.h.

◆ TCPH_FLAGS

#define TCPH_FLAGS (   phdr)    ((u8_t)((lwip_ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)))

Definition at line 87 of file tcp.h.

◆ TCPH_FLAGS_SET

#define TCPH_FLAGS_SET (   phdr,
  flags 
)    (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS(~TCP_FLAGS)) | lwip_htons(flags))

Definition at line 90 of file tcp.h.

◆ TCPH_HDRLEN

#define TCPH_HDRLEN (   phdr)    ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) >> 12))

Definition at line 85 of file tcp.h.

◆ TCPH_HDRLEN_BYTES

#define TCPH_HDRLEN_BYTES (   phdr)    ((u8_t)(TCPH_HDRLEN(phdr) << 2))

Definition at line 86 of file tcp.h.

◆ TCPH_HDRLEN_FLAGS_SET

#define TCPH_HDRLEN_FLAGS_SET (   phdr,
  len,
  flags 
)    (phdr)->_hdrlen_rsvd_flags = (u16_t)(lwip_htons((u16_t)((len) << 12) | (flags)))

Definition at line 91 of file tcp.h.

◆ TCPH_HDRLEN_SET

#define TCPH_HDRLEN_SET (   phdr,
  len 
)    (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | TCPH_FLAGS(phdr))

Definition at line 89 of file tcp.h.

◆ TCPH_SET_FLAG

#define TCPH_SET_FLAG (   phdr,
  flags 
)    (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | lwip_htons(flags))

Definition at line 93 of file tcp.h.

◆ TCPH_UNSET_FLAG

#define TCPH_UNSET_FLAG (   phdr,
  flags 
)    (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~lwip_htons(flags))

Definition at line 94 of file tcp.h.

Variable Documentation

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_BEGIN struct tcp_hdr PACK_STRUCT_STRUCT