suricata
app-layer-parser.h File Reference
#include "app-layer-events.h"
#include "detect-engine-state.h"
#include "util-file.h"
#include "stream-tcp-private.h"
Include dependency graph for app-layer-parser.h:

Go to the source code of this file.

Data Structures

struct  AppLayerGetTxIterTuple
 
struct  AppLayerGetTxIterState
 

Macros

#define APP_LAYER_PARSER_EOF   BIT_U8(0)
 
#define APP_LAYER_PARSER_NO_INSPECTION   BIT_U8(1)
 
#define APP_LAYER_PARSER_NO_REASSEMBLY   BIT_U8(2)
 
#define APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD   BIT_U8(3)
 
#define APP_LAYER_PARSER_BYPASS_READY   BIT_U8(4)
 
#define APP_LAYER_PARSER_OPT_ACCEPT_GAPS   BIT_U32(0)
 
#define APP_LAYER_PARSER_INT_STREAM_DEPTH_SET   BIT_U32(0)
 
#define APP_LAYER_TX_INSPECTED_FLAG   BIT_U64(63)
 
#define APP_LAYER_TX_PREFILTER_MASK   ~APP_LAYER_TX_INSPECTED_FLAG
 

Typedefs

typedef struct AppLayerParserThreadCtx_ AppLayerParserThreadCtx
 
typedef int(* AppLayerParserFPtr) (Flow *f, void *protocol_state, AppLayerParserState *pstate, const uint8_t *buf, uint32_t buf_len, void *local_storage, const uint8_t flags)
 Prototype for parsing functions. More...
 
typedef struct AppLayerGetTxIterTuple AppLayerGetTxIterTuple
 
typedef struct AppLayerGetTxIterState AppLayerGetTxIterState
 
typedef AppLayerGetTxIterTuple(* AppLayerGetTxIteratorFunc) (const uint8_t ipproto, const AppProto alproto, void *alstate, uint64_t min_tx_id, uint64_t max_tx_id, AppLayerGetTxIterState *state)
 tx iterator prototype More...
 

Functions

int AppLayerParserProtoIsRegistered (uint8_t ipproto, AppProto alproto)
 
int AppLayerParserSetup (void)
 
void AppLayerParserPostStreamSetup (void)
 
int AppLayerParserDeSetup (void)
 
AppLayerParserThreadCtxAppLayerParserThreadCtxAlloc (void)
 Gets a new app layer protocol's parser thread context. More...
 
void AppLayerParserThreadCtxFree (AppLayerParserThreadCtx *tctx)
 Destroys the app layer parser thread context obtained using AppLayerParserThreadCtxAlloc(). More...
 
int AppLayerParserConfParserEnabled (const char *ipproto, const char *alproto_name)
 Given a protocol name, checks if the parser is enabled in the conf file. More...
 
int AppLayerParserRegisterParser (uint8_t ipproto, AppProto alproto, uint8_t direction, AppLayerParserFPtr Parser)
 Register app layer parser for the protocol. More...
 
void AppLayerParserRegisterParserAcceptableDataDirection (uint8_t ipproto, AppProto alproto, uint8_t direction)
 
void AppLayerParserRegisterOptionFlags (uint8_t ipproto, AppProto alproto, uint32_t flags)
 
void AppLayerParserRegisterStateFuncs (uint8_t ipproto, AppProto alproto, void *(*StateAlloc)(void), void(*StateFree)(void *))
 
void AppLayerParserRegisterLocalStorageFunc (uint8_t ipproto, AppProto proto, void *(*LocalStorageAlloc)(void), void(*LocalStorageFree)(void *))
 
void AppLayerParserRegisterGetFilesFunc (uint8_t ipproto, AppProto alproto, FileContainer *(*StateGetFiles)(void *, uint8_t))
 
void AppLayerParserRegisterGetEventsFunc (uint8_t ipproto, AppProto proto, AppLayerDecoderEvents *(*StateGetEvents)(void *) __attribute__((nonnull)))
 
void AppLayerParserRegisterLoggerFuncs (uint8_t ipproto, AppProto alproto, LoggerId(*StateGetTxLogged)(void *, void *), void(*StateSetTxLogged)(void *, void *, LoggerId))
 
void AppLayerParserRegisterLogger (uint8_t ipproto, AppProto alproto)
 
void AppLayerParserRegisterLoggerBits (uint8_t ipproto, AppProto alproto, LoggerId bits)
 
void AppLayerParserRegisterTruncateFunc (uint8_t ipproto, AppProto alproto, void(*Truncate)(void *, uint8_t))
 
void AppLayerParserRegisterGetStateProgressFunc (uint8_t ipproto, AppProto alproto, int(*StateGetStateProgress)(void *alstate, uint8_t direction))
 
