suricata
app-layer-smtp.h File Reference
#include "app-layer-frames.h"
#include "util-streaming-buffer.h"
#include "rust.h"
Include dependency graph for app-layer-smtp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SMTPString_
 
struct  SMTPTransaction_
 
struct  SMTPConfig
 Structure for containing configuration options. More...
 
struct  SMTPState_
 

Macros

#define SMTP_LINE_BUFFER_LIMIT   4096
 

Typedefs

typedef struct SMTPString_ SMTPString
 
typedef struct SMTPTransaction_ SMTPTransaction
 
typedef struct SMTPConfig SMTPConfig
 Structure for containing configuration options.
 
typedef struct SMTPState_ SMTPState
 

Enumerations

enum  {
  SMTP_DECODER_EVENT_INVALID_REPLY , SMTP_DECODER_EVENT_UNABLE_TO_MATCH_REPLY_WITH_REQUEST , SMTP_DECODER_EVENT_MAX_COMMAND_LINE_LEN_EXCEEDED , SMTP_DECODER_EVENT_MAX_REPLY_LINE_LEN_EXCEEDED ,
  SMTP_DECODER_EVENT_INVALID_PIPELINED_SEQUENCE , SMTP_DECODER_EVENT_BDAT_CHUNK_LEN_EXCEEDED , SMTP_DECODER_EVENT_NO_SERVER_WELCOME_MESSAGE , SMTP_DECODER_EVENT_TLS_REJECTED ,
  SMTP_DECODER_EVENT_DATA_COMMAND_REJECTED , SMTP_DECODER_EVENT_FAILED_PROTOCOL_CHANGE , SMTP_DECODER_EVENT_MIME_PARSE_FAILED , SMTP_DECODER_EVENT_MIME_MALFORMED_MSG ,
  SMTP_DECODER_EVENT_MIME_INVALID_BASE64 , SMTP_DECODER_EVENT_MIME_INVALID_QP , SMTP_DECODER_EVENT_MIME_LONG_LINE , SMTP_DECODER_EVENT_MIME_LONG_ENC_LINE ,
  SMTP_DECODER_EVENT_MIME_LONG_HEADER_NAME , SMTP_DECODER_EVENT_MIME_LONG_HEADER_VALUE , SMTP_DECODER_EVENT_MIME_BOUNDARY_TOO_LONG , SMTP_DECODER_EVENT_MIME_LONG_FILENAME ,
  SMTP_DECODER_EVENT_DUPLICATE_FIELDS , SMTP_DECODER_EVENT_UNPARSABLE_CONTENT , SMTP_DECODER_EVENT_TRUNCATED_LINE
}
 

Functions

void * SMTPStateAlloc (void *orig_state, AppProto proto_orig)
 
void RegisterSMTPParsers (void)
 Register the SMTP Protocol parser.
 
void SMTPParserCleanup (void)
 Free memory allocated for global SMTP parser state.
 
void SMTPParserRegisterTests (void)
 

Variables

SMTPConfig smtp_config
 

Detailed Description

Macro Definition Documentation

◆ SMTP_LINE_BUFFER_LIMIT

#define SMTP_LINE_BUFFER_LIMIT   4096

Definition at line 32 of file app-layer-smtp.h.

Typedef Documentation

◆ SMTPConfig

typedef struct SMTPConfig SMTPConfig

Structure for containing configuration options.

◆ SMTPState

typedef struct SMTPState_ SMTPState

◆ SMTPString

typedef struct SMTPString_ SMTPString

◆ SMTPTransaction

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SMTP_DECODER_EVENT_INVALID_REPLY 
SMTP_DECODER_EVENT_UNABLE_TO_MATCH_REPLY_WITH_REQUEST 
SMTP_DECODER_EVENT_MAX_COMMAND_LINE_LEN_EXCEEDED 
SMTP_DECODER_EVENT_MAX_REPLY_LINE_LEN_EXCEEDED 
SMTP_DECODER_EVENT_INVALID_PIPELINED_SEQUENCE 
SMTP_DECODER_EVENT_BDAT_CHUNK_LEN_EXCEEDED 
SMTP_DECODER_EVENT_NO_SERVER_WELCOME_MESSAGE 
SMTP_DECODER_EVENT_TLS_REJECTED 
SMTP_DECODER_EVENT_DATA_COMMAND_REJECTED 
SMTP_DECODER_EVENT_FAILED_PROTOCOL_CHANGE 
SMTP_DECODER_EVENT_MIME_PARSE_FAILED 
SMTP_DECODER_EVENT_MIME_MALFORMED_MSG 
SMTP_DECODER_EVENT_MIME_INVALID_BASE64 
SMTP_DECODER_EVENT_MIME_INVALID_QP 
SMTP_DECODER_EVENT_MIME_LONG_LINE 
SMTP_DECODER_EVENT_MIME_LONG_ENC_LINE 
SMTP_DECODER_EVENT_MIME_LONG_HEADER_NAME 
SMTP_DECODER_EVENT_MIME_LONG_HEADER_VALUE 
SMTP_DECODER_EVENT_MIME_BOUNDARY_TOO_LONG 
SMTP_DECODER_EVENT_MIME_LONG_FILENAME 
SMTP_DECODER_EVENT_DUPLICATE_FIELDS 
SMTP_DECODER_EVENT_UNPARSABLE_CONTENT 
SMTP_DECODER_EVENT_TRUNCATED_LINE 

Definition at line 34 of file app-layer-smtp.h.

Function Documentation

◆ RegisterSMTPParsers()

◆ SMTPParserCleanup()

void SMTPParserCleanup ( void  )

Free memory allocated for global SMTP parser state.

Definition at line 1915 of file app-layer-smtp.c.

Referenced by AppLayerParserDeSetup().

Here is the caller graph for this function:

◆ SMTPParserRegisterTests()

void SMTPParserRegisterTests ( void  )

Definition at line 4245 of file app-layer-smtp.c.

References UtRegisterTest().

Referenced by RegisterSMTPParsers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SMTPStateAlloc()

void * SMTPStateAlloc ( void *  orig_state,
AppProto  proto_orig 
)

Definition at line 1496 of file app-layer-smtp.c.

References SMTPState_::cmds, SMTPState_::cmds_buffer_len, SCCalloc, SCFree, SCMalloc, SMTP_COMMAND_BUFFER_STEPS, TAILQ_INIT, and unlikely.

Referenced by RegisterSMTPParsers().

Here is the caller graph for this function:

Variable Documentation

◆ smtp_config

SMTPConfig smtp_config
extern

Definition at line 293 of file app-layer-smtp.c.