suricata
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
 

Typedefs

typedef struct AppProtoStringTuple AppProtoStringTuple
 

Functions

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...
 

Variables

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.

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

Definition at line 78 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(), EngineAnalysisRules2(), EveAddAppProto(), LLVMFuzzerInitialize(), LLVMFuzzerTestOneInput(), 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.

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

Definition at line 98 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().