void AppLayerParserRegisterTxFreeFunc (uint8_t ipproto, AppProto alproto, void(*StateTransactionFree)(void *, uint64_t))
 
void AppLayerParserRegisterGetTxCnt (uint8_t ipproto, AppProto alproto, uint64_t(*StateGetTxCnt)(void *alstate))
 
void AppLayerParserRegisterGetTx (uint8_t ipproto, AppProto alproto, void *(StateGetTx)(void *alstate, uint64_t tx_id))
 
void AppLayerParserRegisterGetTxIterator (uint8_t ipproto, AppProto alproto, AppLayerGetTxIteratorFunc Func)
 
void AppLayerParserRegisterGetStateProgressCompletionStatus (AppProto alproto, int(*StateGetStateProgressCompletionStatus)(uint8_t direction))
 
void AppLayerParserRegisterGetEventInfo (uint8_t ipproto, AppProto alproto, int(*StateGetEventInfo)(const char *event_name, int *event_id, AppLayerEventType *event_type))
 
void AppLayerParserRegisterGetEventInfoById (uint8_t ipproto, AppProto alproto, int(*StateGetEventInfoById)(int event_id, const char **event_name, AppLayerEventType *event_type))
 
void AppLayerParserRegisterDetectStateFuncs (uint8_t ipproto, AppProto alproto, DetectEngineState *(*GetTxDetectState)(void *tx), int(*SetTxDetectState)(void *tx, DetectEngineState *))
 
void AppLayerParserRegisterGetStreamDepth (uint8_t ipproto, AppProto alproto, uint32_t(*GetStreamDepth)(void))
 
void AppLayerParserRegisterMpmIDsFuncs (uint8_t ipproto, AppProto alproto, uint64_t(*GetTxMpmIDs)(void *tx), int(*SetTxMpmIDs)(void *tx, uint64_t))
 
void AppLayerParserRegisterDetectFlagsFuncs (uint8_t ipproto, AppProto alproto, uint64_t(*GetTxDetectFlags)(void *tx, uint8_t dir), void(*SetTxDetectFlags)(void *tx, uint8_t dir, uint64_t))
 
void AppLayerParserRegisterSetStreamDepthFlag (uint8_t ipproto, AppProto alproto, void(*SetStreamDepthFlag)(void *tx, uint8_t flags))
 
AppLayerGetTxIteratorFunc AppLayerGetTxIterator (const uint8_t ipproto, const AppProto alproto)
 
void * AppLayerParserGetProtocolParserLocalStorage (uint8_t ipproto, AppProto alproto)
 
void AppLayerParserDestroyProtocolParserLocalStorage (uint8_t ipproto, AppProto alproto, void *local_data)
 
uint64_t AppLayerParserGetTransactionLogId (AppLayerParserState *pstate)
 
void AppLayerParserSetTransactionLogId (AppLayerParserState *pstate, uint64_t tx_id)
 
void AppLayerParserSetTxLogged (uint8_t ipproto, AppProto alproto, void *alstate, void *tx, LoggerId logged)
 
LoggerId AppLayerParserGetTxLogged (const Flow *f, void *alstate, void *tx)
 
uint64_t AppLayerParserGetTransactionInspectId (AppLayerParserState *pstate, uint8_t direction)
 
void AppLayerParserSetTransactionInspectId (const Flow *f, AppLayerParserState *pstate, void *alstate, const uint8_t flags, bool tag_txs_as_inspected)
 
AppLayerDecoderEventsAppLayerParserGetDecoderEvents (AppLayerParserState *pstate)
 
void AppLayerParserSetDecoderEvents (AppLayerParserState *pstate, AppLayerDecoderEvents *devents)
 
AppLayerDecoderEventsAppLayerParserGetEventsByTx (uint8_t ipproto, AppProto alproto, void *tx)
 
FileContainerAppLayerParserGetFiles (uint8_t ipproto, AppProto alproto, void *alstate, uint8_t direction)
 
int AppLayerParserGetStateProgress (uint8_t ipproto, AppProto alproto, void *alstate, uint8_t direction)
 get the progress value for a tx/protocol More...
 
uint64_t AppLayerParserGetTxCnt (const Flow *, void *alstate)
 
