PcapPlusPlus
Next
|
#include <SmtpLayer.h>
Public Types | |
enum class | SmtpStatusCode : int { SYSTEM_STATUS = 211 , HELP_MESSAGE = 214 , SERVICE_READY = 220 , SERVICE_CLOSE = 221 , AUTH_SUCCESS = 235 , COMPLETED = 250 , WILL_FORWARD = 251 , CANNOT_VERIFY = 252 , AUTH_INPUT = 334 , MAIL_INPUT = 354 , SERVICE_UNAVAILABLE = 421 , PASS_NEEDED = 432 , MAILBOX_UNAVAILABLE_TEMP = 450 , ABORT_LOCAL_ERROR = 451 , INSUFFICIENT_STORAGE = 452 , TEMP_AUTH_FAILED = 454 , PARAM_NOT_ACCOMMODATED = 455 , CMD_NOT_RECOGNIZED = 500 , SYNTAX_ERROR_PARAM = 501 , CMD_NOT_IMPLEMENTED = 502 , CMD_BAD_SEQUENCE = 503 , PARAM_NOT_IMPLEMENTED = 504 , MAIL_NOT_ACCEPTED = 521 , ENCRYPT_NEED = 523 , AUTH_REQUIRED = 530 , AUTH_TOO_WEAK = 534 , AUTH_CRED_INVALID = 535 , ENCRYPT_REQUIRED = 538 , MAILBOX_UNAVAILABLE = 550 , USER_NOT_LOCAL = 551 , EXCEED_STORAGE = 552 , NAME_NOT_ALLOWED = 553 , TRANSACTION_FAIL = 554 , DOMAIN_NOT_ACCEPT = 556 } |
Public Member Functions | |
SmtpResponseLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
SmtpResponseLayer (const SmtpStatusCode &code, const std::string &option="") | |
bool | setStatusCode (SmtpStatusCode code) |
SmtpStatusCode | 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::SmtpLayer | |
void | parseNextLayer () override |
SMTP 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 | getStatusCodeAsString (SmtpStatusCode code) |
Static Public Member Functions inherited from pcpp::SmtpLayer | |
static bool | isSmtpPort (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 response messages of SMTP Layer
|
strong |
Enum for SMTP 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 |
SmtpStatusCode pcpp::SmtpResponseLayer::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::SmtpResponseLayer::getStatusCodeString | ( | ) | const |
Get the status code of response message as string
std::string pcpp::SmtpResponseLayer::getStatusOption | ( | bool | removeEscapeCharacters = true | ) | const |
Get the argument of response message
[in] | removeEscapeCharacters | Whether non-alphanumerical characters should be removed or not |
bool pcpp::SmtpResponseLayer::setStatusCode | ( | SmtpStatusCode | code | ) |
Set the status code of response message
[in] | code | Value to set status code |
bool pcpp::SmtpResponseLayer::setStatusOption | ( | const std::string & | value | ) |
Set the argument of response message
[in] | value | Value to set argument |
|
overridevirtual |
Implements pcpp::Layer.