1 #ifndef PACKETPP_TCP_LAYER 2 #define PACKETPP_TCP_LAYER 31 #if (BYTE_ORDER == LITTLE_ENDIAN) 51 #elif (BYTE_ORDER == BIG_ENDIAN) 72 #error "Endian is not LE nor BE..." 144 #define PCPP_TCPOLEN_NOP 1 146 #define PCPP_TCPOLEN_EOL 1 148 #define PCPP_TCPOLEN_MSS 4 150 #define PCPP_TCPOLEN_WINDOW 3 152 #define PCPP_TCPOLEN_SACK_PERM 2 154 #define PCPP_TCPOLEN_SACK_MIN 2 156 #define PCPP_TCPOLEN_ECHO 6 158 #define PCPP_TCPOLEN_ECHOREPLY 6 160 #define PCPP_TCPOLEN_TIMESTAMP 10 162 #define PCPP_TCPOLEN_CC 6 164 #define PCPP_TCPOLEN_CCNEW 6 166 #define PCPP_TCPOLEN_CCECHO 6 168 #define PCPP_TCPOLEN_MD5 18 170 #define PCPP_TCPOLEN_MPTCP_MIN 8 172 #define PCPP_TCPOLEN_SCPS 4 174 #define PCPP_TCPOLEN_SNACK 6 176 #define PCPP_TCPOLEN_RECBOUND 2 178 #define PCPP_TCPOLEN_CORREXP 2 180 #define PCPP_TCPOLEN_QS 8 182 #define PCPP_TCPOLEN_USER_TO 4 184 #define PCPP_TCPOLEN_RVBD_PROBE_MIN 3 186 #define PCPP_TCPOLEN_RVBD_TRPY_MIN 16 188 #define PCPP_TCPOLEN_EXP_MIN 2 231 return sizeof(uint8_t);
244 return (
size_t)m_Data->
recordLen - (2*
sizeof(uint8_t));
349 TcpLayer(uint16_t portSrc, uint16_t portDst);
464 int m_NumOfTrailingBytes;
467 inline uint8_t* getOptionsBasePtr() {
return m_Data +
sizeof(
tcphdr); }
468 TcpOption addTcpOptionAt(
const TcpOptionBuilder& optionBuilder,
int offset);
469 void adjustTcpOptionTrailer(
size_t totalOptSize);
470 void copyLayerData(
const TcpLayer& other);
TcpOption getNextTcpOption(TcpOption &tcpOption)
uint8_t recordLen
Definition: TLVData.h:33
Definition: TcpLayer.h:137
uint16_t finFlag
Definition: TcpLayer.h:32
uint16_t urgFlag
Definition: TcpLayer.h:32
Definition: TcpLayer.h:91
Definition: TcpLayer.h:131
size_t getTotalSize() const
Definition: TcpLayer.h:225
uint8_t recordType
Definition: TLVData.h:31
Definition: ProtocolType.h:222
Definition: TcpLayer.h:129
Definition: TcpLayer.h:107
uint16_t eceFlag
Definition: TcpLayer.h:32
uint16_t portSrc
Definition: TcpLayer.h:24
TcpOption getFirstTcpOption()
Definition: TcpLayer.h:95
Definition: TLVData.h:333
TcpOptionBuilder(TcpOptionType optionType, uint32_t optionValue)
Definition: TcpLayer.h:304
TcpOptionBuilder(TcpOptionType optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: TcpLayer.h:277
tcphdr * getTcpHeader()
Definition: TcpLayer.h:367
Definition: TcpLayer.h:103
uint32_t ackNumber
Definition: TcpLayer.h:30
Definition: TcpLayer.h:127
TcpOption addTcpOption(const TcpOptionBuilder &optionBuilder)
uint16_t pshFlag
Definition: TcpLayer.h:32
uint16_t rstFlag
Definition: TcpLayer.h:32
Definition: TcpLayer.h:22
Definition: TcpLayer.h:265
Definition: TcpLayer.h:97
size_t getHeaderLen()
Definition: TcpLayer.h:450
NopEolOptionTypes
Definition: TcpLayer.h:262
Definition: TcpLayer.h:111
Definition: TLVData.h:189
Definition: TcpLayer.h:133
Definition: TcpLayer.h:135
Definition: TcpLayer.h:254
uint16_t portDst
Definition: TcpLayer.h:26
Definition: TcpLayer.h:125
Definition: TcpLayer.h:267
Definition: TcpLayer.h:89
uint16_t ackFlag
Definition: TcpLayer.h:32
uint32_t sequenceNumber
Definition: TcpLayer.h:28
OsiModelLayer
Definition: ProtocolType.h:213
Definition: TcpLayer.h:99
TcpOption(uint8_t *optionRawData)
Definition: TcpLayer.h:204
Definition: TcpLayer.h:115
TcpOption addTcpOptionAfter(const TcpOptionBuilder &optionBuilder, TcpOptionType prevOptionType=TCPOPT_Unknown)
size_t getTcpOptionCount()
TcpOption getTcpOption(TcpOptionType option)
TcpOptionBuilder(TcpOptionType optionType, uint16_t optionValue)
Definition: TcpLayer.h:295
Definition: TcpLayer.h:117
Definition: TcpLayer.h:119
uint16_t dataOffset
Definition: TcpLayer.h:32
TcpOptionBuilder(TcpOptionType optionType, uint8_t optionValue)
Definition: TcpLayer.h:286
OsiModelLayer getOsiModelLayer()
Definition: TcpLayer.h:459
Definition: TcpLayer.h:113
uint16_t headerChecksum
Definition: TcpLayer.h:77
uint16_t cwrFlag
Definition: TcpLayer.h:32
Definition: TcpLayer.h:196
Definition: TcpLayer.h:109
TcpOptionType getTcpOptionType()
Definition: TcpLayer.h:215
uint16_t calculateChecksum(bool writeResultToPacket)
TcpOptionType
Definition: TcpLayer.h:87
bool removeTcpOption(TcpOptionType optionType)
Definition: TcpLayer.h:93
uint16_t urgentPointer
Definition: TcpLayer.h:79
Definition: TcpLayer.h:123
TcpLayer & operator=(const TcpLayer &other)
size_t getDataSize()
Definition: TcpLayer.h:236
Definition: TcpLayer.h:327
void computeCalculateFields()
~TcpOption()
Definition: TcpLayer.h:209
Definition: TcpLayer.h:121
Definition: TcpLayer.h:101
The main namespace for the PcapPlusPlus lib.
Definition: TcpLayer.h:105
uint16_t windowSize
Definition: TcpLayer.h:75
bool removeAllTcpOptions()
uint16_t synFlag
Definition: TcpLayer.h:32