void * AppLayerParserGetTx (uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
 
int AppLayerParserGetStateProgressCompletionStatus (AppProto alproto, uint8_t direction)
 
int AppLayerParserGetEventInfo (uint8_t ipproto, AppProto alproto, const char *event_name, int *event_id, AppLayerEventType *event_type)
 
int AppLayerParserGetEventInfoById (uint8_t ipproto, AppProto alproto, int event_id, const char **event_name, AppLayerEventType *event_type)
 
uint64_t AppLayerParserGetTransactionActive (const Flow *f, AppLayerParserState *pstate, uint8_t direction)
 
uint8_t AppLayerParserGetFirstDataDir (uint8_t ipproto, AppProto alproto)
 
int AppLayerParserSupportsFiles (uint8_t ipproto, AppProto alproto)
 
int AppLayerParserSupportsTxDetectState (uint8_t ipproto, AppProto alproto)
 
int AppLayerParserHasTxDetectState (uint8_t ipproto, AppProto alproto, void *alstate)
 
DetectEngineStateAppLayerParserGetTxDetectState (uint8_t ipproto, AppProto alproto, void *tx)
 
int AppLayerParserSetTxDetectState (const Flow *f, void *tx, DetectEngineState *s)
 
uint64_t AppLayerParserGetTxDetectFlags (uint8_t ipproto, AppProto alproto, void *tx, uint8_t dir)
 
void AppLayerParserSetTxDetectFlags (uint8_t ipproto, AppProto alproto, void *tx, uint8_t dir, uint64_t)
 
bool AppLayerParserSupportsTxDetectFlags (AppProto alproto)
 
int AppLayerParserParse (ThreadVars *tv, AppLayerParserThreadCtx *tctx, Flow *f, AppProto alproto, uint8_t flags, const uint8_t *input, uint32_t input_len)
 
void AppLayerParserSetEOF (AppLayerParserState *pstate)
 
bool AppLayerParserHasDecoderEvents (AppLayerParserState *pstate)
 
int AppLayerParserIsTxAware (AppProto alproto)
 simpler way to globally test if a alproto is registered and fully enabled in the configuration. More...
 
int AppLayerParserProtocolIsTxEventAware (uint8_t ipproto, AppProto alproto)
 
int AppLayerParserProtocolHasLogger (uint8_t ipproto, AppProto alproto)
 
LoggerId AppLayerParserProtocolGetLoggerBits (uint8_t ipproto, AppProto alproto)
 
void AppLayerParserTriggerRawStreamReassembly (Flow *f, int direction)
 
void AppLayerParserSetStreamDepth (uint8_t ipproto, AppProto alproto, uint32_t stream_depth)
 
uint32_t AppLayerParserGetStreamDepth (const Flow *f)
 
void AppLayerParserSetStreamDepthFlag (uint8_t ipproto, AppProto alproto, void *state, uint64_t tx_id, uint8_t flags)
 
void AppLayerParserStateCleanup (const Flow *f, void *alstate, AppLayerParserState *pstate)
 
void AppLayerParserRegisterProtocolParsers (void)
 
void AppLayerParserStateSetFlag (AppLayerParserState *pstate, uint8_t flag)
 
int AppLayerParserStateIssetFlag (AppLayerParserState *pstate, uint8_t flag)
 
void AppLayerParserStreamTruncated (uint8_t ipproto, AppProto alproto, void *alstate, uint8_t direction)
 
AppLayerParserStateAppLayerParserStateAlloc (void)
 
void AppLayerParserStateFree (AppLayerParserState *pstate)
 
void AppLayerParserTransactionsCleanup (Flow *f)
 remove obsolete (inspected and logged) transactions More...
 
void AppLayerParserRegisterProtocolUnittests (uint8_t ipproto, AppProto alproto, void(*RegisterUnittests)(void))
 
void AppLayerParserRegisterUnittests (void)
 
void AppLayerParserBackupParserTable (void)
 
void AppLayerParserRestoreParserTable (void)
 
void UTHAppLayerParserStateGetIds (void *ptr, uint64_t *i1, uint64_t *i2, uint64_t *log, uint64_t *min)
 

Detailed Description

Macro Definition Documentation

#define APP_LAYER_PARSER_BYPASS_READY   BIT_U8(4)

Definition at line 38 of file app-layer-parser.h.

Referenced by AppLayerParserParse(), and SSLVersionToString().

#define APP_LAYER_PARSER_INT_STREAM_DEPTH_SET   BIT_U32(0)
#define APP_LAYER_PARSER_NO_INSPECTION   BIT_U8(1)
#define APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD   BIT_U8(3)

Definition at line 37 of file app-layer-parser.h.

Referenced by AppLayerParserParse(), and SSLVersionToString().

#define APP_LAYER_PARSER_NO_REASSEMBLY   BIT_U8(2)

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

Referenced by AppLayerParserParse(), and SSLVersionToString().

#define APP_LAYER_PARSER_OPT_ACCEPT_GAPS   BIT_U32(0)
#define APP_LAYER_TX_INSPECTED_FLAG   BIT_U64(63)

is tx fully inspected?

Definition at line 48 of file app-layer-parser.h.

Referenced by AppLayerParserSetTransactionInspectId(), and AppLayerParserTransactionsCleanup().

#define APP_LAYER_TX_PREFILTER_MASK   ~APP_LAYER_TX_INSPECTED_FLAG

other 63 bits are for tracking which prefilter engine is already completely inspected

Definition at line 51 of file app-layer-parser.h.

Typedef Documentation

typedef AppLayerGetTxIterTuple(* AppLayerGetTxIteratorFunc) (const uint8_t ipproto, const AppProto alproto, void *alstate, uint64_t min_tx_id, uint64_t max_tx_id, AppLayerGetTxIterState *state)

tx iterator prototype

Definition at line 112 of file app-layer-parser.h.

typedef int(* AppLayerParserFPtr) (Flow *f, void *protocol_state, AppLayerParserState *pstate, const uint8_t *buf, uint32_t buf_len, void *local_storage, const uint8_t flags)

Prototype for parsing functions.

Definition at line 92 of file app-layer-parser.h.

Definition at line 61 of file app-layer-parser.h.

Function Documentation

AppLayerGetTxIteratorFunc AppLayerGetTxIterator ( const uint8_t  ipproto,
const AppProto  alproto 
)

Definition at line 692 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), and AppLayerParserProtoCtx_::StateGetTxIterator.

