app-layer-protos.c File Reference
#include "suricata-common.h"
#include "app-layer-protos.h"
Include dependency graph for app-layer-protos.c:

Go to the source code of this file.

Data Structures

struct  AppProtoStringTuple


typedef struct AppProtoStringTuple AppProtoStringTuple


const char * AppProtoToString (AppProto alproto)
 Maps the ALPROTO_*, to its string equivalent. More...
AppProto StringToAppProto (const char *proto_name)
 Maps a string to its ALPROTO_* equivalent. More...


const AppProtoStringTuple AppProtoStrings [ALPROTO_MAX]

Detailed Description

Typedef Documentation

◆ AppProtoStringTuple

Function Documentation

◆ AppProtoToString()

const char* AppProtoToString ( AppProto  alproto)

Maps the ALPROTO_*, to its string equivalent.

alprotoApp layer protocol id.
Return values
Stringequivalent for the alproto.

Definition at line 74 of file app-layer-protos.c.

References ALPROTO_HTTP, ALPROTO_HTTP1, AppProtoStrings, ARRAY_SIZE, BUG_ON, and AppProtoStringTuple::str.

Referenced by AppLayerRegisterParser(), AppLayerRegisterProtocolDetection(), DetectEngineFrameMpmRegister(), DetectFrameMpmRegister(), DetectSignatureSetAppProto(), EngineAnalysisRules2(), EveAddAppProto(), LLVMFuzzerInitialize(), LLVMFuzzerTestOneInput(), OutputRegisterTxLogger(), RulesDumpMatchArray(), and RulesDumpTxMatchArray().

Here is the caller graph for this function:

◆ StringToAppProto()

AppProto StringToAppProto ( const char *  proto_name)

Maps a string to its ALPROTO_* equivalent.

Stringequivalent for the alproto.
Return values
alprotoApp layer protocol id, or ALPROTO_UNKNOWN.

Definition at line 94 of file app-layer-protos.c.

References ALPROTO_UNKNOWN, AppProtoStrings, ARRAY_SIZE, and str.

Referenced by AppLayerRegisterProtocolDetection(), and LLVMFuzzerInitialize().

Here is the caller graph for this function:

Variable Documentation

◆ AppProtoStrings

const AppProtoStringTuple AppProtoStrings[ALPROTO_MAX]

Definition at line 33 of file app-layer-protos.c.

Referenced by AppProtoToString(), and StringToAppProto().