suricata
|
#include <pcre2.h>
#include <jansson.h>
#include "util-optimize.h"
#include <htp/htp.h>
#include "threads.h"
#include "tm-threads-common.h"
#include "util-debug.h"
#include "util-error.h"
#include "util-mem.h"
#include "detect-engine-alert.h"
#include "util-path.h"
#include "util-conf.h"
Go to the source code of this file.
Macros | |
#define | TRUE 1 |
#define | FALSE 0 |
#define | _GNU_SOURCE |
#define | __USE_GNU |
#define | CLS 64 |
#define | JSON_ESCAPE_SLASH 0 |
#define | xstr(s) str(s) |
#define | str(s) #s |
#define | BUG_ON(x) |
#define | SigIntId uint32_t |
#define | PatIntId uint32_t |
#define | __WORDSIZE 32 |
#define | MIN(x, y) (((x)<(y))?(x):(y)) |
#define | MAX(x, y) (((x)<(y))?(y):(x)) |
#define | BIT_U8(n) ((uint8_t)(1 << (n))) |
#define | BIT_U16(n) ((uint16_t)(1 << (n))) |
#define | BIT_U32(n) (1UL << (n)) |
#define | BIT_U64(n) (1ULL << (n)) |
#define | WARN_UNUSED __attribute__((warn_unused_result)) |
#define | ATTR_FMT_PRINTF(x, y) |
#define | SCNtohl(x) (uint32_t)ntohl((x)) |
#define | SCNtohs(x) (uint16_t)ntohs((x)) |
#define | SWAP_FLAGS(flags, a, b) |
#define | SWAP_VARS(type, a, b) |
#define | SCFwriteUnlocked fwrite |
#define | SCFflushUnlocked fflush |
#define | SCClearErrUnlocked clearerr |
#define | SCFerrorUnlocked ferror |
#define | ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) |
Typedefs | |
typedef enum PacketProfileDetectId_ | PacketProfileDetectId |
Functions | |
size_t | strlcat (char *, const char *src, size_t siz) |
size_t | strlcpy (char *dst, const char *src, size_t siz) |
char * | strptime (const char *__restrict, const char *__restrict, struct tm *__restrict) |
Variables | |
int | coverage_unittests |
int | g_ut_modules |
int | g_ut_covered |
Common includes, etc.
Definition in file suricata-common.h.
#define __USE_GNU |
Definition at line 38 of file suricata-common.h.
#define __WORDSIZE 32 |
FreeBSD does not define __WORDSIZE, but it uses __LONG_BIT Windows does not define WORDSIZE, but it uses __X86 if not succesful yet try the data models
Definition at line 338 of file suricata-common.h.
#define _GNU_SOURCE |
Definition at line 37 of file suricata-common.h.
#define ARRAY_SIZE | ( | arr | ) | (sizeof(arr) / sizeof(arr[0])) |
Definition at line 536 of file suricata-common.h.
#define ATTR_FMT_PRINTF | ( | x, | |
y | |||
) |
Definition at line 392 of file suricata-common.h.
#define BIT_U16 | ( | n | ) | ((uint16_t)(1 << (n))) |
Definition at line 381 of file suricata-common.h.
#define BIT_U32 | ( | n | ) | (1UL << (n)) |
Definition at line 382 of file suricata-common.h.
#define BIT_U64 | ( | n | ) | (1ULL << (n)) |
Definition at line 383 of file suricata-common.h.
#define BIT_U8 | ( | n | ) | ((uint8_t)(1 << (n))) |
Definition at line 380 of file suricata-common.h.
#define BUG_ON | ( | x | ) |
Definition at line 282 of file suricata-common.h.
#define CLS 64 |
Definition at line 46 of file suricata-common.h.
#define FALSE 0 |
Definition at line 35 of file suricata-common.h.
#define JSON_ESCAPE_SLASH 0 |
Definition at line 263 of file suricata-common.h.
#define MAX | ( | x, | |
y | |||
) | (((x)<(y))?(y):(x)) |
Definition at line 377 of file suricata-common.h.
#define MIN | ( | x, | |
y | |||
) | (((x)<(y))?(x):(y)) |
darwin doesn't defined __BYTE_ORDER and friends, but BYTE_ORDER
Definition at line 373 of file suricata-common.h.
#define PatIntId uint32_t |
same for pattern id's
Definition at line 300 of file suricata-common.h.
#define SCClearErrUnlocked clearerr |
Definition at line 524 of file suricata-common.h.
#define SCFerrorUnlocked ferror |
Definition at line 525 of file suricata-common.h.
#define SCFflushUnlocked fflush |
Definition at line 523 of file suricata-common.h.
#define SCFwriteUnlocked fwrite |
Definition at line 522 of file suricata-common.h.
#define SCNtohl | ( | x | ) | (uint32_t)ntohl((x)) |
Definition at line 395 of file suricata-common.h.
#define SCNtohs | ( | x | ) | (uint16_t)ntohs((x)) |
Definition at line 396 of file suricata-common.h.
#define SigIntId uint32_t |
type for the internal signature id. Since it's used in the matching engine extensively keeping this as small as possible reduces the overall memory footprint of the engine. Set to uint32_t if the engine needs to support more than 64k sigs.
Definition at line 297 of file suricata-common.h.
#define str | ( | s | ) | #s |
Definition at line 273 of file suricata-common.h.
#define SWAP_FLAGS | ( | flags, | |
a, | |||
b | |||
) |
#define SWAP_VARS | ( | type, | |
a, | |||
b | |||
) |
Definition at line 410 of file suricata-common.h.
#define TRUE 1 |
Definition at line 34 of file suricata-common.h.
#define WARN_UNUSED __attribute__((warn_unused_result)) |
Definition at line 385 of file suricata-common.h.
#define xstr | ( | s | ) | str(s) |
Definition at line 272 of file suricata-common.h.
typedef enum PacketProfileDetectId_ PacketProfileDetectId |
enum LoggerId |
Enumerator | |
---|---|
LOGGER_UNDEFINED | |
LOGGER_HTTP | |
LOGGER_TLS_STORE | |
LOGGER_TLS | |
LOGGER_JSON_DNS | |
LOGGER_JSON_HTTP | |
LOGGER_JSON_SMTP | |
LOGGER_JSON_TLS | |
LOGGER_JSON_NFS | |
LOGGER_JSON_TFTP | |
LOGGER_JSON_FTP | |
LOGGER_JSON_DNP3_TS | |
LOGGER_JSON_DNP3_TC | |
LOGGER_JSON_SSH | |
LOGGER_JSON_SMB | |
LOGGER_JSON_IKE | |
LOGGER_JSON_KRB5 | |
LOGGER_JSON_QUIC | |
LOGGER_JSON_MODBUS | |
LOGGER_JSON_DHCP | |
LOGGER_JSON_SNMP | |
LOGGER_JSON_SIP | |
LOGGER_JSON_TEMPLATE_RUST | |
LOGGER_JSON_RFB | |
LOGGER_JSON_MQTT | |
LOGGER_JSON_PGSQL | |
LOGGER_JSON_TEMPLATE | |
LOGGER_JSON_RDP | |
LOGGER_JSON_DCERPC | |
LOGGER_JSON_HTTP2 | |
LOGGER_ALERT_DEBUG |
|
LOGGER_ALERT_FAST | |
LOGGER_ALERT_SYSLOG | |
LOGGER_JSON_ALERT | |
LOGGER_JSON_ANOMALY | |
LOGGER_JSON_DROP | |
LOGGER_FILE_STORE | |
LOGGER_JSON_FILE | |
LOGGER_TCP_DATA | |
LOGGER_JSON_FLOW | |
LOGGER_JSON_NETFLOW | |
LOGGER_STATS | |
LOGGER_JSON_STATS | |
LOGGER_PCAP | |
LOGGER_JSON_METADATA | |
LOGGER_JSON_FRAME | |
LOGGER_SIZE |
Definition at line 437 of file suricata-common.h.
Definition at line 416 of file suricata-common.h.
size_t strlcat | ( | char * | , |
const char * | src, | ||
size_t | siz | ||
) |
Definition at line 45 of file util-strlcatu.c.
Referenced by ConfLoadCompleteIncludePath(), DetectAppLayerMpmRegisterByParentId(), DetectLoadCompleteSigPath(), RunmodeAutoFpCreatePickupQueuesString(), ShortenString(), SSLVersionToString(), StringAsBase64(), and TmThreadWaitOnThreadInit().
size_t strlcpy | ( | char * | dst, |
const char * | src, | ||
size_t | siz | ||
) |
Definition at line 43 of file util-strlcpyu.c.
Referenced by BytesToStringBuffer(), ConfigSetDataDirectory(), ConfLoadCompleteIncludePath(), DetectAppLayerMpmRegisterByParentId(), DetectContentDataParse(), DetectEngineBufferTypeGetByIdTransforms(), DetectLoadCompleteSigPath(), GetIfaceMTU(), GetIfaceRSSQueuesNum(), JsonAddrInfoInit(), JsonBuildFileInfoRecord(), LogCustomFormatParse(), LogTcpDataLogInitCtx(), PathJoin(), PcapTranslateIPToDevice(), PortParse(), SCCreateDirectoryTree(), SCRadixAddKeyIPV4String(), SCRadixAddKeyIPV6String(), SCStrndupFunc(), SCTimeToStringPattern(), StringAsBase64(), TmThreadCreate(), and TmThreadWaitOnThreadInit().
char* strptime | ( | const char * | __restrict, |
const char * | __restrict, | ||
struct tm * | __restrict | ||
) |
Definition at line 97 of file util-strptime.c.
References ALT_E, ALT_O, and LEGAL_ALT.
Referenced by SCStringPatternToTime().
int coverage_unittests |
Definition at line 896 of file suricata.c.
Referenced by SigTableRegisterTests(), and TmModuleRegisterTests().
int g_ut_covered |
Definition at line 898 of file suricata.c.
Referenced by SigTableRegisterTests(), and TmModuleRegisterTests().
int g_ut_modules |
Definition at line 897 of file suricata.c.
Referenced by MpmRegisterTests(), SigTableRegisterTests(), and TmModuleRegisterTests().