suricata
|
Go to the source code of this file.
Data Structures | |
struct | SCEnumCharMap_ |
Typedefs | |
typedef struct SCEnumCharMap_ | SCEnumCharMap |
Functions | |
int | SCMapEnumNameToValue (const char *, SCEnumCharMap *) |
Maps a string name to an enum value from the supplied table. Please specify the last element of any map table with a {NULL, -1}. If missing, you will be welcomed with a segfault :) More... | |
const char * | SCMapEnumValueToName (int, SCEnumCharMap *) |
Maps an enum value to a string name, from the supplied table. More... | |
Definition in file util-enum.h.
typedef struct SCEnumCharMap_ SCEnumCharMap |
int SCMapEnumNameToValue | ( | const char * | enum_name, |
SCEnumCharMap * | table | ||
) |
Maps a string name to an enum value from the supplied table. Please specify the last element of any map table with a {NULL, -1}. If missing, you will be welcomed with a segfault :)
enum_name | Character string that has to be mapped to an enum value from the table |
table | Enum-Char table, from which the mapping is retrieved |
result | The enum_value for the enum_name string or -1 on failure |
Definition at line 40 of file util-enum.c.
References SCEnumCharMap_::enum_name, SCEnumCharMap_::enum_value, and SCLogDebug.
Referenced by SCAppLayerGetEventIdByName(), and SCLogLoadConfig().
const char* SCMapEnumValueToName | ( | int | enum_value, |
SCEnumCharMap * | table | ||
) |
Maps an enum value to a string name, from the supplied table.
enum_value | Enum_value that has to be mapped to a string_value from the table |
table | Enum-Char table, from which the mapping is retrieved |
result | The enum_name for the enum_value supplied or NULL on failure |
Definition at line 68 of file util-enum.c.
References SCEnumCharMap_::enum_name, SCEnumCharMap_::enum_value, and SCLogDebug.
Referenced by AppLayerGetEventInfoById(), and SCRuleVarsGetConfVar().