1 #ifndef PACKETPP_TCP_LAYER 2 #define PACKETPP_TCP_LAYER 30 #if (BYTE_ORDER == LITTLE_ENDIAN) 50 #elif (BYTE_ORDER == BIG_ENDIAN) 71 #error "Endian is not LE nor BE..." 141 #define PCPP_TCPOLEN_NOP 1 143 #define PCPP_TCPOLEN_EOL 1 145 #define PCPP_TCPOLEN_MSS 4 147 #define PCPP_TCPOLEN_WINDOW 3 149 #define PCPP_TCPOLEN_SACK_PERM 2 151 #define PCPP_TCPOLEN_SACK_MIN 2 153 #define PCPP_TCPOLEN_ECHO 6 155 #define PCPP_TCPOLEN_ECHOREPLY 6 157 #define PCPP_TCPOLEN_TIMESTAMP 10 159 #define PCPP_TCPOLEN_CC 6 161 #define PCPP_TCPOLEN_CCNEW 6 163 #define PCPP_TCPOLEN_CCECHO 6 165 #define PCPP_TCPOLEN_MD5 18 167 #define PCPP_TCPOLEN_MPTCP_MIN 8 169 #define PCPP_TCPOLEN_SCPS 4 171 #define PCPP_TCPOLEN_SNACK 6 173 #define PCPP_TCPOLEN_RECBOUND 2 175 #define PCPP_TCPOLEN_CORREXP 2 177 #define PCPP_TCPOLEN_QS 8 179 #define PCPP_TCPOLEN_USER_TO 4 181 #define PCPP_TCPOLEN_RVBD_PROBE_MIN 3 183 #define PCPP_TCPOLEN_RVBD_TRPY_MIN 16 185 #define PCPP_TCPOLEN_EXP_MIN 2 215 if (
getTotalSize() - 2*
sizeof(uint8_t) - valueOffset <
sizeof(T))
219 memcpy(&result, value+valueOffset,
sizeof(T));
234 memcpy(value+valueOffset, &newValue,
sizeof(T));
244 return sizeof(uint8_t);
285 TcpLayer(uint16_t portSrc, uint16_t portDst);
404 size_t m_TcpOptionsCount;
405 int m_NumOfTrailingBytes;
409 TcpOptionData* addTcpOptionAt(
TcpOption optionType, uint8_t optionLength,
const uint8_t* optionData,
int offset);
410 void adjustTcpOptionTrailer(
size_t totalOptSize);
411 void copyLayerData(
const TcpLayer& other);
uint8_t option
Definition: TcpLayer.h:195
uint16_t cwrFlag
Definition: TcpLayer.h:31
Definition: TcpLayer.h:96
Definition: TcpLayer.h:126
bool removeTcpOption(TcpOption optionType)
TcpOption getType()
Definition: TcpLayer.h:252
Definition: TcpLayer.h:191
uint16_t headerChecksum
Definition: TcpLayer.h:76
Definition: TcpLayer.h:100
TcpOptionData * addTcpOptionAfter(TcpOption optionType, uint8_t optionLength, const uint8_t *optionData, TcpOptionData *prevOption)
Definition: TcpLayer.h:88
uint16_t synFlag
Definition: TcpLayer.h:31
Definition: TcpLayer.h:108
OsiModelLayer getOsiModelLayer()
Definition: TcpLayer.h:400
Definition: TcpLayer.h:124
Definition: TcpLayer.h:116
Definition: TcpLayer.h:106
Definition: TcpLayer.h:130
Definition: TcpLayer.h:94
uint8_t len
Definition: TcpLayer.h:197
uint16_t finFlag
Definition: TcpLayer.h:31
Definition: TcpLayer.h:102
The main namespace for the PcapPlusPlus lib.
uint32_t ackNumber
Definition: TcpLayer.h:29
Definition: TcpLayer.h:112
uint8_t value[]
Definition: TcpLayer.h:199
uint16_t windowSize
Definition: TcpLayer.h:74
Definition: TcpLayer.h:134
uint16_t portSrc
Definition: TcpLayer.h:23
void computeCalculateFields()
OsiModelLayer
Definition: ProtocolType.h:208
Definition: TcpLayer.h:21
uint16_t calculateChecksum(bool writeResultToPacket)
size_t getTotalSize() const
Definition: TcpLayer.h:241
Definition: TcpLayer.h:122
TcpOptionData * addTcpOption(TcpOption optionType, uint8_t optionLength, const uint8_t *optionData)
Definition: TcpLayer.h:110
uint32_t sequenceNumber
Definition: TcpLayer.h:27
bool removeAllTcpOptions()
size_t getTcpOptionsCount()
Definition: TcpLayer.h:114
Definition: TcpLayer.h:263
uint16_t pshFlag
Definition: TcpLayer.h:31
tcphdr * getTcpHeader()
Definition: TcpLayer.h:303
uint16_t urgentPointer
Definition: TcpLayer.h:78
void setValue(T newValue, int valueOffset=0)
Definition: TcpLayer.h:232
Definition: ProtocolType.h:217
TcpLayer & operator=(const TcpLayer &other)
TcpOptionData * getFirstTcpOptionData()
Definition: TcpLayer.h:132
Definition: TcpLayer.h:128
TcpOptionData * getTcpOptionData(TcpOption option)
T getValueAs(int valueOffset=0)
Definition: TcpLayer.h:211
uint16_t portDst
Definition: TcpLayer.h:25
Definition: TcpLayer.h:98
size_t getHeaderLen()
Definition: TcpLayer.h:391
uint16_t rstFlag
Definition: TcpLayer.h:31
uint16_t dataOffset
Definition: TcpLayer.h:31
Definition: TcpLayer.h:118
Definition: TcpLayer.h:92
Definition: TcpLayer.h:120
Definition: TcpLayer.h:90
uint16_t urgFlag
Definition: TcpLayer.h:31
Definition: TcpLayer.h:104
uint16_t ackFlag
Definition: TcpLayer.h:31
uint16_t eceFlag
Definition: TcpLayer.h:31
TcpOption
Definition: TcpLayer.h:86
TcpOptionData * getNextTcpOptionData(TcpOptionData *tcpOption)