suricata
|
Go to the source code of this file.
Data Structures | |
struct | FtpCommand_ |
struct | FtpLineState_ |
struct | FTPString_ |
struct | FTPTransaction_ |
struct | FtpState_ |
struct | FtpDataState_ |
Typedefs | |
typedef struct FtpCommand_ | FtpCommand |
typedef uint32_t | FtpRequestCommandArgOfs |
typedef uint16_t | FtpResponseCode |
typedef struct FtpLineState_ | FtpLineState |
typedef struct FTPString_ | FTPString |
typedef struct FTPTransaction_ | FTPTransaction |
typedef struct FtpState_ | FtpState |
typedef struct FtpDataState_ | FtpDataState |
Functions | |
void | RegisterFTPParsers (void) |
void | FTPParserRegisterTests (void) |
void | FTPAtExitPrintStats (void) |
void | FTPParserCleanup (void) |
Free memory allocated for global SMTP parser state. More... | |
uint64_t | FTPMemuseGlobalCounter (void) |
uint64_t | FTPMemcapGlobalCounter (void) |
uint16_t | JsonGetNextLineFromBuffer (const char *buffer, const uint16_t len) |
json_t * | JsonFTPDataAddMetadata (const Flow *f) |
Variables | |
const FtpCommand | FtpCommands [FTP_COMMAND_MAX+1] |
Definition in file app-layer-ftp.h.
typedef struct FtpCommand_ FtpCommand |
typedef struct FtpDataState_ FtpDataState |
FTP Data State for app layer parser
typedef struct FtpLineState_ FtpLineState |
used to hold the line state when we have fragmentation.
typedef uint32_t FtpRequestCommandArgOfs |
Definition at line 97 of file app-layer-ftp.h.
typedef uint16_t FtpResponseCode |
Definition at line 99 of file app-layer-ftp.h.
typedef struct FTPString_ FTPString |
typedef struct FTPTransaction_ FTPTransaction |
anonymous enum |
Enumerator | |
---|---|
FTP_STATE_IN_PROGRESS | |
FTP_STATE_PORT_DONE | |
FTP_STATE_FINISHED |
Definition at line 28 of file app-layer-ftp.h.
anonymous enum |
Enumerator | |
---|---|
FTP_FIELD_NONE | |
FTP_FIELD_REQUEST_LINE | |
FTP_FIELD_REQUEST_COMMAND | |
FTP_FIELD_REQUEST_ARGS | |
FTP_FIELD_RESPONSE_LINE | |
FTP_FIELD_REPONSE_CODE | |
FTP_FIELD_MAX |
Definition at line 101 of file app-layer-ftp.h.
anonymous enum |
Enumerator | |
---|---|
FTPDATA_STATE_IN_PROGRESS | |
FTPDATA_STATE_FINISHED |
Definition at line 196 of file app-layer-ftp.h.
enum FtpRequestCommand |
Enumerator | |
---|---|
FTP_COMMAND_UNKNOWN | |
FTP_COMMAND_ABOR | |
FTP_COMMAND_ACCT | |
FTP_COMMAND_ALLO | |
FTP_COMMAND_APPE | |
FTP_COMMAND_AUTH_TLS | |
FTP_COMMAND_CDUP | |
FTP_COMMAND_CHMOD | |
FTP_COMMAND_CWD | |
FTP_COMMAND_DELE | |
FTP_COMMAND_EPSV | |
FTP_COMMAND_HELP | |
FTP_COMMAND_IDLE | |
FTP_COMMAND_LIST | |
FTP_COMMAND_MAIL | |
FTP_COMMAND_MDTM | |
FTP_COMMAND_MKD | |
FTP_COMMAND_MLFL | |
FTP_COMMAND_MODE | |
FTP_COMMAND_MRCP | |
FTP_COMMAND_MRSQ | |
FTP_COMMAND_MSAM | |
FTP_COMMAND_MSND | |
FTP_COMMAND_MSOM | |
FTP_COMMAND_NLST | |
FTP_COMMAND_NOOP | |
FTP_COMMAND_PASS | |
FTP_COMMAND_PASV | |
FTP_COMMAND_PORT | |
FTP_COMMAND_PWD | |
FTP_COMMAND_QUIT | |
FTP_COMMAND_REIN | |
FTP_COMMAND_REST | |
FTP_COMMAND_RETR | |
FTP_COMMAND_RMD | |
FTP_COMMAND_RNFR | |
FTP_COMMAND_RNTO | |
FTP_COMMAND_SITE | |
FTP_COMMAND_SIZE | |
FTP_COMMAND_SMNT | |
FTP_COMMAND_STAT | |
FTP_COMMAND_STOR | |
FTP_COMMAND_STOU | |
FTP_COMMAND_STRU | |
FTP_COMMAND_SYST | |
FTP_COMMAND_TYPE | |
FTP_COMMAND_UMASK | |
FTP_COMMAND_USER | |
FTP_COMMAND_EPRT | |
FTP_COMMAND_MAX |
|
Definition at line 34 of file app-layer-ftp.h.
void FTPAtExitPrintStats | ( | void | ) |
Definition at line 1393 of file app-layer-ftp.c.
References SCLogDebug, SCMutexLock, and SCMutexUnlock.
uint64_t FTPMemcapGlobalCounter | ( | void | ) |
Definition at line 177 of file app-layer-ftp.c.
References FtpState_::current_line, FtpLineState_::current_line_db, FtpState_::current_line_delimiter_len, FtpState_::current_line_len, FtpLineState_::current_line_lf_seen, FtpLineState_::db, FtpLineState_::db_len, FTPTransaction_::de_state, MpmTableElmt_::DestroyThreadCtx, DetectEngineStateFree(), FtpState_::direction, ftp_config_memcap, FTP_MPM, FTPThreadCtx_::ftp_mpm_thread_ctx, FtpState_::input, FtpState_::input_len, FTPString_::len, FtpState_::line_state, mpm_table, MpmInitThreadCtx(), next, FTPThreadCtx_::pmq, PmqFree(), PmqReset(), PmqSetup(), FTPTransaction_::request, FTPTransaction_::request_length, PrefilterRuleStore_::rule_id_array, SC_ATOMIC_ADD, SC_ATOMIC_GET, SCCalloc, SCEnter, SCFree, SCLogDebug, SCMalloc, SCRealloc, SCReturnInt, MpmTableElmt_::Search, FTPString_::str, str, TAILQ_FIRST, TAILQ_INIT, TAILQ_INSERT_TAIL, TAILQ_REMOVE, FtpState_::tx_cnt, FTPTransaction_::tx_id, and unlikely.
Referenced by AppLayerRegisterGlobalCounters().
uint64_t FTPMemuseGlobalCounter | ( | void | ) |
Definition at line 171 of file app-layer-ftp.c.
References SC_ATOMIC_GET.
Referenced by AppLayerRegisterGlobalCounters().
void FTPParserCleanup | ( | void | ) |
Free memory allocated for global SMTP parser state.
Definition at line 1462 of file app-layer-ftp.c.
References Flow_::alproto, ALPROTO_FTP, Flow_::alstate, AppLayerParserParse(), AppLayerParserThreadCtxAlloc(), AppLayerParserThreadCtxFree(), FtpState_::command, FLOW_DESTROY, FLOW_INITIALIZE, FLOWLOCK_UNLOCK, FLOWLOCK_WRLOCK, FTP_COMMAND_PORT, FTP_COMMAND_RETR, FTP_COMMAND_STOR, FTP_COMMAND_UNKNOWN, Flow_::proto, Flow_::protoctx, SCLogDebug, STREAM_EOF, STREAM_START, STREAM_TOCLIENT, STREAM_TOSERVER, StreamTcpFreeConfig(), StreamTcpInitConfig(), and TRUE.
Referenced by AppLayerParserDeSetup().
void FTPParserRegisterTests | ( | void | ) |
Definition at line 1944 of file app-layer-ftp.c.
References UtRegisterTest().
Referenced by RegisterFTPParsers().
json_t* JsonFTPDataAddMetadata | ( | const Flow * | f | ) |
Definition at line 1431 of file app-layer-ftp.c.
References Flow_::alstate, BytesToStringBuffer(), FtpDataState_::command, FtpDataState_::file_len, FtpDataState_::file_name, FTP_COMMAND_RETR, FTP_COMMAND_STOR, and SCJsonString().
Referenced by AlertJsonHeader().
uint16_t JsonGetNextLineFromBuffer | ( | const char * | buffer, |
const uint16_t | len | ||
) |
Definition at line 1421 of file app-layer-ftp.c.
void RegisterFTPParsers | ( | void | ) |
FTP
Definition at line 1307 of file app-layer-ftp.c.
References ALPROTO_FTP, ALPROTO_FTPDATA, AppLayerParserConfParserEnabled(), AppLayerParserRegisterDetectFlagsFuncs(), AppLayerParserRegisterDetectStateFuncs(), AppLayerParserRegisterGetFilesFunc(), AppLayerParserRegisterGetStateProgressCompletionStatus(), AppLayerParserRegisterGetStateProgressFunc(), AppLayerParserRegisterGetTx(), AppLayerParserRegisterGetTxCnt(), AppLayerParserRegisterLocalStorageFunc(), AppLayerParserRegisterLoggerFuncs(), AppLayerParserRegisterParser(), AppLayerParserRegisterParserAcceptableDataDirection(), AppLayerParserRegisterProtocolUnittests(), AppLayerParserRegisterStateFuncs(), AppLayerParserRegisterTxFreeFunc(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectRegisterProtocol(), AppLayerRegisterExpectationProto(), StreamingBufferConfig_::buf_size, StreamingBufferConfig_::Calloc, StreamingBufferConfig_::Free, FTPParserRegisterTests(), StreamingBufferConfig_::Malloc, StreamingBufferConfig_::Realloc, SCLogInfo, STREAM_TOCLIENT, and STREAM_TOSERVER.
Referenced by AppLayerParserRegisterProtocolParsers(), and GetProgramVersion().
const FtpCommand FtpCommands[FTP_COMMAND_MAX+1] |
Definition at line 75 of file app-layer-ftp.c.