PcapPlusPlus  22.11
pcpp::SingleCommandTextProtocol Class Reference

#include <SingleCommandTextProtocol.h>

Inheritance diagram for pcpp::SingleCommandTextProtocol:
pcpp::Layer pcpp::IDataContainer pcpp::FtpLayer pcpp::FtpRequestLayer pcpp::FtpResponseLayer

Public Member Functions

bool isMultiLine () const
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
LayergetNextLayer () const
 
LayergetPrevLayer () const
 
ProtocolType getProtocol () const
 
uint8_t * getData () const
 
size_t getDataLen () const
 
uint8_t * getLayerPayload () const
 
size_t getLayerPayloadSize () const
 
bool isAllocatedToPacket () const
 
void copyData (uint8_t *toArr) const
 
uint8_t * getDataPtr (size_t offset=0) const
 
virtual void parseNextLayer ()=0
 
virtual size_t getHeaderLen () const =0
 
virtual void computeCalculateFields ()=0
 
virtual std::string toString () const =0
 
virtual OsiModelLayer getOsiModelLayer () const =0
 

Static Public Member Functions

static bool isDataValid (const uint8_t *data, size_t dataSize)
 

Detailed Description

Class for single command text based protocol (FTP, SMTP) messages

Member Function Documentation

◆ isDataValid()

static bool pcpp::SingleCommandTextProtocol::isDataValid ( const uint8_t *  data,
size_t  dataSize 
)
static

A static method that takes a byte array and detects whether it is a single command text based message. All single command text based message terminated with single "\r\n".

Parameters
[in]dataA byte array
[in]dataSizeThe byte array size (in bytes)
Returns
True if the data is identified as single command text based message

◆ isMultiLine()

bool pcpp::SingleCommandTextProtocol::isMultiLine ( ) const

Checks if the current message is a multi-line reply. Multi-line messages are indicated with a Hyphen (-) immediately after reply code.

Returns
true If this is a multi-line reply
false Otherwise