PcapPlusPlus
22.11
|
#include <FtpLayer.h>
Public Types | |
enum | FtpCommand : int { FtpCommand::UNK, FtpCommand::ABOR = ('A') | ('B' << 8) | ('O' << 16) | ('R' << 24), FtpCommand::ACCT = ('A') | ('C' << 8) | ('C' << 16) | ('T' << 24), FtpCommand::ADAT = ('A') | ('D' << 8) | ('A' << 16) | ('T' << 24), FtpCommand::ALLO = ('A') | ('L' << 8) | ('L' << 16) | ('O' << 24), FtpCommand::APPE = ('A') | ('P' << 8) | ('P' << 16) | ('E' << 24), FtpCommand::AUTH = ('A') | ('U' << 8) | ('T' << 16) | ('H' << 24), FtpCommand::AVBL = ('A') | ('V' << 8) | ('B' << 16) | ('L' << 24), FtpCommand::CCC = ('C') | ('C' << 8) | ('C' << 16), FtpCommand::CDUP = ('C') | ('D' << 8) | ('U' << 16) | ('P' << 24), FtpCommand::CONF = ('C') | ('O' << 8) | ('N' << 16) | ('F' << 24), FtpCommand::CSID = ('C') | ('S' << 8) | ('I' << 16) | ('D' << 24), FtpCommand::CWD = ('C') | ('W' << 8) | ('D' << 16), FtpCommand::DELE = ('D') | ('E' << 8) | ('L' << 16) | ('E' << 24), FtpCommand::DSIZ = ('D') | ('S' << 8) | ('I' << 16) | ('Z' << 24), FtpCommand::ENC = ('E') | ('N' << 8) | ('C' << 16), FtpCommand::EPRT = ('E') | ('P' << 8) | ('R' << 16) | ('T' << 24), FtpCommand::EPSV = ('E') | ('P' << 8) | ('S' << 16) | ('V' << 24), FtpCommand::FEAT = ('F') | ('E' << 8) | ('A' << 16) | ('T' << 24), FtpCommand::HELP = ('H') | ('E' << 8) | ('L' << 16) | ('P' << 24), FtpCommand::HOST = ('H') | ('O' << 8) | ('S' << 16) | ('T' << 24), FtpCommand::LANG = ('L') | ('A' << 8) | ('N' << 16) | ('G' << 24), FtpCommand::LIST = ('L') | ('I' << 8) | ('S' << 16) | ('T' << 24), FtpCommand::LPRT = ('L') | ('P' << 8) | ('R' << 16) | ('T' << 24), FtpCommand::LPSV = ('L') | ('P' << 8) | ('S' << 16) | ('V' << 24), FtpCommand::MDTM = ('M') | ('D' << 8) | ('T' << 16) | ('M' << 24), FtpCommand::MFCT = ('M') | ('F' << 8) | ('C' << 16) | ('T' << 24), FtpCommand::MFF = ('M') | ('F' << 8) | ('F' << 16), FtpCommand::MFMT = ('M') | ('F' << 8) | ('M' << 16) | ('T' << 24), FtpCommand::MIC = ('M') | ('I' << 8) | ('C' << 16), FtpCommand::MKD = ('M') | ('K' << 8) | ('D' << 16), FtpCommand::MLSD = ('M') | ('L' << 8) | ('S' << 16) | ('D' << 24), FtpCommand::MLST = ('M') | ('L' << 8) | ('S' << 16) | ('T' << 24), FtpCommand::MODE = ('M') | ('O' << 8) | ('D' << 16) | ('E' << 24), FtpCommand::NLST = ('N') | ('L' << 8) | ('S' << 16) | ('T' << 24), FtpCommand::NOOP = ('N') | ('O' << 8) | ('O' << 16) | ('P' << 24), FtpCommand::OPTS = ('O') | ('P' << 8) | ('T' << 16) | ('S' << 24), FtpCommand::PASS = ('P') | ('A' << 8) | ('S' << 16) | ('S' << 24), FtpCommand::PASV = ('P') | ('A' << 8) | ('S' << 16) | ('V' << 24), FtpCommand::PBSZ = ('P') | ('B' << 8) | ('S' << 16) | ('Z' << 24), FtpCommand::PORT = ('P') | ('O' << 8) | ('R' << 16) | ('T' << 24), FtpCommand::PROT = ('P') | ('R' << 8) | ('O' << 16) | ('T' << 24), FtpCommand::PWD = ('P') | ('W' << 8) | ('D' << 16), FtpCommand::QUIT = ('Q') | ('U' << 8) | ('I' << 16) | ('T' << 24), FtpCommand::REIN = ('R') | ('E' << 8) | ('I' << 16) | ('N' << 24), FtpCommand::REST = ('R') | ('E' << 8) | ('S' << 16) | ('T' << 24), FtpCommand::RETR = ('R') | ('E' << 8) | ('T' << 16) | ('R' << 24), FtpCommand::RMD = ('R') | ('M' << 8) | ('D' << 16), FtpCommand::RMDA = ('R') | ('M' << 8) | ('D' << 16) | ('A' << 24), FtpCommand::RNFR = ('R') | ('N' << 8) | ('F' << 16) | ('R' << 24), FtpCommand::RNTO = ('R') | ('N' << 8) | ('T' << 16) | ('O' << 24), FtpCommand::SITE = ('S') | ('I' << 8) | ('T' << 16) | ('E' << 24), FtpCommand::SIZE = ('S') | ('I' << 8) | ('Z' << 16) | ('E' << 24), FtpCommand::SMNT = ('S') | ('M' << 8) | ('N' << 16) | ('T' << 24), FtpCommand::SPSV = ('S') | ('P' << 8) | ('S' << 16) | ('V' << 24), FtpCommand::STAT = ('S') | ('T' << 8) | ('A' << 16) | ('T' << 24), FtpCommand::STOR = ('S') | ('T' << 8) | ('O' << 16) | ('R' << 24), FtpCommand::STOU = ('S') | ('T' << 8) | ('O' << 16) | ('U' << 24), FtpCommand::STRU = ('S') | ('T' << 8) | ('R' << 16) | ('U' << 24), FtpCommand::SYST = ('S') | ('Y' << 8) | ('S' << 16) | ('T' << 24), FtpCommand::THMB = ('T') | ('H' << 8) | ('M' << 16) | ('B' << 24), FtpCommand::TYPE = ('T') | ('Y' << 8) | ('P' << 16) | ('E' << 24), FtpCommand::USER = ('U') | ('S' << 8) | ('E' << 16) | ('R' << 24), FtpCommand::XCUP = ('X') | ('C' << 8) | ('U' << 16) | ('P' << 24), FtpCommand::XMKD = ('X') | ('M' << 8) | ('K' << 16) | ('D' << 24), FtpCommand::XPWD = ('X') | ('P' << 8) | ('W' << 16) | ('D' << 24) , FtpCommand::XRMD = ('X') | ('R' << 8) | ('M' << 16) | ('D' << 24) , FtpCommand::XSEM = ('X') | ('S' << 8) | ('E' << 16) | ('M' << 24), FtpCommand::XSEN = ('X') | ('S' << 8) | ('E' << 16) | ('N' << 24) } |
Public Member Functions | |
FtpRequestLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
FtpRequestLayer (const FtpCommand &command, const std::string &option="") | |
bool | setCommand (FtpCommand code) |
FtpCommand | getCommand () const |
std::string | getCommandString () const |
bool | setCommandOption (const std::string &value) |
std::string | getCommandOption (bool removeEscapeCharacters=true) const |
std::string | toString () const |
Public Member Functions inherited from pcpp::FtpLayer | |
void | parseNextLayer () |
FTP is the always last so does nothing for this layer. | |
size_t | getHeaderLen () const |
void | computeCalculateFields () |
Does nothing for this layer. | |
OsiModelLayer | getOsiModelLayer () const |
Public Member Functions inherited from pcpp::SingleCommandTextProtocol | |
bool | isMultiLine () const |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () 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 |
Static Public Member Functions | |
static std::string | getCommandInfo (FtpCommand code) |
static std::string | getCommandAsString (FtpCommand code) |
Static Public Member Functions inherited from pcpp::FtpLayer | |
static bool | isFtpPort (uint16_t port) |
Static Public Member Functions inherited from pcpp::SingleCommandTextProtocol | |
static bool | isDataValid (const uint8_t *data, size_t dataSize) |
Class for representing the request messages of FTP Layer
|
strong |
Enum for FTP command codes
|
inline |
A constructor that creates the layer from an existing packet raw data
[in] | data | A pointer to the raw data |
[in] | dataLen | Size of the data in bytes |
[in] | prevLayer | A pointer to the previous layer |
[in] | packet | A pointer to the Packet instance where layer will be stored in |
|
inline |
A constructor that creates layer with provided input values
[in] | command | FTP command |
[in] | option | Argument of the command |
FtpCommand pcpp::FtpRequestLayer::getCommand | ( | ) | const |
Get the command of request message
|
static |
Convert the command to readable string
[in] | code | Command code to convert |
|
static |
Convert the command info to readable string
[in] | code | Command code to convert |
std::string pcpp::FtpRequestLayer::getCommandOption | ( | bool | removeEscapeCharacters = true | ) | const |
Get the command argument of request message
[in] | removeEscapeCharacters | Whether non-alphanumerical characters should be removed or not |
std::string pcpp::FtpRequestLayer::getCommandString | ( | ) | const |
Get the command of request message as string
bool pcpp::FtpRequestLayer::setCommand | ( | FtpCommand | code | ) |
Set the command of request message
[in] | code | Value to set command |
bool pcpp::FtpRequestLayer::setCommandOption | ( | const std::string & | value | ) |
Set the command argument of request message
[in] | value | Value to set command argument |
|
virtual |
Implements pcpp::Layer.