Referenced by AppLayerParserSetTransactionInspectId(), AppLayerParserTransactionsCleanup(), and OutputRegisterTxLogger().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserBackupParserTable ( void  )

Definition at line 2038 of file app-layer-parser.c.

References SCEnter, and SCReturn.

Referenced by AppLayerParserRestoreParserTable().

Here is the caller graph for this function:

int AppLayerParserConfParserEnabled ( const char *  ipproto,
const char *  alproto_name 
)

Given a protocol name, checks if the parser is enabled in the conf file.

Parameters
alproto_nameName of the app layer protocol.
Return values
1If enabled.
0If disabled.

Given a protocol name, checks if the parser is enabled in the conf file.

Definition at line 303 of file app-layer-parser.c.

References ConfGetNode(), ConfValIsFalse(), ConfValIsTrue(), RunmodeIsUnittests(), SC_ERR_FATAL, SCEnter, SCLogDebug, SCLogError, SCReturnInt, and ConfNode_::val.

Referenced by HTPFreeConfig(), RegisterDCERPCParsers(), RegisterDCERPCUDPParsers(), RegisterDNP3Parsers(), RegisterDNSTCPParsers(), RegisterDNSUDPParsers(), RegisterENIPTCPParsers(), RegisterENIPUDPParsers(), RegisterFTPParsers(), RegisterHTPParsers(), RegisterModbusParsers(), RegisterNFSTCPParsers(), RegisterNFSUDPParsers(), RegisterSMBParsers(), RegisterSMTPParsers(), RegisterSSHParsers(), RegisterSSLParsers(), RegisterTemplateParsers(), and RegisterTFTPParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserDeSetup ( void  )

Definition at line 243 of file app-layer-parser.c.

References FTPParserCleanup(), SCEnter, SCReturnInt, and SMTPParserCleanup().

Referenced by AppLayerDeSetup().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserDestroyProtocolParserLocalStorage ( uint8_t  ipproto,
AppProto  alproto,
void *  local_data 
)

Definition at line 642 of file app-layer-parser.c.

References AppLayerParserGetTx(), AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerGetTxIterTuple::has_next, MAX, SCEnter, SCLogDebug, SCReturn, AppLayerGetTxIterTuple::tx_id, tx_id, and AppLayerGetTxIterTuple::tx_ptr.

Referenced by AppLayerParserThreadCtxFree().

Here is the call graph for this function:

Here is the caller graph for this function:

AppLayerDecoderEvents* AppLayerParserGetDecoderEvents ( AppLayerParserState pstate)

Definition at line 848 of file app-layer-parser.c.

References AppLayerParserState_::decoder_events, SCEnter, and SCReturnPtr.

Referenced by AppLayerDecoderEventsSetEvent(), AppLayerParserHasDecoderEvents(), and HtpConfigRestoreBackup().

Here is the caller graph for this function:

int AppLayerParserGetEventInfo ( uint8_t  ipproto,
AppProto  alproto,
const char *  event_name,
int *  event_id,
AppLayerEventType event_type 
)

Definition at line 1071 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturnInt, and AppLayerParserProtoCtx_::StateGetEventInfo.

Referenced by DetectAppLayerEventRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserGetEventInfoById ( uint8_t  ipproto,
AppProto  alproto,
int  event_id,
const char **  event_name,
AppLayerEventType event_type 
)

Definition at line 1081 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturnInt, and AppLayerParserProtoCtx_::StateGetEventInfoById.

Here is the call graph for this function:

AppLayerDecoderEvents* AppLayerParserGetEventsByTx ( uint8_t  ipproto,
AppProto  alproto,
void *  tx 
)

