I want to extract the tcp payload data from tcp packet using pcapplusplus library, or other similar libraries as well. I search documentation but not able to find how to get the tcp payload, but i can get almost anything in the tcp header by using the various api's. How can i get the payload?
Public Member Functions
TcpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
TcpLayer ()
TcpLayer (uint16_t portSrc, uint16_t portDst)
TcpLayer (const TcpLayer &other)
TcpLayer & operator= (const TcpLayer &other)
tcphdr * getTcpHeader () const
uint16_t getSrcPort () const
uint16_t getDstPort () const
TcpOption getTcpOption (TcpOptionType option) const
TcpOption getFirstTcpOption () const
TcpOption getNextTcpOption (TcpOption &tcpOption) const
size_t getTcpOptionCount () const
TcpOption addTcpOption (const TcpOptionBuilder &optionBuilder)
TcpOption addTcpOptionAfter (const TcpOptionBuilder &optionBuilder, TcpOptionType prevOptionType=TCPOPT_Unknown)
bool removeTcpOption (TcpOptionType optionType)
bool removeAllTcpOptions ()
uint16_t calculateChecksum (bool writeResultToPacket)
void parseNextLayer ()
size_t getHeaderLen () const
void computeCalculateFields ()
std::string toString () const
OsiModelLayer getOsiModelLayer () const
THese are API's to get tcp header data.