PcapPlusPlus
Next
|
#include <FtpLayer.h>
Public Types | |
enum class | FtpCommand : int { UNK , ABOR = ('A') | ('B' << 8) | ('O' << 16) | ('R' << 24) , ACCT = ('A') | ('C' << 8) | ('C' << 16) | ('T' << 24) , ADAT = ('A') | ('D' << 8) | ('A' << 16) | ('T' << 24) , ALLO = ('A') | ('L' << 8) | ('L' << 16) | ('O' << 24) , APPE = ('A') | ('P' << 8) | ('P' << 16) | ('E' << 24) , AUTH = ('A') | ('U' << 8) | ('T' << 16) | ('H' << 24) , AVBL = ('A') | ('V' << 8) | ('B' << 16) | ('L' << 24) , CCC = ('C') | ('C' << 8) | ('C' << 16) , CDUP = ('C') | ('D' << 8) | ('U' << 16) | ('P' << 24) , CONF = ('C') | ('O' << 8) | ('N' << 16) | ('F' << 24) , CSID = ('C') | ('S' << 8) | ('I' << 16) | ('D' << 24) , CWD = ('C') | ('W' << 8) | ('D' << 16) , DELE = ('D') | ('E' << 8) | ('L' << 16) | ('E' << 24) , DSIZ = ('D') | ('S' << 8) | ('I' << 16) | ('Z' << 24) , ENC = ('E') | ('N' << 8) | ('C' << 16) , EPRT = ('E') | ('P' << 8) | ('R' << 16) | ('T' << 24) , EPSV = ('E') | ('P' << 8) | ('S' << 16) | ('V' << 24) , FEAT = ('F') | ('E' << 8) | ('A' << 16) | ('T' << 24) , HELP = ('H') | ('E' << 8) | ('L' << 16) | ('P' << 24) , HOST = ('H') | ('O' << 8) | ('S' << 16) | ('T' << 24) , LANG = ('L') | ('A' << 8) | ('N' << 16) | ('G' << 24) , LIST = ('L') | ('I' << 8) | ('S' << 16) | ('T' << 24) , LPRT = ('L') | ('P' << 8) | ('R' << 16) | ('T' << 24) , LPSV = ('L') | ('P' << 8) | ('S' << 16) | ('V' << 24) , MDTM = ('M') | ('D' << 8) | ('T' << 16) | ('M' << 24) , MFCT = ('M') | ('F' << 8) | ('C' << 16) | ('T' << 24) , MFF = ('M') | ('F' << 8) | ('F' << 16) , MFMT = ('M') | ('F' << 8) | ('M' << 16) | ('T' << 24) , MIC = ('M') | ('I' << 8) | ('C' << 16) , MKD = ('M') | ('K' << 8) | ('D' << 16) , MLSD = ('M') | ('L' << 8) | ('S' << 16) | ('D' << 24) , MLST = ('M') | ('L' << 8) | ('S' << 16) | ('T' << 24) , MODE = ('M') | ('O' << 8) | ('D' << 16) | ('E' << 24) , NLST = ('N') | ('L' << 8) | ('S' << 16) | ('T' << 24) , NOOP = ('N') | ('O' << 8) | ('O' << 16) | ('P' << 24) , OPTS = ('O') | ('P' << 8) | ('T' << 16) | ('S' << 24) , PASS = ('P') | ('A' << 8) | ('S' << 16) | ('S' << 24) , PASV = ('P') | ('A' << 8) | ('S' << 16) | ('V' << 24) , PBSZ = ('P') | ('B' << 8) | ('S' << 16) | ('Z' << 24) , PORT = ('P') | ('O' << 8) | ('R' << 16) | ('T' << 24) , PROT = ('P') | ('R' << 8) | ('O' << 16) | ('T' << 24) , PWD = ('P') | ('W' << 8) | ('D' << 16) , QUIT = ('Q') | ('U' << 8) | ('I' << 16) | ('T' << 24) , REIN = ('R') | ('E' << 8) | ('I' << 16) | ('N' << 24) , REST = ('R') | ('E' << 8) | ('S' << 16) | ('T' << 24) , RETR = ('R') | ('E' << 8) | ('T' << 16) | ('R' << 24) , RMD = ('R') | ('M' << 8) | ('D' << 16) , RMDA = ('R') | ('M' << 8) | ('D' << 16) | ('A' << 24) , RNFR = ('R') | ('N' << 8) | ('F' << 16) | ('R' << 24) , RNTO = ('R') | ('N' << 8) | ('T' << 16) | ('O' << 24) , SITE = ('S') | ('I' << 8) | ('T' << 16) | ('E' << 24) , SIZE = ('S') | ('I' << 8) | ('Z' << 16) | ('E' << 24) , SMNT = ('S') | ('M' << 8) | ('N' << 16) | ('T' << 24) , SPSV = ('S') | ('P' << 8) | ('S' << 16) | ('V' << 24) , STAT = ('S') | ('T' << 8) | ('A' << 16) | ('T' << 24) , STOR = ('S') | ('T' << 8) | ('O' << 16) | ('R' << 24) , STOU = ('S') | ('T' << 8) | ('O' << 16) | ('U' << 24) , STRU = ('S') | ('T' << 8) | ('R' << 16) | ('U' << 24) , SYST = ('S') | ('Y' << 8) | ('S' << 16) | ('T' << 24) , THMB = ('T') | ('H' << 8) | ('M' << 16) | ('B' << 24) , TYPE = ('T') | ('Y' << 8) | ('P' << 16) | ('E' << 24) , USER = ('U') | ('S' << 8) | ('E' << 16) | ('R' << 24) , XCUP = ('X') | ('C' << 8) | ('U' << 16) | ('P' << 24) , XMKD = ('X') | ('M' << 8) | ('K' << 16) | ('D' << 24) , XPWD = ('X') | ('P' << 8) | ('W' << 16) | ('D' << 24) , XRCP = ('X') | ('R' << 8) | ('C' << 16) | ('P' << 24) , XRMD = ('X') | ('R' << 8) | ('M' << 16) | ('D' << 24) , XRSQ = ('X') | ('R' << 8) | ('S' << 16) | ('Q' << 24) , XSEM = ('X') | ('S' << 8) | ('E' << 16) | ('M' << 24) , 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 override |
Public Member Functions inherited from pcpp::FtpLayer | |
void | parseNextLayer () override |
FTP is the always last so does nothing for this layer. | |
size_t | getHeaderLen () const override |
void | computeCalculateFields () override |
Does nothing for this layer. | |
OsiModelLayer | getOsiModelLayer () const override |
Public Member Functions inherited from pcpp::SingleCommandTextProtocol | |
bool | isMultiLine () const |
Public Member Functions inherited from pcpp::Layer | |
~Layer () override | |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () const |
bool | isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) 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 override |
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 bool | isFtpDataPort (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 |
|
inlineexplicit |
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 |
|
overridevirtual |
Implements pcpp::Layer.