Definition at line 861 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, and SCReturnPtr.

Referenced by DetectAppLayerEventRegister(), HtpConfigRestoreBackup(), and HTPFileClose().

Here is the call graph for this function:

Here is the caller graph for this function:

uint8_t AppLayerParserGetFirstDataDir ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 1092 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, and SCReturnCT.

Referenced by AppLayerIncTxCounter().

Here is the call graph for this function:

Here is the caller graph for this function:

void* AppLayerParserGetProtocolParserLocalStorage ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 627 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, and SCReturnPtr.

Referenced by AppLayerParserThreadCtxAlloc().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserGetStateProgress ( uint8_t  ipproto,
AppProto  alproto,
void *  alstate,
uint8_t  flags 
)

get the progress value for a tx/protocol

If the stream is disrupted, we return the 'completion' value.

Definition at line 1029 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FLOW_PROTO_DEFAULT, FlowGetProtoMapping(), IS_DISRUPTED, SCEnter, SCReturnInt, and unlikely.

Referenced by AppLayerParserSetTransactionInspectId(), AppLayerParserTransactionsCleanup(), DetectAppLayerEventRegister(), DetectEngineInspectBufferGeneric(), DetectHttpClientBodyRegister(), and OutputRegisterTxLogger().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserGetStateProgressCompletionStatus ( AppProto  alproto,
uint8_t  direction 
)
uint32_t AppLayerParserGetStreamDepth ( const Flow f)

Definition at line 1399 of file app-layer-parser.c.

References Flow_::alproto, AppLayerParserCtx_::ctxs, Flow_::protomap, SCReturnInt, and AppLayerParserProtoCtx_::stream_depth.

Referenced by AppLayerIncTxCounter().

Here is the caller graph for this function:

uint64_t AppLayerParserGetTransactionActive ( const Flow f,
AppLayerParserState pstate,
uint8_t  direction 
)
uint64_t AppLayerParserGetTransactionInspectId ( AppLayerParserState pstate,
uint8_t  direction 
)
uint64_t AppLayerParserGetTransactionLogId ( AppLayerParserState pstate)

Definition at line 728 of file app-layer-parser.c.

References AppLayerParserState_::log_id, SCEnter, and SCReturnCT.

Referenced by OutputRegisterTxLogger().

Here is the caller graph for this function:

uint64_t AppLayerParserGetTxDetectFlags ( uint8_t  ipproto,
AppProto  alproto,
void *  tx,
uint8_t  dir 
)

Definition at line 1163 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, flags, FlowGetProtoMapping(), AppLayerParserProtoCtx_::GetTxDetectFlags, SCEnter, and SCReturnUInt.

Referenced by AppLayerParserSetTransactionInspectId(), and AppLayerParserTransactionsCleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

DetectEngineState* AppLayerParserGetTxDetectState ( uint8_t  ipproto,
AppProto  alproto,
void *  tx 
)

Definition at line 1133 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::GetTxDetectState, SCEnter, and SCReturnPtr.

Referenced by DetectEngineStateResetTxs(), and DetectRunStoreStateTx().

Here is the call graph for this function:

Here is the caller graph for this function:

LoggerId AppLayerParserGetTxLogged ( const Flow f,
void *  alstate,
void *  tx 
)
bool AppLayerParserHasDecoderEvents ( AppLayerParserState pstate)

Definition at line 1329 of file app-layer-parser.c.

References AppLayerParserGetDecoderEvents(), AppLayerDecoderEvents_::cnt, AppLayerParserState_::decoder_events, and SCEnter.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserHasTxDetectState ( uint8_t  ipproto,
AppProto  alproto,
void *  alstate 
)
int AppLayerParserIsTxAware ( AppProto  alproto)

simpler way to globally test if a alproto is registered and fully enabled in the configuration.

Definition at line 1347 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FLOW_PROTO_DEFAULT, and AppLayerParserProtoCtx_::StateGetProgressCompletionStatus.

Referenced by DetectAppLayerInspectEngineRegister(), and OutputRegisterTxLogger().

Here is the caller graph for this function:

int AppLayerParserParse ( ThreadVars tv,
AppLayerParserThreadCtx tctx,
Flow f,
AppProto  alproto,
uint8_t  flags,
const uint8_t *  input,
uint32_t  input_len 
)

Definition at line 1184 of file app-layer-parser.c.

