suricata
app-layer-ftp.c File Reference
#include "suricata-common.h"
#include "debug.h"
#include "decode.h"
#include "threads.h"
#include "util-print.h"
#include "util-pool.h"
#include "flow-util.h"
#include "flow-storage.h"
#include "detect-engine-state.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-protos.h"
#include "app-layer-parser.h"
#include "app-layer-ftp.h"
#include "app-layer-expectation.h"
#include "util-spm.h"
#include "util-mpm.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "util-memcmp.h"
#include "util-memrchr.h"
#include "util-mem.h"
#include "util-misc.h"
#include "output-json.h"
#include "rust.h"
Include dependency graph for app-layer-ftp.c:

Go to the source code of this file.

Data Structures

struct  FTPThreadCtx_
 
struct  FtpTransferCmd
 

Macros

#define FTP_MPM   mpm_default_matcher
 

Typedefs

typedef struct FTPThreadCtx_ FTPThreadCtx
 

Functions

 SC_ATOMIC_DECLARE (uint64_t, ftp_memuse)
 
 SC_ATOMIC_DECLARE (uint64_t, ftp_memcap)
 
uint64_t FTPMemuseGlobalCounter (void)
 
uint64_t FTPMemcapGlobalCounter (void)
 
void RegisterFTPParsers (void)
 
void FTPAtExitPrintStats (void)
 
uint16_t JsonGetNextLineFromBuffer (const char *buffer, const uint16_t len)
 
void EveFTPDataAddMetadata (const Flow *f, JsonBuilder *jb)
 
void FTPParserCleanup (void)
 Free memory allocated for global FTP parser state. More...
 
void FTPParserRegisterTests (void)
 

Variables

const FtpCommand FtpCommands [FTP_COMMAND_MAX+1]
 
uint64_t ftp_config_memcap = 0
 

Detailed Description

Macro Definition Documentation

◆ FTP_MPM

#define FTP_MPM   mpm_default_matcher

Definition at line 70 of file app-layer-ftp.c.

Typedef Documentation

◆ FTPThreadCtx

typedef struct FTPThreadCtx_ FTPThreadCtx

Function Documentation

◆ EveFTPDataAddMetadata()

void EveFTPDataAddMetadata ( const Flow f,
JsonBuilder *  jb 
)

◆ FTPAtExitPrintStats()

void FTPAtExitPrintStats ( void  )

Definition at line 1368 of file app-layer-ftp.c.

References SCLogDebug, SCMutexLock, and SCMutexUnlock.

◆ FTPMemcapGlobalCounter()

uint64_t FTPMemcapGlobalCounter ( void  )

Definition at line 175 of file app-layer-ftp.c.

References SC_ATOMIC_GET.

Referenced by AppLayerRegisterGlobalCounters().

Here is the caller graph for this function:

◆ FTPMemuseGlobalCounter()

uint64_t FTPMemuseGlobalCounter ( void  )

Definition at line 169 of file app-layer-ftp.c.

References SC_ATOMIC_GET.

Referenced by AppLayerRegisterGlobalCounters().

Here is the caller graph for this function:

◆ FTPParserCleanup()

void FTPParserCleanup ( void  )

Free memory allocated for global FTP parser state.

Definition at line 1432 of file app-layer-ftp.c.

Referenced by AppLayerParserDeSetup().

Here is the caller graph for this function:

◆ FTPParserRegisterTests()

void FTPParserRegisterTests ( void  )

Definition at line 1914 of file app-layer-ftp.c.

References UtRegisterTest().

Here is the call graph for this function:

◆ JsonGetNextLineFromBuffer()

uint16_t JsonGetNextLineFromBuffer ( const char *  buffer,
const uint16_t  len 
)

Definition at line 1396 of file app-layer-ftp.c.

References len.

◆ RegisterFTPParsers()

void RegisterFTPParsers ( void  )

FTP

Definition at line 1287 of file app-layer-ftp.c.

References ALPROTO_FTP, AppLayerProtoDetectConfProtoDetectionEnabled(), and AppLayerProtoDetectRegisterProtocol().

Referenced by AppLayerParserRegisterProtocolParsers().

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

◆ SC_ATOMIC_DECLARE() [1/2]

SC_ATOMIC_DECLARE ( uint64_t  ,
ftp_memcap   
)

◆ SC_ATOMIC_DECLARE() [2/2]

SC_ATOMIC_DECLARE ( uint64_t  ,
ftp_memuse   
)

Variable Documentation

◆ ftp_config_memcap

uint64_t ftp_config_memcap = 0

Definition at line 127 of file app-layer-ftp.c.

◆ FtpCommands

const FtpCommand FtpCommands[FTP_COMMAND_MAX+1]

Definition at line 73 of file app-layer-ftp.c.