我想使用pcapplusplus库或其他类似的库从tcp数据包中提取tcp有效负载数据。我搜索了文档,但没有找到如何获得tcp有效负载,但我可以通过使用各种api获得tcp报头中的几乎任何内容。我如何获得有效负载?
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 ()