References Flow_::alparser, Flow_::alproto, AppLayerParserThreadCtx_::alproto_local_storage, Flow_::alstate, APP_LAYER_PARSER_BYPASS_READY, APP_LAYER_PARSER_EOF, APP_LAYER_PARSER_NO_INSPECTION, APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD, APP_LAYER_PARSER_NO_REASSEMBLY, APP_LAYER_PARSER_OPT_ACCEPT_GAPS, AppLayerGetProtoName(), AppLayerIncTxCounter(), AppLayerParserGetTxCnt(), AppLayerParserSetEOF(), AppLayerParserStateAlloc(), AppLayerParserStateSetFlag(), AppLayerParserStreamTruncated(), BUG_ON, AppLayerParserCtx_::ctxs, AppLayerParserState_::flags, Flow_::flags, FLOW_NOPAYLOAD_INSPECTION, FlowGetProtoMapping(), AppLayerParserProtoCtx_::option_flags, AppLayerParserProtoCtx_::Parser, Flow_::proto, Flow_::protoctx, Flow_::protomap, SCEnter, SCLogDebug, SCReturnInt, AppLayerParserProtoCtx_::StateAlloc, STREAM_DEPTH, STREAM_EOF, STREAM_GAP, STREAM_TOCLIENT, STREAM_TOSERVER, StreamTcpDisableAppLayer(), StreamTcpSetDisableRawReassemblyFlag(), StreamTcpSetSessionBypassFlag(), and StreamTcpSetSessionNoReassemblyFlag().

Referenced by AppLayerHandleTCPData(), AppLayerHandleUdp(), AppLayerIncTxCounter(), AppLayerParserRestoreParserTable(), AppLayerParserStreamTruncated(), DetectBypassRegister(), DetectDceIfaceRegister(), DetectDceOpnumRegister(), DetectDceStubDataRegister(), DetectDNP3Register(), DetectDnsQueryRegister(), DetectEngineInspectENIP(), DetectEngineInspectModbus(), DetectEngineStateResetTxs(), DetectFtpbounceRegister(), DetectHttpRequestLineRegister(), DetectHttpResponseLineRegister(), DetectLuaRegister(), DetectPcrePayloadMatch(), DetectSshSoftwareVersionRegister(), DetectSshVersionRegister(), DetectTemplateRustBufferRegister(), DetectUricontentRegister(), DetectUrilenValidateContent(), FTPParserCleanup(), HtpConfigRestoreBackup(), HTPFileClose(), RegisterDCERPCParsers(), RegisterDCERPCUDPParsers(), RegisterDNP3Parsers(), RegisterENIPTCPParsers(), RegisterModbusParsers(), RegisterSMBParsers(), RegisterSSHParsers(), SMTPParserCleanup(), and SSLJA3IsEnabled().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserPostStreamSetup ( void  )
LoggerId AppLayerParserProtocolGetLoggerBits ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 1369 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::logger_bits, SCEnter, and SCReturnUInt.

Referenced by AppLayerParserTransactionsCleanup(), and OutputRegisterTxLogger().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserProtocolHasLogger ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 1361 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::logger, SCEnter, and SCReturnInt.

Referenced by OutputRegisterTxLogger(), and RunModeInitializeOutputs().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserProtocolIsTxEventAware ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 1353 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturnInt, and AppLayerParserProtoCtx_::StateGetEvents.

Here is the call graph for this function:

int AppLayerParserProtoIsRegistered ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 188 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), and AppLayerParserProtoCtx_::StateAlloc.

