suricata
|
#include "suricata.h"
#include "suricata-common.h"
#include "decode.h"
#include "threads.h"
#include "stream-tcp-private.h"
#include "stream-tcp-reassemble.h"
#include "stream-tcp.h"
#include "stream.h"
#include "app-layer.h"
#include "app-layer-detect-proto.h"
#include "app-layer-protos.h"
#include "app-layer-parser.h"
#include "app-layer-smtp.h"
#include "util-enum.h"
#include "util-mpm.h"
#include "util-debug.h"
#include "util-print.h"
#include "util-byte.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "util-memcmp.h"
#include "flow-util.h"
#include "detect-engine.h"
#include "detect-engine-state.h"
#include "detect-engine-build.h"
#include "detect-parse.h"
#include "decode-events.h"
#include "conf.h"
#include "util-mem.h"
#include "util-misc.h"
#include "util-validate.h"
#include "detect-engine-alert.h"
Go to the source code of this file.
Data Structures | |
struct | SMTPInput_ |
struct | SMTPLine_ |
struct | SMTPThreadCtx_ |
Typedefs | |
typedef struct SMTPInput_ | SMTPInput |
typedef struct SMTPLine_ | SMTPLine |
typedef struct SMTPThreadCtx_ | SMTPThreadCtx |
Functions | |
int | SMTPProcessDataChunk (const uint8_t *chunk, uint32_t len, MimeDecParseState *state) |
void * | SMTPStateAlloc (void *orig_state, AppProto proto_orig) |
void | RegisterSMTPParsers (void) |
Register the SMTP Protocol parser. More... | |
void | SMTPParserCleanup (void) |
Free memory allocated for global SMTP parser state. More... | |
void | SMTPParserRegisterTests (void) |
Variables | |
SCEnumCharMap | smtp_decoder_event_table [] |
SCEnumCharMap | smtp_reply_map [] |
SMTPConfig | smtp_config |
Definition in file app-layer-smtp.c.
#define FILEDATA_CONTENT_INSPECT_MIN_SIZE 32768 |
Definition at line 66 of file app-layer-smtp.c.
#define FILEDATA_CONTENT_INSPECT_WINDOW 4096 |
Definition at line 68 of file app-layer-smtp.c.
#define FILEDATA_CONTENT_LIMIT 100000 |
Definition at line 64 of file app-layer-smtp.c.
#define rawmsgname "rawmsg" |
Definition at line 1125 of file app-layer-smtp.c.
#define SMTP_COMMAND_BDAT 3 |
Definition at line 99 of file app-layer-smtp.c.
#define SMTP_COMMAND_BUFFER_STEPS 5 |
Definition at line 74 of file app-layer-smtp.c.
#define SMTP_COMMAND_DATA 2 |
Definition at line 98 of file app-layer-smtp.c.
#define SMTP_COMMAND_DATA_MODE 4 |
Definition at line 104 of file app-layer-smtp.c.
#define SMTP_COMMAND_OTHER_CMD 5 |
Definition at line 106 of file app-layer-smtp.c.
#define SMTP_COMMAND_RSET 6 |
Definition at line 107 of file app-layer-smtp.c.
#define SMTP_COMMAND_STARTTLS 1 |
Definition at line 97 of file app-layer-smtp.c.
#define SMTP_EHLO_EXTENSION_8BITMIME |
Definition at line 114 of file app-layer-smtp.c.
#define SMTP_EHLO_EXTENSION_DSN |
Definition at line 112 of file app-layer-smtp.c.
#define SMTP_EHLO_EXTENSION_PIPELINING |
Definition at line 110 of file app-layer-smtp.c.
#define SMTP_EHLO_EXTENSION_SIZE |
Definition at line 111 of file app-layer-smtp.c.
#define SMTP_EHLO_EXTENSION_STARTTLS |
Definition at line 113 of file app-layer-smtp.c.
#define SMTP_LINE_BUFFER_LIMIT 4096 |
Definition at line 116 of file app-layer-smtp.c.
#define SMTP_MAX_REQUEST_AND_REPLY_LINE_LENGTH 510 |
Definition at line 72 of file app-layer-smtp.c.
#define SMTP_MPM mpm_default_matcher |
Definition at line 174 of file app-layer-smtp.c.
#define SMTP_PARSER_STATE_COMMAND_DATA_MODE 0x01 |
Definition at line 81 of file app-layer-smtp.c.
#define SMTP_PARSER_STATE_COMMAND_MODE 0x00 |
Definition at line 78 of file app-layer-smtp.c.
#define SMTP_PARSER_STATE_FIRST_REPLY_SEEN 0x04 |
Definition at line 87 of file app-layer-smtp.c.
#define SMTP_PARSER_STATE_PARSING_MULTILINE_REPLY 0x08 |
Definition at line 89 of file app-layer-smtp.c.
#define SMTP_PARSER_STATE_PARSING_SERVER_RESPONSE 0x02 |
Definition at line 85 of file app-layer-smtp.c.
#define SMTP_PARSER_STATE_PIPELINING_SERVER 0x10 |
Definition at line 91 of file app-layer-smtp.c.
#define SMTP_RAW_EXTRACTION_DEFAULT_VALUE false |
Definition at line 71 of file app-layer-smtp.c.
typedef struct SMTPInput_ SMTPInput |
typedef struct SMTPThreadCtx_ SMTPThreadCtx |
enum SMTPCode |
Definition at line 179 of file app-layer-smtp.c.
void RegisterSMTPParsers | ( | void | ) |
Register the SMTP Protocol parser.
Definition at line 1731 of file app-layer-smtp.c.
References ALPROTO_SMTP, AppLayerProtoDetectConfProtoDetectionEnabled(), and AppLayerProtoDetectRegisterProtocol().
void SMTPParserCleanup | ( | void | ) |
Free memory allocated for global SMTP parser state.
Definition at line 1785 of file app-layer-smtp.c.
Referenced by AppLayerParserDeSetup().
void SMTPParserRegisterTests | ( | void | ) |
Definition at line 4118 of file app-layer-smtp.c.
References UtRegisterTest().
int SMTPProcessDataChunk | ( | const uint8_t * | chunk, |
uint32_t | len, | ||
MimeDecParseState * | state | ||
) |
Definition at line 486 of file app-layer-smtp.c.
References Flow_::alstate, MimeDecParseState::body_begin, SMTPConfig::content_inspect_min_size, MimeDecEntity::ctnt_flags, CTNT_IS_ATTACHMENT, MimeDecStackNode::data, MimeDecParseState::data, DEBUG_VALIDATE_BUG_ON, FILE_STORE, FILE_USE_DETECT, FileFlowToFlags(), MimeDecEntity::filename, MimeDecEntity::filename_len, SMTPTransaction_::files_ts, flags, len, MIME_DEC_OK, Flow_::protoctx, SC_FILENAME_MAX, SCEnter, SCLogDebug, SCLogDebugEnabled(), smtp_config, MimeDecParseState::stack, StreamTcpReassemblySetMinInspectDepth(), and MimeDecStack::top.
void* SMTPStateAlloc | ( | void * | orig_state, |
AppProto | proto_orig | ||
) |
Definition at line 1426 of file app-layer-smtp.c.
References SMTPState_::cmds, SMTPState_::cmds_buffer_len, SCFree, SCMalloc, SMTP_COMMAND_BUFFER_STEPS, TAILQ_INIT, and unlikely.
SMTPConfig smtp_config |
Definition at line 245 of file app-layer-smtp.c.
Referenced by SMTPProcessDataChunk().
SCEnumCharMap smtp_decoder_event_table[] |
Definition at line 137 of file app-layer-smtp.c.
SCEnumCharMap smtp_reply_map[] |
Definition at line 211 of file app-layer-smtp.c.