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

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 struct FtpLineState_ FtpLineState
 
typedef struct FTPString_ FTPString
 
typedef struct FTPTransaction_ FTPTransaction
 
typedef struct FtpState_ FtpState
 
typedef struct FtpDataState_ FtpDataState
 

Enumerations

enum  { FTP_STATE_IN_PROGRESS, FTP_STATE_PORT_DONE, FTP_STATE_FINISHED }
 
enum  FtpRequestCommand {
  FTP_COMMAND_UNKNOWN = 0, 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
}
 
enum  { FTPDATA_STATE_IN_PROGRESS, FTPDATA_STATE_FINISHED }
 

Functions

void RegisterFTPParsers (void)
 
void FTPParserRegisterTests (void)
 
void FTPParserCleanup (void)
 Free memory allocated for global FTP parser state. More...
 
int FTPSetMemcap (uint64_t size)
 
uint64_t FTPMemuseGlobalCounter (void)
 
uint64_t FTPMemcapGlobalCounter (void)
 
uint16_t JsonGetNextLineFromBuffer (const char *buffer, const uint16_t len)
 
bool EveFTPDataAddMetadata (void *vtx, JsonBuilder *jb)
 

Variables

const FtpCommand FtpCommands [FTP_COMMAND_MAX+1]
 

Detailed Description

Typedef Documentation

◆ FtpCommand

typedef struct FtpCommand_ FtpCommand

◆ FtpDataState

typedef struct FtpDataState_ FtpDataState

FTP Data State for app layer parser

◆ FtpLineState

typedef struct FtpLineState_ FtpLineState

used to hold the line state when we have fragmentation.

◆ FtpRequestCommandArgOfs

typedef uint32_t FtpRequestCommandArgOfs

Definition at line 99 of file app-layer-ftp.h.

◆ FtpState

typedef struct FtpState_ FtpState

FTP State for app layer parser

◆ FTPString

typedef struct FTPString_ FTPString

◆ FTPTransaction

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FTP_STATE_IN_PROGRESS 
FTP_STATE_PORT_DONE 
FTP_STATE_FINISHED 

Definition at line 30 of file app-layer-ftp.h.

◆ anonymous enum

anonymous enum
Enumerator
FTPDATA_STATE_IN_PROGRESS 
FTPDATA_STATE_FINISHED 

Definition at line 166 of file app-layer-ftp.h.

◆ 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 
Todo:
more if missing..

Definition at line 36 of file app-layer-ftp.h.

Function Documentation

◆ EveFTPDataAddMetadata()

bool EveFTPDataAddMetadata ( void *  vtx,
JsonBuilder *  jb 
)

◆ FTPMemcapGlobalCounter()

uint64_t FTPMemcapGlobalCounter ( void  )

Definition at line 171 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 165 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 1484 of file app-layer-ftp.c.

Referenced by AppLayerParserDeSetup().

Here is the caller graph for this function:

◆ FTPParserRegisterTests()

void FTPParserRegisterTests ( void  )

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

References UtRegisterTest().

Here is the call graph for this function:

◆ FTPSetMemcap()

int FTPSetMemcap ( uint64_t  size)

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

References SC_ATOMIC_GET, and SC_ATOMIC_SET.

◆ JsonGetNextLineFromBuffer()

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

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

References len.

Referenced by EveFTPLogCommand().

Here is the caller graph for this function:

◆ RegisterFTPParsers()

void RegisterFTPParsers ( void  )

FTP

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

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

Here is the call graph for this function:

Variable Documentation

◆ FtpCommands

const FtpCommand FtpCommands[FTP_COMMAND_MAX+1]

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