Referenced by AppLayerSetupCounters().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterDetectFlagsFuncs ( uint8_t  ipproto,
AppProto  alproto,
uint64_t(*)(void *tx, uint8_t dir)  GetTxDetectFlags,
void(*)(void *tx, uint8_t dir, uint64_t)  SetTxDetectFlags 
)
void AppLayerParserRegisterGetEventInfo ( uint8_t  ipproto,
AppProto  alproto,
int(*)(const char *event_name, int *event_id, AppLayerEventType *event_type StateGetEventInfo 
)
void AppLayerParserRegisterGetEventInfoById ( uint8_t  ipproto,
AppProto  alproto,
int(*)(int event_id, const char **event_name, AppLayerEventType *event_type StateGetEventInfoById 
)
void AppLayerParserRegisterGetEventsFunc ( uint8_t  ipproto,
AppProto  proto,
AppLayerDecoderEvents *)(void *) __attribute__ StateGetEvents((nonnull) 
)
void AppLayerParserRegisterGetFilesFunc ( uint8_t  ipproto,
AppProto  alproto,
FileContainer *(*)(void *, uint8_t)  StateGetFiles 
)
void AppLayerParserRegisterGetStateProgressFunc ( uint8_t  ipproto,
AppProto  alproto,
int(*)(void *alstate, uint8_t direction)  StateGetStateProgress 
)
void AppLayerParserRegisterGetStreamDepth ( uint8_t  ipproto,
AppProto  alproto,
uint32_t(*)(void)  GetStreamDepth 
)
void AppLayerParserRegisterGetTxIterator ( uint8_t  ipproto,
AppProto  alproto,
AppLayerGetTxIteratorFunc  Func 
)

Definition at line 538 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturn, and AppLayerParserProtoCtx_::StateGetTxIterator.

Referenced by AppLayerRegisterParser(), RegisterNFSTCPParsers(), RegisterNFSUDPParsers(), and RegisterSMBParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterLocalStorageFunc ( uint8_t  ipproto,
AppProto  proto,
void *(*)(void)  LocalStorageAlloc,
void(*)(void *)  LocalStorageFree 
)

Definition at line 415 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::LocalStorageAlloc, AppLayerParserProtoCtx_::LocalStorageFree, SCEnter, and SCReturn.

Referenced by AppLayerRegisterParser(), RegisterFTPParsers(), and RegisterSMTPParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterLogger ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 475 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::logger, SCEnter, and SCReturn.

Referenced by JsonDNSLogAnswer(), JsonNFSAddMetadata(), JsonSIPAddMetadata(), JsonSMBAddMetadata(), JsonTlsLogJSONExtended(), LogHttpLogInitCtx(), and TLSGetIPInformations().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterLoggerBits ( uint8_t  ipproto,
AppProto  alproto,
LoggerId  bits 
)

Definition at line 466 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::logger_bits, SCEnter, and SCReturn.

Referenced by RunModeInitializeOutputs().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterLoggerFuncs ( uint8_t  ipproto,
AppProto  alproto,
LoggerId(*)(void *, void *)  StateGetTxLogged,
void(*)(void *, void *, LoggerId StateSetTxLogged 
)
void AppLayerParserRegisterMpmIDsFuncs ( uint8_t  ipproto,
AppProto  alproto,
uint64_t(*)(void *tx)  GetTxMpmIDs,
int(*)(void *tx, uint64_t)  SetTxMpmIDs 
)

Definition at line 605 of file app-layer-parser.c.

References AppProtoToString(), SC_WARN_DEPRECATED, SCEnter, SCLogWarning, and SCReturn.

Referenced by AppLayerRegisterParser().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterOptionFlags ( uint8_t  ipproto,
AppProto  alproto,
uint32_t  flags 
)

Definition at line 391 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, flags, FlowGetProtoMapping(), AppLayerParserProtoCtx_::option_flags, SCEnter, and SCReturn.

Referenced by RegisterDNSTCPParsers(), RegisterENIPTCPParsers(), RegisterNFSTCPParsers(), and RegisterSMBParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterParserAcceptableDataDirection ( uint8_t  ipproto,
AppProto  alproto,
uint8_t  direction 
)
void AppLayerParserRegisterSetStreamDepthFlag ( uint8_t  ipproto,
AppProto  alproto,
void(*)(void *tx, uint8_t flags SetStreamDepthFlag 
)

Definition at line 615 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturn, and AppLayerParserProtoCtx_::SetStreamDepthFlag.

Referenced by RegisterHTPParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterTruncateFunc ( uint8_t  ipproto,
AppProto  alproto,
void(*)(void *, uint8_t)  Truncate 
)

Definition at line 484 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturn, and AppLayerParserProtoCtx_::Truncate.

Referenced by RegisterHTPParsers(), RegisterSMBParsers(), and RegisterSMTPParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserRegisterUnittests ( void  )

Definition at line 2162 of file app-layer-parser.c.

References ALPROTO_MAX, AppLayerParserCtx_::ctxs, FLOW_PROTO_DEFAULT, AppLayerParserProtoCtx_::RegisterUnittests, SCEnter, SCReturn, and UtRegisterTest().

Here is the call graph for this function:

void AppLayerParserSetDecoderEvents ( AppLayerParserState pstate,
AppLayerDecoderEvents devents 
)

Definition at line 856 of file app-layer-parser.c.

References AppLayerParserState_::decoder_events.

Referenced by AppLayerDecoderEventsSetEvent().

Here is the caller graph for this function:

void AppLayerParserSetEOF ( AppLayerParserState pstate)

Definition at line 1314 of file app-layer-parser.c.

References APP_LAYER_PARSER_EOF, AppLayerParserStateSetFlag(), SCEnter, and SCReturn.

Referenced by AppLayerParserParse().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserSetStreamDepth ( uint8_t  ipproto,
AppProto  alproto,
uint32_t  stream_depth 
)

Definition at line 1388 of file app-layer-parser.c.

References APP_LAYER_PARSER_INT_STREAM_DEPTH_SET, AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), AppLayerParserProtoCtx_::internal_flags, SCEnter, SCReturn, and AppLayerParserProtoCtx_::stream_depth.

Referenced by RegisterModbusParsers(), and RegisterSMBParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserSetStreamDepthFlag ( uint8_t  ipproto,
AppProto  alproto,
void *  state,
uint64_t  tx_id,
uint8_t  flags 
)

Definition at line 1404 of file app-layer-parser.c.

References AppLayerParserGetTx(), AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturn, and AppLayerParserProtoCtx_::SetStreamDepthFlag.

Referenced by DetectFilestoreRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerParserSetTransactionLogId ( AppLayerParserState pstate,
uint64_t  tx_id 
)

Definition at line 735 of file app-layer-parser.c.

References AppLayerParserState_::log_id, SCEnter, SCReturn, and tx_id.

Referenced by OutputRegisterTxLogger().

Here is the caller graph for this function:

void AppLayerParserSetTxDetectFlags ( uint8_t  ipproto,
AppProto  alproto,
void *  tx,
uint8_t  dir,
uint64_t   
)

Definition at line 1173 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, SCReturn, and AppLayerParserProtoCtx_::SetTxDetectFlags.

Referenced by AppLayerParserSetTransactionInspectId().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserSetTxDetectState ( const Flow f,
void *  tx,
DetectEngineState s 
)
void AppLayerParserSetTxLogged ( uint8_t  ipproto,
AppProto  alproto,
void *  alstate,
void *  tx,
LoggerId  logged 
)

Definition at line 700 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FlowGetProtoMapping(), SCEnter, and SCReturn.

Referenced by OutputRegisterTxLogger().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserSetup ( void  )

Definition at line 219 of file app-layer-parser.c.

References SCEnter, and SCReturnInt.

Referenced by AppLayerSetup(), and GetProgramVersion().

Here is the caller graph for this function:

AppLayerParserState* AppLayerParserStateAlloc ( void  )

Definition at line 195 of file app-layer-parser.c.

References SCEnter, SCMalloc, and SCReturnPtr.

Referenced by AppLayerParserParse(), and HtpConfigRestoreBackup().

Here is the caller graph for this function:

void AppLayerParserStateFree ( AppLayerParserState pstate)

Definition at line 208 of file app-layer-parser.c.

References AppLayerDecoderEventsFreeEvents(), AppLayerParserState_::decoder_events, SCEnter, SCFree, and SCReturn.

Referenced by AppLayerParserStateCleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

int AppLayerParserStateIssetFlag ( AppLayerParserState pstate,
uint8_t  flag 
)

Definition at line 1587 of file app-layer-parser.c.

References AppLayerParserState_::flags, SCEnter, and SCReturnInt.

Referenced by DCERPCParser(), OutputRegisterTxLogger(), RegisterSSHParsers(), SMTPProcessDataChunk(), and SSLVersionToString().

Here is the caller graph for this function:

void AppLayerParserStateSetFlag ( AppLayerParserState pstate,
uint8_t  flag 
)

Definition at line 1579 of file app-layer-parser.c.

References AppLayerParserState_::flags, SCEnter, and SCReturn.

Referenced by AppLayerParserParse(), AppLayerParserSetEOF(), and SSLVersionToString().

Here is the caller graph for this function:

int AppLayerParserSupportsFiles ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 1119 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FALSE, FlowGetProtoMapping(), and TRUE.

Referenced by SigMatchList2DataArray().

Here is the call graph for this function:

Here is the caller graph for this function:

bool AppLayerParserSupportsTxDetectFlags ( AppProto  alproto)

Definition at line 1152 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FLOW_PROTO_APPLAYER_MAX, AppLayerParserProtoCtx_::GetTxDetectFlags, SCEnter, and SCReturnBool.

Referenced by DetectAppLayerInspectEngineRegister().

Here is the caller graph for this function:

int AppLayerParserSupportsTxDetectState ( uint8_t  ipproto,
AppProto  alproto 
)

Definition at line 1126 of file app-layer-parser.c.

References AppLayerParserCtx_::ctxs, FALSE, FlowGetProtoMapping(), and TRUE.

Here is the call graph for this function:

void AppLayerParserTriggerRawStreamReassembly ( Flow f,
int  direction 
)

Definition at line 1377 of file app-layer-parser.c.

References Flow_::protoctx, SCEnter, SCLogDebug, SCReturn, and StreamTcpReassembleTriggerRawReassembly().

Referenced by HTPFreeConfig(), SMTPProcessDataChunk(), and SSLVersionToString().

Here is the call graph for this function:

Here is the caller graph for this function:

void UTHAppLayerParserStateGetIds ( void *  ptr,
uint64_t *  i1,
uint64_t *  i2,
uint64_t *  log,
uint64_t *  min 
)

Definition at line 174 of file app-layer-parser.c.

References AppLayerParserState_::inspect_id, AppLayerParserState_::log_id, and AppLayerParserState_::min_id.

Referenced by HtpConfigRestoreBackup(), and RegisterSMBParsers().

Here is the caller graph for this function: