|
PcapPlusPlus
Next
|
Class for representing the response messages of FTP Layer. More...
#include <FtpLayer.h>
Classes | |
| struct | SerializedFields |
Public Member Functions | |
| FtpResponseLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
| FtpResponseLayer (const FtpStatusCode &code, const std::string &option="") | |
| bool | setStatusCode (FtpStatusCode code) |
| FtpStatusCode | getStatusCode () const |
| std::string | getStatusCodeString () const |
| bool | setStatusOption (const std::string &value) |
| std::string | getStatusOption (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 |
| Copy the raw data of this layer to another array. More... | |
| size_t | copyData (uint8_t *dest, size_t destSize) const |
| Copy the raw data of this layer to another array, with a specified maximum size. More... | |
| void | serialize (ISerializer &serializer) const |
| uint8_t * | getDataPtr (size_t offset=0) const override |
Static Public Member Functions | |
| static std::string | getStatusCodeAsString (FtpStatusCode 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) |
Protected Member Functions | |
| void | serializeLayer (ObjectScope &serializer) const override |
Protected Member Functions inherited from pcpp::Layer | |
| Packet * | getAttachedPacket () |
| Get a pointer to the Packet this layer is attached to (if any). More... | |
| Packet const * | getAttachedPacket () const |
| Get a pointer to the Packet this layer is attached to (if any). More... | |
| void | allocData (size_t dataLen, bool zeroInit=true) |
| Requests the layer to allocate a new data buffer of the specified length. More... | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Construct the next layer in the protocol stack. No validation is performed on the data. More... | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename TFactory , typename... Args> | |
| Layer * | constructNextLayerFromFactory (TFactory factoryFn, uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Construct the next layer in the protocol stack using a factory functor. More... | |
| template<typename TFactory , typename... Args> | |
| Layer * | constructNextLayerFromFactory (TFactory factoryFn, uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| Construct the next layer in the protocol stack using a factory functor. More... | |
| template<typename T , typename... Args> | |
| Layer * | tryConstructNextLayer (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| template<typename T , typename... Args> | |
| Layer * | tryConstructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack with a fallback option. More... | |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename TFallback , typename TFactory , typename... Args> | |
| Layer * | tryConstructNextLayerFromFactoryWithFallback (TFactory factoryFn, uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack using a factory functor with a fallback option. More... | |
| template<typename TFallback , typename TFactory , typename... Args> | |
| Layer * | tryConstructNextLayerFromFactoryWithFallback (TFactory factoryFn, uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack using a factory functor with a fallback option. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from pcpp::Layer | |
| template<typename T > | |
| static bool | canReinterpretAs (const uint8_t *data, size_t dataLen) |
| Check if the data is large enough to reinterpret as a type. More... | |
Class for representing the response messages of FTP Layer.
|
strong |
Enum for FTP response 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] | code | Status code |
| [in] | option | Argument of the status code |
| FtpStatusCode pcpp::FtpResponseLayer::getStatusCode | ( | ) | const |
Get the status code of response message
|
static |
Convert the status code to readable string
| [in] | code | Status code to convert |
| std::string pcpp::FtpResponseLayer::getStatusCodeString | ( | ) | const |
Get the status code of response message as string
| std::string pcpp::FtpResponseLayer::getStatusOption | ( | bool | removeEscapeCharacters = true | ) | const |
Get the argument of response message
| [in] | removeEscapeCharacters | Whether non-alphanumerical characters should be removed or not |
|
overrideprotectedvirtual |
Serializes the layer's data into a provided serializer object. This is used for generating serialized representations (like JSON) of the packet layers. This method should be overridden by derived layers to provide specific serialization logic.
| [in] | serializer | The object scope serializer to which the layer details should be written. |
Reimplemented from pcpp::Layer.
| bool pcpp::FtpResponseLayer::setStatusCode | ( | FtpStatusCode | code | ) |
Set the status code of response message
| [in] | code | Value to set status code |
| bool pcpp::FtpResponseLayer::setStatusOption | ( | const std::string & | value | ) |
Set the argument of response message
| [in] | value | Value to set argument |
|
overridevirtual |
Implements pcpp::Layer.