suricata
util-debug.h File Reference
#include <stdio.h>
#include <stdint.h>
#include <pcre.h>
#include "threads.h"
#include "util-enum.h"
#include "util-error.h"
#include "util-debug-filters.h"
Include dependency graph for util-debug.h:

Go to the source code of this file.

Data Structures

struct  SCLogOPBuffer_
 Structure to be used when log_level override support would be provided by the logging module. More...
 
struct  SCLogOPIfaceCtx_
 The output interface context for the logging module. More...
 
struct  SCLogInitData_
 Structure containing init data, that would be passed to SCInitDebugModule() More...
 
struct  SCLogConfig_
 Holds the config state used by the logging api. More...
 

Macros

#define SC_LOG_ENV_LOG_LEVEL   "SC_LOG_LEVEL"
 ENV vars that can be used to set the properties for the logging module. More...
 
#define SC_LOG_ENV_LOG_OP_IFACE   "SC_LOG_OP_IFACE"
 
#define SC_LOG_ENV_LOG_FILE   "SC_LOG_FILE"
 
#define SC_LOG_ENV_LOG_FACILITY   "SC_LOG_FACILITY"
 
#define SC_LOG_ENV_LOG_FORMAT   "SC_LOG_FORMAT"
 
#define SC_LOG_ENV_LOG_OP_FILTER   "SC_LOG_OP_FILTER"
 
#define SC_LOG_DEF_LOG_FORMAT   "[%i] %t - (%f:%l) <%d> (%n) -- "
 
#define SC_LOG_MAX_LOG_MSG_LEN   2048
 
#define SC_LOG_MAX_LOG_FORMAT_LEN   128
 
#define SC_LOG_DEF_LOG_LEVEL   SC_LOG_INFO
 
#define SC_LOG_DEF_LOG_OP_IFACE   SC_LOG_OP_IFACE_CONSOLE
 
#define SC_LOG_DEF_LOG_FILE   "suricata.log"
 
#define SC_LOG_DEF_SYSLOG_FACILITY_STR   "local0"
 
#define SC_LOG_DEF_SYSLOG_FACILITY   LOG_LOCAL0
 
#define SC_LOG_FMT_TIME   't' /* Timestamp in standard format */
 
#define SC_LOG_FMT_PID   'p' /* PID */
 
#define SC_LOG_FMT_TID   'i' /* Thread ID */
 
#define SC_LOG_FMT_TM   'm' /* Thread module name */
 
#define SC_LOG_FMT_LOG_LEVEL   'd' /* Log level */
 
#define SC_LOG_FMT_FILE_NAME   'f' /* File name */
 
#define SC_LOG_FMT_LINE   'l' /* Line number */
 
#define SC_LOG_FMT_FUNCTION   'n' /* Function */
 
#define SC_LOG_FMT_PREFIX   '%'
 
#define SCLog(x, file, func, line, ...)
 
#define SCLogErr(x, file, func, line, err, ...)
 
#define SCLogInfo(...)
 Macro used to log INFORMATIONAL messages. More...
 
#define SCLogInfoRaw(file, func, line, ...)
 
#define SCLogConfig(...)
 
#define SCLogPerf(...)
 
#define SCLogNotice(...)
 Macro used to log NOTICE messages. More...
 
#define SCLogNoticeRaw(file, func, line, ...)
 
#define SCLogWarning(err_code, ...)
 Macro used to log WARNING messages. More...
 
#define SCLogWarningRaw(err_code, file, func, line, ...)   SCLogErr(SC_LOG_WARNING, (file), (func), (line), err_code, __VA_ARGS__)
 
#define SCLogError(err_code, ...)
 Macro used to log ERROR messages. More...
 
#define SCLogErrorRaw(err_code, file, func, line, ...)
 
#define SCLogCritical(err_code, ...)
 Macro used to log CRITICAL messages. More...
 
#define SCLogAlert(err_code, ...)
 Macro used to log ALERT messages. More...
 
#define SCLogEmerg(err_code, ...)
 Macro used to log EMERGENCY messages. More...
 
#define SCLogDebug(...)   do { } while (0)
 
#define SCEnter(...)
 
#define SCReturn   return
 
#define SCReturnInt(x)   return x
 
#define SCReturnUInt(x)   return x
 
#define SCReturnDbl(x)   return x
 
#define SCReturnChar(x)   return x
 
#define SCReturnCharPtr(x)   return x
 
#define SCReturnCT(x, type)   return x
 
#define SCReturnPtr(x, type)   return x
 
#define FatalError(x, ...)
 
#define FatalErrorOnInit(x, ...)
 Fatal error IF we're starting up, and configured to consider errors to be fatal errors. More...
 

Typedefs

typedef struct SCLogOPBuffer_ SCLogOPBuffer
 Structure to be used when log_level override support would be provided by the logging module. More...
 
typedef struct SCLogOPIfaceCtx_ SCLogOPIfaceCtx
 The output interface context for the logging module. More...
 
typedef struct SCLogInitData_ SCLogInitData
 Structure containing init data, that would be passed to SCInitDebugModule() More...
 
typedef struct SCLogConfig_ SCLogConfig
 Holds the config state used by the logging api. More...
 

Enumerations

enum  SCLogLevel {
  SC_LOG_NOTSET = -1, SC_LOG_NONE = 0, SC_LOG_EMERGENCY, SC_LOG_ALERT,
  SC_LOG_CRITICAL, SC_LOG_ERROR, SC_LOG_WARNING, SC_LOG_NOTICE,
  SC_LOG_INFO, SC_LOG_PERF, SC_LOG_CONFIG, SC_LOG_DEBUG,
  SC_LOG_LEVEL_MAX
}
 The various log levels NOTE: when adding new level, don't forget to update SCLogMapLogLevelToSyslogLevel() or it may result in logging to syslog with LOG_EMERG priority. More...
 
enum  SCLogOPIface { SC_LOG_OP_IFACE_CONSOLE, SC_LOG_OP_IFACE_FILE, SC_LOG_OP_IFACE_SYSLOG, SC_LOG_OP_IFACE_MAX }
 The various output interfaces supported. More...
 
enum  SCLogOPType { SC_LOG_OP_TYPE_REGULAR = 0, SC_LOG_OP_TYPE_JSON }
 

Functions

SCLogInitDataSCLogAllocLogInitData (void)
 Returns a pointer to a new SCLogInitData. This is a public interface intended to be used after the logging paramters are read from the conf file. More...
 
SCLogOPIfaceCtxSCLogInitOPIfaceCtx (const char *, const char *, int, const char *)
 Creates a new output interface based on the arguments sent. The kind of output interface to be created is decided by the iface_name arg. If iface_name is "file", the arg argument will hold the filename to be used for logging purposes. If iface_name is "syslog", the arg argument holds the facility code. If iface_name is "console", arg is NULL. More...
 
void SCLogAppendOPIfaceCtx (SCLogOPIfaceCtx *, SCLogInitData *)
 Appends an output_interface to the output_interface list sent in head. More...
 
void SCLogInitLogModule (SCLogInitData *)
 Initializes the logging module. More...
 
void SCLogDeInitLogModule (void)
 De-Initializes the logging module. More...
 
SCError SCLogMessage (const SCLogLevel, const char *, const unsigned int, const char *, const SCError, const char *message)
 Adds the global log_format to the outgoing buffer. More...
 
SCLogOPBufferSCLogAllocLogOPBuffer (void)
 Allocates an output buffer for an output interface. Used when we want the op_interface log_format to override the global_log_format. Currently not used. More...
 
int SCLogDebugEnabled (void)
 Returns whether debug messages are enabled to be logged or not. More...
 
void SCLogRegisterTests (void)
 
void SCLogLoadConfig (int daemon, int verbose)
 

Variables

SCLogLevel sc_log_global_log_level
 Holds the global log level. Is the same as sc_log_config->log_level. More...
 
int sc_log_module_initialized
 Used to indicate whether the logging module has been init or not. More...
 
int sc_log_module_cleaned
 Used to indicate whether the logging module has been cleaned or not. More...
 

Detailed Description

Macro Definition Documentation

#define FatalErrorOnInit (   x,
  ... 
)
Value:
do { \
int init_errors_fatal = 0; \
ConfGetBool("engine.init-failure-fatal", &init_errors_fatal); \
if (init_errors_fatal && (SC_ATOMIC_GET(engine_stage) == SURICATA_INIT))\
{ \
SCLogError(x, __VA_ARGS__); \
exit(EXIT_FAILURE); \
} \
SCLogWarning(x, __VA_ARGS__); \
} while(0)
int ConfGetBool(const char *name, int *val)
Retrieve a configuration value as an boolen.
Definition: conf.c:517
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:294
#define SCLogWarning(err_code,...)
Macro used to log WARNING messages.
Definition: util-debug.h:281
#define SC_ATOMIC_GET(name)
Get the value from the atomic variable.
Definition: util-atomic.h:192

Fatal error IF we're starting up, and configured to consider errors to be fatal errors.

Definition at line 547 of file util-debug.h.

Referenced by RunModeInitializeOutputs(), and RunModeShutDown().

#define SC_LOG_DEF_LOG_FILE   "suricata.log"

Definition at line 102 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer().

#define SC_LOG_DEF_LOG_FORMAT   "[%i] %t - (%f:%l) <%d> (%n) -- "

Definition at line 86 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), SCLogDeInitLogModule(), and SCLogLoadConfig().

#define SC_LOG_DEF_LOG_LEVEL   SC_LOG_INFO

Definition at line 96 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogDeInitLogModule().

#define SC_LOG_DEF_LOG_OP_IFACE   SC_LOG_OP_IFACE_CONSOLE

Definition at line 99 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogDeInitLogModule().

#define SC_LOG_DEF_SYSLOG_FACILITY   LOG_LOCAL0

Definition at line 106 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogLoadConfig().

#define SC_LOG_DEF_SYSLOG_FACILITY_STR   "local0"

Definition at line 105 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogLoadConfig().

#define SC_LOG_ENV_LOG_FACILITY   "SC_LOG_FACILITY"

Definition at line 42 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer().

#define SC_LOG_ENV_LOG_FILE   "SC_LOG_FILE"

Definition at line 41 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer().

#define SC_LOG_ENV_LOG_FORMAT   "SC_LOG_FORMAT"

Definition at line 43 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogDeInitLogModule().

#define SC_LOG_ENV_LOG_LEVEL   "SC_LOG_LEVEL"

ENV vars that can be used to set the properties for the logging module.

Definition at line 39 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogDeInitLogModule().

#define SC_LOG_ENV_LOG_OP_FILTER   "SC_LOG_OP_FILTER"

Definition at line 44 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer().

#define SC_LOG_ENV_LOG_OP_IFACE   "SC_LOG_OP_IFACE"

Definition at line 40 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer(), and SCLogDeInitLogModule().

#define SC_LOG_FMT_FILE_NAME   'f' /* File name */

Definition at line 198 of file util-debug.h.

#define SC_LOG_FMT_FUNCTION   'n' /* Function */

Definition at line 200 of file util-debug.h.

#define SC_LOG_FMT_LINE   'l' /* Line number */

Definition at line 199 of file util-debug.h.

#define SC_LOG_FMT_LOG_LEVEL   'd' /* Log level */

Definition at line 197 of file util-debug.h.

#define SC_LOG_FMT_PID   'p' /* PID */

Definition at line 194 of file util-debug.h.

#define SC_LOG_FMT_PREFIX   '%'

Definition at line 203 of file util-debug.h.

#define SC_LOG_FMT_TID   'i' /* Thread ID */

Definition at line 195 of file util-debug.h.

#define SC_LOG_FMT_TIME   't' /* Timestamp in standard format */

Definition at line 193 of file util-debug.h.

#define SC_LOG_FMT_TM   'm' /* Thread module name */

Definition at line 196 of file util-debug.h.

#define SC_LOG_MAX_LOG_FORMAT_LEN   128

Definition at line 93 of file util-debug.h.

Referenced by SCLogAllocLogOPBuffer().

#define SC_LOG_MAX_LOG_MSG_LEN   2048

Definition at line 90 of file util-debug.h.

Referenced by SCLogMessage().

#define SCEnter (   ...)

Definition at line 337 of file util-debug.h.

Referenced by AFPPeersListCheck(), AFPPeersListInit(), AppLayerDeSetup(), AppLayerDestroyCtxThread(), AppLayerGetCtxThread(), AppLayerGetProtoByName(), AppLayerGetProtoName(), AppLayerHandleTCPData(), AppLayerHandleUdp(), AppLayerHtpEnableRequestBodyCallback(), AppLayerHtpEnableResponseBodyCallback(), AppLayerHtpNeedFileInspection(), AppLayerListSupportedProtocols(), AppLayerParserBackupParserTable(), AppLayerParserConfParserEnabled(), AppLayerParserDeSetup(), AppLayerParserDestroyProtocolParserLocalStorage(), AppLayerParserGetDecoderEvents(), AppLayerParserGetEventInfo(), AppLayerParserGetEventsByTx(), AppLayerParserGetFiles(), AppLayerParserGetFirstDataDir(), AppLayerParserGetProtocolParserLocalStorage(), AppLayerParserGetStateProgress(), AppLayerParserGetStateProgressCompletionStatus(), AppLayerParserGetTransactionActive(), AppLayerParserGetTransactionInspectId(), AppLayerParserGetTransactionLogId(), AppLayerParserGetTx(), AppLayerParserGetTxCnt(), AppLayerParserGetTxDetectFlags(), AppLayerParserGetTxDetectState(), AppLayerParserGetTxLogged(), AppLayerParserHasDecoderEvents(), AppLayerParserParse(), AppLayerParserProtocolGetLoggerBits(), AppLayerParserProtocolHasLogger(), AppLayerParserProtocolIsTxEventAware(), AppLayerParserRegisterDetectFlagsFuncs(), AppLayerParserRegisterDetectStateFuncs(), AppLayerParserRegisterGetEventInfo(), AppLayerParserRegisterGetEventsFunc(), AppLayerParserRegisterGetFilesFunc(), AppLayerParserRegisterGetStateProgressCompletionStatus(), AppLayerParserRegisterGetStateProgressFunc(), AppLayerParserRegisterGetTx(), AppLayerParserRegisterGetTxCnt(), AppLayerParserRegisterGetTxIterator(), AppLayerParserRegisterLocalStorageFunc(), AppLayerParserRegisterLogger(), AppLayerParserRegisterLoggerBits(), AppLayerParserRegisterLoggerFuncs(), AppLayerParserRegisterMpmIDsFuncs(), AppLayerParserRegisterOptionFlags(), AppLayerParserRegisterParser(), AppLayerParserRegisterParserAcceptableDataDirection(), AppLayerParserRegisterProtocolParsers(), AppLayerParserRegisterProtocolUnittests(), AppLayerParserRegisterStateFuncs(), AppLayerParserRegisterTruncateFunc(), AppLayerParserRegisterTxFreeFunc(), AppLayerParserRegisterUnittests(), AppLayerParserRestoreParserTable(), AppLayerParserSetEOF(), AppLayerParserSetStreamDepth(), AppLayerParserSetTransactionInspectId(), AppLayerParserSetTransactionLogId(), AppLayerParserSetTxDetectFlags(), AppLayerParserSetTxDetectState(), AppLayerParserSetTxLogged(), AppLayerParserSetup(), AppLayerParserStateAlloc(), AppLayerParserStateCleanup(), AppLayerParserStateFree(), AppLayerParserStateIssetFlag(), AppLayerParserStateSetFlag(), AppLayerParserStreamTruncated(), AppLayerParserThreadCtxAlloc(), AppLayerParserThreadCtxFree(), AppLayerParserTransactionsCleanup(), AppLayerParserTriggerRawStreamReassembly(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectDeSetup(), AppLayerProtoDetectDestroyCtxThread(), AppLayerProtoDetectGetCtxThread(), AppLayerProtoDetectGetProto(), AppLayerProtoDetectGetProtoByName(), AppLayerProtoDetectPMRegisterPatternCI(), AppLayerProtoDetectPMRegisterPatternCS(), AppLayerProtoDetectPMRegisterPatternCSwPP(), AppLayerProtoDetectPPParseConfPorts(), AppLayerProtoDetectPPRegister(), AppLayerProtoDetectPrepareState(), AppLayerProtoDetectRegisterProtocol(), AppLayerProtoDetectSetup(), AppLayerProtoDetectSupportedAppProtocols(), AppLayerProtoDetectSupportedIpprotos(), AppLayerProtoDetectUnittestCtxBackup(), AppLayerProtoDetectUnittestCtxRestore(), AppLayerProtoDetectUnittestsRegister(), AppLayerSetup(), AppLayerUnittestsRegister(), BasicSearch(), BoyerMooreCtxDeInit(), CleanupPcapFileFileVars(), ConfigCheckLogDirectory(), DCERPCInit(), DCERPCParser(), DecodeAFP(), DecodeAFPThreadInit(), DecodeErfDag(), DecodeErfDagThreadInit(), DecodeErfFile(), DecodeErfFileThreadInit(), DecodeIPFW(), DecodeIPV6FragHeader(), DecodePcap(), DecodePcapThreadInit(), DefragPolicyLoadFromConfig(), DetectAddressLookupInHead(), DetectAddressMatch(), DetectAddressMatchIPv4(), DetectAddressMatchIPv6(), DetectBytejumpDoMatch(), DetectBytetestDoMatch(), DetectCipServiceRegister(), DetectContentFree(), DetectDceIfaceRegister(), DetectDceOpnumRegister(), DetectDetectionFilterRegister(), DetectDsizeRegister(), DetectEngineContentInspection(), DetectEngineEventRegister(), DetectEngineInspectBufferGeneric(), DetectEngineInspectCIP(), DetectEngineInspectENIP(), DetectEngineInspectModbus(), DetectEngineInspectPacketPayload(), DetectEngineInspectStreamPayload(), DetectFileextRegister(), DetectFileInspectGeneric(), DetectFilemagicRegister(), DetectFilenameRegister(), DetectFilesizeRegister(), DetectFilestoreRegister(), DetectFlagsRegister(), DetectFlowMatch(), DetectFtpbounceRegister(), DetectHttpClientBodyRegister(), DetectHttpStatCodeRegister(), DetectHttpStatMsgRegister(), DetectHttpUriSetup(), DetectLuaRegister(), DetectMetadataFree(), DetectModbusRegister(), DetectNfsProcedureRegister(), DetectNfsVersionRegister(), DetectNocaseRegister(), DetectPcrePayloadMatch(), DetectPktDataRegister(), DetectPortHashLookup(), DetectPrefilterRegister(), DetectRawbytesRegister(), DetectReferenceFree(), DetectRpcFree(), DetectSNMPPduTypeRegister(), DetectSNMPVersionRegister(), DetectSshSoftwareVersionRegister(), DetectSshVersionRegister(), DetectSslVersionRegister(), DetectTlsCertsRegister(), DetectTlsRegister(), DetectTlsValidityRegister(), DetectTlsVersionRegister(), DetectTransformCompressWhitespaceRegister(), DetectTransformMd5Register(), DetectTransformSha1Register(), DetectTransformSha256Register(), DetectTransformStripWhitespaceRegister(), DetectUricontentRegister(), DetectUrilenRegister(), EngineAnalysisRulesFailure(), FileAppendData(), FileAppendDataById(), FileAppendGAPById(), FileCloseFile(), FileCloseFileById(), FileCloseFilePtr(), FileContainerSetTx(), FileDisableFilesize(), FileDisableMagic(), FileDisableMd5(), FileDisableSha1(), FileDisableSha256(), FileDisableStoring(), FileDisableStoringForTransaction(), FileSetRange(), FileStoreAllFiles(), FileStoreAllFilesForTx(), FileStoreFileById(), FileTrackedSize(), FileTruncateAllOpenFiles(), FlowClearMemory(), FlowInit(), FlowUpdateSpareFlows(), FTPMemcapGlobalCounter(), HTPAtExitPrintStats(), HtpBodyAppendChunk(), HtpBodyFree(), HtpBodyPrint(), HtpBodyPrune(), HTPConfigure(), HTPFileClose(), HTPFileSetRange(), HTPFileStoreChunk(), HTPFreeConfig(), HTPStateFree(), IPFWSetVerdict(), IPOnlyCIDRListFree(), JsonBuildFileInfoRecord(), JsonDNSLogAnswer(), LiveDeviceListClean(), LogHttpLogger(), LogTcpDataLogger(), NapatechDecode(), NapatechDecodeThreadInit(), NapatechStreamThreadDeinit(), NapatechStreamThreadInit(), NoNFLOGSupportExit(), NoWinDivertSupportExit(), PacketAlertFinalize(), PacketAlertGetTag(), PacketAlertThreshold(), PacketCreateMask(), PacketDefragPktSetup(), PacketTunnelPktSetup(), PcapDirectoryDispatch(), PcapFileDispatch(), PcapFileGlobalInit(), PmqSetup(), PoolGet(), PoolReturn(), PostRunDeinit(), Prefilter(), PrefilterGenericMpmRegister(), PrefilterPktStreamRegister(), printUUID(), ReceiveAFPLoop(), ReceiveAFPThreadExitStats(), ReceiveAFPThreadInit(), ReceiveErfDagLoop(), ReceiveErfDagThreadDeinit(), ReceiveErfDagThreadInit(), ReceiveErfFileLoop(), ReceiveErfFileThreadInit(), ReceiveIPFWLoop(), ReceiveIPFWThreadDeinit(), ReceiveIPFWThreadExitStats(), ReceiveIPFWThreadInit(), ReceiveNFQLoop(), ReceivePcapBreakLoop(), ReceivePcapLoop(), ReceivePcapThreadExitStats(), ReceivePcapThreadInit(), ReceivePfringLoop(), RegisterAllModules(), RegisterDNP3Parsers(), RegisterENIPTCPParsers(), RegisterENIPUDPParsers(), RegisterHTPParsers(), RegisterModbusParsers(), RejectSendIPv4ICMP(), RejectSendIPv4TCP(), RejectSendIPv6ICMP(), RejectSendIPv6TCP(), RunModeErfFileAutoFp(), RunModeErfFileSingle(), RunModeFilePcapAutoFp(), RunModeIdsAFPAutoFp(), RunModeIdsAFPSingle(), RunModeIdsAFPWorkers(), RunModeIdsErfDagAutoFp(), RunModeIdsErfDagSingle(), RunModeIdsErfDagWorkers(), RunModeIdsNetmapAutoFp(), RunModeIdsNetmapSingle(), RunModeIdsNetmapWorkers(), RunModeIdsNflogAutoFp(), RunModeIdsNflogSingle(), RunModeIdsNflogWorkers(), RunModeIdsPcapAutoFp(), RunModeIdsPcapSingle(), RunModeIdsPcapWorkers(), RunModeIdsPfringAutoFp(), RunModeIdsPfringSingle(), RunModeIdsPfringWorkers(), RunModeIpsIPFWAutoFp(), RunModeIpsIPFWWorker(), RunModeIpsNFQAutoFp(), RunModeIpsNFQWorker(), RunModeIpsWinDivertAutoFp(), RunModeSetIPSAutoFp(), SCPidfileCreate(), SCRuleVarsGetConfVar(), SigAddressPrepareStage4(), SigAlloc(), SigGroupHeadContainsSigId(), SigGroupHeadHashLookup(), SigGroupHeadPrintSigs(), SigInit(), SigLoadSignatures(), SigMatchList2DataArray(), SigMatchListSMBelongsTo(), SigMatchSignaturesGetSgh(), SignatureHasPacketContent(), SignatureHasStreamContent(), SigParseApplyDsizeToContent(), SMTPProcessDataChunk(), StatsSetUI64(), StatsSpawnThreads(), StreamReassembleLog(), StreamReassembleRawUpdateProgress(), StreamTcpInlineSegmentCompare(), StreamTcpInlineSegmentReplacePacket(), StreamTcpPacket(), StreamTcpPruneSession(), StreamTcpPseudoPacketCreateStreamEndPacket(), StreamTcpPseudoSetup(), StreamTcpReassembleAppLayer(), StreamTcpReassembleDepthReached(), StreamTcpReassembleFreeThreadCtx(), StreamTcpReassembleHandleSegment(), StreamTcpReassembleHandleSegmentHandleData(), StreamTcpReassembleInitThreadCtx(), StreamTcpReassembleInsertSegment(), StreamTcpSackFreeList(), StreamTcpSackPruneList(), StreamTcpSessionCleanup(), StreamTcpSessionClear(), StreamTcpSessionPktFree(), StreamTcpThreadDeinit(), StreamTcpThreadInit(), TagHandlePacket(), TagHashAddTag(), ThresholdIPPairTimeoutCheck(), TmModuleDecodeNetmapRegister(), TmModuleDecodePcapRegister(), TmqhOutputPacketpool(), TmThreadSetPrio(), UTHPacketMatchSigMpm(), VerdictIPFW(), VerdictIPFWThreadDeinit(), and VerdictIPFWThreadInit().

#define SCLog (   x,
  file,
  func,
  line,
  ... 
)
Value:
do { \
SCLogMatchFGFilterWL(file, func, line) == 1 || \
SCLogMatchFGFilterBL(file, func, line) == 1) && \
SCLogMatchFDFilter(func) == 1)) \
{ \
char _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN]; \
\
int _sc_log_ret = snprintf(_sc_log_msg, SC_LOG_MAX_LOG_MSG_LEN, __VA_ARGS__); \
if (_sc_log_ret == SC_LOG_MAX_LOG_MSG_LEN) \
_sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN - 1] = '\0'; \
SCLogMessage(x, file, line, func, SC_OK, _sc_log_msg); \
} \
} while(0)
int SCLogMatchFDFilter(const char *function)
Checks if there is a match for the incoming log_message with any of the FD filters.
int SCLogMatchFGFilterWL(const char *file, const char *function, int line)
Checks if there is a match for the incoming log_message with any of the FG filters. If there is a match, it allows the message to be logged, else it rejects that message.
#define SC_LOG_MAX_LOG_MSG_LEN
Definition: util-debug.h:90
int SCLogMatchFGFilterBL(const char *file, const char *function, int line)
Checks if there is a match for the incoming log_message with any of the FG filters. If there is a match it rejects the logging for that messages, else it allows that message to be logged.
SCLogLevel sc_log_global_log_level
Holds the global log level. Is the same as sc_log_config->log_level.
Definition: util-debug.c:97
SCError SCLogMessage(const SCLogLevel, const char *, const unsigned int, const char *, const SCError, const char *message)
Adds the global log_format to the outgoing buffer.
Definition: util-debug.c:548
int sc_log_fd_filters_present
int sc_log_fg_filters_present

Definition at line 211 of file util-debug.h.

Referenced by NapatechStreamThreadInit().

#define SCLogAlert (   err_code,
  ... 
)
Value:
__FILE__, __FUNCTION__, __LINE__, \
err_code, __VA_ARGS__)
#define SCLogErr(x, file, func, line, err,...)
Definition: util-debug.h:230

Macro used to log ALERT messages.

Return values
err_codeError code that has to be logged along with the alert message
...Takes as argument(s), a printf style format message

Definition at line 317 of file util-debug.h.

#define SCLogConfig (   ...)
Value:
__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
#define SCLog(x, file, func, line,...)
Definition: util-debug.h:211

Definition at line 259 of file util-debug.h.

#define SCLogCritical (   err_code,
  ... 
)
Value:
__FILE__, __FUNCTION__, __LINE__, \
err_code, __VA_ARGS__)
#define SCLogErr(x, file, func, line, err,...)
Definition: util-debug.h:230

Macro used to log CRITICAL messages.

Return values
err_codeError code that has to be logged along with the critical message
...Takes as argument(s), a printf style format message

Definition at line 307 of file util-debug.h.

Referenced by MpmACBSRegister().

#define SCLogDebug (   ...)    do { } while (0)

Definition at line 335 of file util-debug.h.

Referenced by ActionInitConfig(), AddressDebugPrint(), AffinityGetNextCPU(), AffinitySetupLoadFromConfig(), AFPIsFanoutSupported(), AFPSetBPFFilter(), AlertFastLogInitCtx(), AlertFastLogThreadInit(), AppLayerExpectationHandle(), AppLayerHandleTCPData(), AppLayerHandleUdp(), AppLayerHtpPrintStats(), AppLayerIncTxCounter(), AppLayerParserConfParserEnabled(), AppLayerParserDestroyProtocolParserLocalStorage(), AppLayerParserParse(), AppLayerParserSetTransactionInspectId(), AppLayerParserStreamTruncated(), AppLayerParserTransactionsCleanup(), AppLayerParserTriggerRawStreamReassembly(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectGetProto(), AppLayerProtoDetectPPParseConfPorts(), AppLayerRegisterParser(), AppLayerRegisterProtocolDetection(), BasicSearch(), ByteExtractString(), ByteExtractStringUint16(), ByteExtractStringUint32(), ByteExtractStringUint8(), CheckValidDaemonModes(), CleanupPcapFileFileVars(), ConfDeInit(), ConfGet(), ConfGetChildValue(), ConfGetValue(), ConfInit(), ConfLoadCompleteIncludePath(), CoredumpLoadConfig(), CreateGroupedPortList(), CreateGroupedPortListCmpCnt(), Daemonize(), DCERPCParser(), DecodeBase64(), DecodeCIPPDU(), DecodeCIPRequestMSPPDU(), DecodeCIPRequestPathPDU(), DecodeCIPRequestPDU(), DecodeCIPResponseMSPPDU(), DecodeCIPResponsePDU(), DecodeCommonPacketFormatPDU(), DecodeENIPPDU(), DecodeERSPAN(), DecodeEthernet(), DecodeGRE(), DecodeICMPV4(), DecodeICMPV6(), DecodeIPFW(), DecodeIPV4(), DecodeIPV6(), DecodeIPV6FragHeader(), DecodeNFQ(), DecodeNull(), DecodePPP(), DecodePPPOEDiscovery(), DecodePPPOESession(), DecodeRaw(), DecodeSCTP(), DecodeSll(), DecodeTCP(), DecodeThreadVarsAlloc(), DecodeTunnel(), DecodeUDP(), DecodeVLAN(), DefragInitConfig(), DefragPolicyGetHostTimeout(), DefragPolicyLoadFromConfig(), DefragRbFragCompare(), DefragSetDefaultTimeout(), DefragTrackerFreeFrags(), Detect(), DetectAckRegister(), DetectAddressAdd(), DetectAddressCmpIPv4(), DetectAddressCmpIPv6(), DetectAddressCutIPv4(), DetectAddressInsert(), DetectAddressLookupInHead(), DetectAddressMatch(), DetectAddressMergeNot(), DetectAddressParse(), DetectAddressParseString(), DetectAddressPrint(), DetectAddressTestConfVars(), DetectAppLayerInspectEngineRegister2(), DetectAppLayerMpmRegister(), DetectAppLayerMpmRegister2(), DetectAppLayerMpmRegisterByParentId(), DetectBase64DecodeDoMatch(), DetectBufferGetActiveList(), DetectBufferTypeGetByIdTransforms(), DetectBufferTypeMaxId(), DetectBufferTypeSupportsMpm(), DetectBufferTypeSupportsMpmGetById(), DetectBufferTypeSupportsPacket(), DetectBufferTypeSupportsPacketGetById(), DetectBufferTypeSupportsTransformations(), DetectByteExtractDoMatch(), DetectBytejumpDoMatch(), DetectBytetestDoMatch(), DetectCipServiceRegister(), DetectContentDataParse(), DetectContentPrint(), DetectContentPropagateLimits(), DetectDceIfaceRegister(), DetectDceOpnumRegister(), DetectDceStubDataRegister(), DetectDsizeRegister(), DetectEngineAddToMaster(), DetectEngineAppInspectionEngine2Signature(), DetectEngineBumpVersion(), DetectEngineContentInspection(), DetectEngineCtxFree(), DetectEngineEventRegister(), DetectEngineGetCurrent(), DetectEngineInspectBufferGeneric(), DetectEngineInspectCIP(), DetectEngineInspectENIP(), DetectEngineInspectGenericList(), DetectEngineInspectModbus(), DetectEngineInspectStream(), DetectEngineMoveToFreeList(), DetectEngineMTApply(), DetectEngineMultiTenantEnabled(), DetectEngineMultiTenantSetup(), DetectEnginePruneFreeList(), DetectEngineReload(), DetectEngineResetMaxSigId(), DetectEngineStateFree(), DetectEngineStateResetTxs(), DetectEngineThreadCtxInit(), DetectFileextRegister(), DetectFileInspectGeneric(), DetectFilemagicRegister(), DetectFileMd5Register(), DetectFilenameRegister(), DetectFileSha1Register(), DetectFileSha256Register(), DetectFilesizeRegister(), DetectFilestoreRegister(), DetectFlagsRegister(), DetectFlagsSignatureNeedsSynOnlyPackets(), DetectFlowbitMatch(), DetectFlowbitsAnalyze(), DetectFlowintFree(), DetectFlowintMatch(), DetectFlowMatch(), DetectFlowSetupImplicit(), DetectFlowvarMatch(), DetectFlowvarPostMatchSetup(), DetectFragOffsetFree(), DetectFragOffsetRegister(), DetectFtpbounceRegister(), DetectFtpdataRegister(), DetectGeoipRegister(), DetectHttpClientBodyRegister(), DetectHttpCookieRegister(), DetectHttpHeaderNamesRegister(), DetectHttpMethodRegister(), DetectHttpStartRegister(), DetectHttpUARegister(), DetectHttpUriSetup(), DetectIcmpIdFree(), DetectIcmpIdRegister(), DetectIcmpSeqFree(), DetectIcmpSeqRegister(), DetectICodeFree(), DetectIdFree(), DetectIdRegister(), DetectIPRepFree(), DetectIPRepRegister(), DetectIsdataatSetup(), DetectITypeFree(), DetectL3ProtoRegister(), DetectLoadCompleteSigPath(), DetectLoaderQueueTask(), DetectLoadersSync(), DetectLuaRegister(), DetectMarkRegister(), DetectMetadataHashFree(), DetectMpmInitializeAppMpms(), DetectMpmSetupAppMpms(), DetectMsgRegister(), DetectNfsProcedureRegister(), DetectNfsVersionRegister(), DetectOffsetRegister(), DetectParseAddress(), DetectPcrePayloadMatch(), DetectPcreRegister(), DetectPktvarRegister(), DetectPortHashFree(), DetectPortInsert(), DetectPortIsValidRange(), DetectPortListsAreEqual(), DetectPortParse(), DetectPortPrint(), DetectPortPrintList(), DetectPortTestConfVars(), DetectProtoContainsProto(), DetectProtoParse(), DetectReferenceFree(), DetectReplaceAddToList(), DetectReplaceExecuteInternal(), DetectReplaceFreeInternal(), DetectRpcFree(), DetectRpcRegister(), DetectRunPrefilterTx(), DetectRunStoreStateTx(), DetectSeqRegister(), DetectSetupParseRegexes(), DetectSignatureApplyActions(), DetectSNMPPduTypeRegister(), DetectSNMPVersionRegister(), DetectSshSoftwareVersionRegister(), DetectSshVersionRegister(), DetectSslStateRegister(), DetectSslVersionRegister(), DetectStreamSizeRegister(), DetectTagRegister(), DetectTemplate2Free(), DetectTemplate2Register(), DetectTemplateRegister(), DetectTlsRegister(), DetectTlsValidityRegister(), DetectTlsVersionRegister(), DetectTosRegister(), DetectTtlFree(), DetectTtlRegister(), DetectUricontentRegister(), DetectUrilenApplyToContent(), DetectUrilenRegister(), DetectUrilenValidateContent(), DetectXbitMatchHost(), DetectXbitsRegister(), DNSCreateRcodeString(), FileAppendGAPById(), FileCloseFilePtr(), FileContainerSetTx(), FileDataSize(), FileDisableFilesize(), FileDisableMagic(), FileDisableMd5(), FileDisableSha1(), FileDisableSha256(), FileDisableStoring(), FileDisableStoringForTransaction(), FilePrune(), FileSetRange(), FileSetTx(), FileTrackedSize(), FlowGetFlowFromHash(), FlowHandlePacketUpdate(), FlowInit(), FlowInitConfig(), FlowVarPrint(), FTPAtExitPrintStats(), GenericVarFree(), GetAffinityTypeFromName(), GetIfaceMaxPacketSize(), HashListTableAdd(), HashListTableLookup(), HashListTableRemove(), HostGetActiveCount(), HostInitConfig(), HTPAtExitPrintStats(), HtpBodyAppendChunk(), HtpBodyFree(), HtpBodyPrint(), HtpBodyPrune(), HtpConfigRestoreBackup(), HTPConfigure(), HTPFileClose(), HTPFileOpen(), HTPFileSetRange(), HTPFileStoreChunk(), HTPFreeConfig(), HTPStateFree(), HttpHeaderExpandBuffer(), HttpHeaderThreadDataFree(), HttpXFFGetIP(), HttpXFFGetIPFromTx(), InitPcapFile(), InspectionBufferApplyTransforms(), InspectionBufferMultipleForListGet(), IPFWRegisterQueue(), IPFWSetVerdict(), IPOnlyCIDRListFree(), IPOnlyMatchPacket(), IPOnlyPrepare(), IPOnlySigParseAddress(), IPPairGetActiveCount(), IPPairInitConfig(), IPv4AddressStringIsValid(), IPv6AddressStringIsValid(), JsonBuildFileInfoRecord(), LiveDeviceFinalize(), LiveRegisterDevice(), LiveRegisterDeviceName(), LogCustomFormatAddNode(), LogFilestoreRegister(), LogHttpLogInitCtx(), LogHttpLogThreadInit(), LogStatsLogThreadDeinit(), LogStatsLogThreadInit(), LogTcpDataLogInitCtx(), LogTcpDataLogThreadInit(), LogTlsStoreRegister(), MemBufferExpand(), MimeDecAddEntity(), MimeDecDeInitParser(), MimeDecParseComplete(), MimeDecParseFullMsg(), MimeDecParseLine(), MimeDecParseStateGetStatus(), MpmAddPattern(), MpmStoreFree(), MpmStorePrepareBuffer(), MpmStoreReportStats(), NapatechGetStreamConfig(), NapatechPacketLoopZC(), NapatechStreamThreadDeinit(), NapatechStreamThreadInit(), NFQInitConfig(), NFQRegisterQueue(), NoNFLOGSupportExit(), NoWinDivertSupportExit(), OutputFlowLog(), OutputFlowLogThreadInit(), OutputJsonRegister(), OutputRegisterFiledataLogger(), OutputRegisterFiledataModule(), OutputRegisterFiledataSubModule(), OutputRegisterFileLogger(), OutputRegisterFileModule(), OutputRegisterFileSubModule(), OutputRegisterFlowLogger(), OutputRegisterFlowModule(), OutputRegisterFlowSubModule(), OutputRegisterPacketLogger(), OutputRegisterPacketModule(), OutputRegisterPacketSubModule(), OutputRegisterStatsLogger(), OutputRegisterStatsModule(), OutputRegisterStatsSubModule(), OutputRegisterStreamingLogger(), OutputRegisterStreamingModule(), OutputRegisterStreamingSubModule(), OutputRegisterTxLogger(), OutputStatsLog(), PacketAlertAppend(), PacketAlertFinalize(), PacketAlertGetTag(), PacketAlertRemove(), PacketCreateMask(), PacketGetFromAlloc(), PacketPoolInit(), PacketPoolPostRunmodes(), PacketTunnelPktSetup(), PatternMatchDestroy(), PatternMatchPrepareGroup(), PatternMatchThreadDestroy(), PatternMatchThreadPrepare(), PatternMatchThreadPrint(), PcapDetermineDirectoryOrFile(), PcapDirectoryDispatch(), PcapFileGlobalInit(), PoolGet(), PoolPrintSaturation(), PoolReturn(), PoolThreadExpand(), PoolThreadInit(), PoolThreadReturn(), PostRunDeinit(), PrefilterInit(), PrefilterSetupRuleGroup(), printUUID(), ReceiveAFPLoop(), ReceiveErfDagLoop(), ReceiveIPFWLoop(), ReceiveNFQThreadInit(), RegisterENIPTCPParsers(), RegisterENIPUDPParsers(), RegisterNFSTCPParsers(), RegisterNFSUDPParsers(), RegisterSSHParsers(), RegisterSSLParsers(), RegisterTFTPParsers(), RetrieveFPForSig(), RuleMatchCandidateTxArrayFree(), RuleMatchCandidateTxArrayInit(), RunmodeAutoFpCreatePickupQueuesString(), RunModeErfFileAutoFp(), RunModeFilePcapAutoFp(), RunModeIdsAFPAutoFp(), RunModeIdsAFPRegister(), RunModeIdsAFPSingle(), RunModeIdsAFPWorkers(), RunModeIdsNetmapAutoFp(), RunModeIdsNetmapSingle(), RunModeIdsNetmapWorkers(), RunModeIdsPcapRegister(), RunModeIdsPfringRegister(), RunModeInitialize(), RunModeInitializeOutputs(), RunModeNapatechRegister(), RunModeRegisterNewRunMode(), RunModeSetIPSAutoFp(), RunModeSetLiveCaptureAutoFp(), RunModeShutDown(), SBB_RB_FIND_INCLUSIVE(), SBBCompare(), SCACBSPreparePatterns(), SCACPreparePatterns(), SCACTilePreparePatterns(), SCAsn1Decode(), SCAsn1LoadConfig(), SCClassConfClasstypeHashCompareFunc(), SCClassConfDeInitContext(), SCClassConfGenerateInValidDummyClassConfigFD02(), SCClassConfGenerateInValidDummyClassConfigFD03(), SCClassConfGenerateValidDummyClassConfigFD01(), SCClassConfInit(), SCConfLogReopen(), SCKernelVersionIsAtLeast(), SCLogLoadConfig(), SCMapEnumNameToValue(), SCMapEnumValueToName(), SCProfilingKeywordsGlobalInit(), SCProfilingPrefilterGlobalInit(), SCProfilingPrefilterInitCounters(), SCProfilingSghsGlobalInit(), SCRadixAddKeyIPV6String(), SCRadixReleaseRadixTree(), SCRConfDeInitContext(), SCRConfGenerateInValidDummyReferenceConfigFD02(), SCRConfGenerateInValidDummyReferenceConfigFD03(), SCRConfGenerateValidDummyReferenceConfigFD01(), SCRConfReferenceHashCompareFunc(), SCReferenceConfInit(), SCRuleVarsGetConfVar(), SCSigOrderSignatures(), SCSigRegisterSignatureOrderingFuncs(), SCThresholdConfInitContext(), SCThresholdConfParseFile(), SigAddressCleanupStage1(), SigAddressPrepareStage1(), SigAddressPrepareStage2(), SigAddressPrepareStage4(), SigAlloc(), SigGroupHeadFree(), SigGroupHeadPrintSigs(), SigGroupHeadSetFileHashFlag(), SigGroupHeadSetProtoAndDirection(), SigMatchList2DataArray(), SigMatchListSMBelongsTo(), SigMatchSignaturesGetSgh(), SignatureHasPacketContent(), SignatureHasStreamContent(), SignatureIsIPOnly(), SigParseApplyDsizeToContent(), SigParseSetDsizePair(), SigTableRegisterTests(), SMTPProcessDataChunk(), SMTPStateAlloc(), SRepHostTimedOut(), SRepInit(), SRepLoadCatFileFromFD(), SRepLoadFileFromFD(), SRepReloadComplete(), SRepResetVersion(), SSLSetEvent(), SSLVersionToString(), StatsSetUI64(), StatsUpdateCounterArray(), StorageAllocById(), StorageAllocByIdPrealloc(), StorageFinalize(), StorageFreeById(), StorageGetById(), StorageSetById(), StreamingBufferClear(), StreamingBufferCompareRawData(), StreamingBufferFree(), StreamingBufferInsertAt(), StreamingBufferSlide(), StreamingBufferSlideToOffset(), StreamNeedsReassembly(), StreamReassembleRawUpdateProgress(), StreamTcp(), StreamTcpDecrMemuse(), StreamTcpFreeConfig(), StreamTcpGetSegment(), StreamTcpIncrMemuse(), StreamTcpInitConfig(), StreamTcpInlineSegmentCompare(), StreamTcpInlineSegmentReplacePacket(), StreamTcpPacket(), StreamTcpPruneSession(), StreamTcpPseudoPacketCreateStreamEndPacket(), StreamTcpReassembleAppLayer(), StreamTcpReassembleDecrMemuse(), StreamTcpReassembleDepthReached(), StreamTcpReassembleGetMemcap(), StreamTcpReassembleHandleSegment(), StreamTcpReassembleHandleSegmentHandleData(), StreamTcpReassembleIncrMemuse(), StreamTcpReassembleInitThreadCtx(), StreamTcpReassembleInsertSegment(), StreamTcpReassembleTriggerRawReassembly(), StreamTcpReassemblySetMinInspectDepth(), StreamTcpSackPruneList(), StreamTcpSackUpdatePacket(), StreamTcpSegmentForEach(), StreamTcpSetOSPolicy(), StreamTcpThreadDeinit(), StreamTcpThreadInit(), SupportFastPatternForSigMatchList(), TagFlowAdd(), TagHashAddTag(), TagTimeoutCheck(), TAILQ_HEAD(), TcpSackCompare(), TcpSegmentCompare(), ThresholdIPPairTimeoutCheck(), TimeGet(), TimeModeSetLive(), TimeModeSetOffline(), TimeSet(), TLSGetIPInformations(), TmModuleBypassedFlowManagerRegister(), TmModuleDebugList(), TmModuleDecodeAFPRegister(), TmModuleDecodeNetmapRegister(), TmModuleDecodePcapRegister(), TmModuleDecodePfringRegister(), TmModuleDetectLoaderRegister(), TmModuleFlowManagerRegister(), TmModuleFlowRecyclerRegister(), TmqCreateQueue(), TmqhOutputFlowSetupCtx(), TmqhOutputPacketpool(), TmqhOutputSimple(), TmreadsGetMinimalTimestamp(), TmSlotGetSlotForTM(), TmThreadCreate(), TmThreadDisablePacketThreads(), TmThreadDisableReceiveThreads(), TmThreadKillThreads(), TmThreadRemove(), TmThreadSetPrio(), TmThreadsSlotVarRun(), Unified2AlertThreadInit(), UnixSocketPcapFile(), UtilCpuGetNumProcessorsConfigured(), UtilCpuGetNumProcessorsMax(), UtilCpuGetNumProcessorsOnline(), UtilCpuPrintSummary(), VarNameStoreFree(), VarNameStoreFreeOld(), VarNameStoreLookupByName(), VarNameStoreSetupStaging(), VerdictIPFW(), and VerdictNFQ().

#define SCLogEmerg (   err_code,
  ... 
)
Value:
__FILE__, __FUNCTION__, __LINE__, \
err_code, __VA_ARGS__)
#define SCLogErr(x, file, func, line, err,...)
Definition: util-debug.h:230

Macro used to log EMERGENCY messages.

Return values
err_codeError code that has to be logged along with the emergency message
...Takes as argument(s), a printf style format message

Definition at line 327 of file util-debug.h.

#define SCLogErr (   x,
  file,
  func,
  line,
  err,
  ... 
)
Value:
do { \
SCLogMatchFGFilterWL(file, func, line) == 1 || \
SCLogMatchFGFilterBL(file, func, line) == 1) && \
SCLogMatchFDFilter(func) == 1)) \
{ \
char _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN]; \
\
int _sc_log_ret = snprintf(_sc_log_msg, SC_LOG_MAX_LOG_MSG_LEN, __VA_ARGS__); \
if (_sc_log_ret == SC_LOG_MAX_LOG_MSG_LEN) \
_sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN - 1] = '\0'; \
SCLogMessage(x, file, line, func, err, _sc_log_msg); \
} \
} while(0)
int SCLogMatchFDFilter(const char *function)
Checks if there is a match for the incoming log_message with any of the FD filters.
int SCLogMatchFGFilterWL(const char *file, const char *function, int line)
Checks if there is a match for the incoming log_message with any of the FG filters. If there is a match, it allows the message to be logged, else it rejects that message.
#define SC_LOG_MAX_LOG_MSG_LEN
Definition: util-debug.h:90
int SCLogMatchFGFilterBL(const char *file, const char *function, int line)
Checks if there is a match for the incoming log_message with any of the FG filters. If there is a match it rejects the logging for that messages, else it allows that message to be logged.
SCLogLevel sc_log_global_log_level
Holds the global log level. Is the same as sc_log_config->log_level.
Definition: util-debug.c:97
SCError SCLogMessage(const SCLogLevel, const char *, const unsigned int, const char *, const SCError, const char *message)
Adds the global log_format to the outgoing buffer.
Definition: util-debug.c:548
int sc_log_fd_filters_present
int sc_log_fg_filters_present

Definition at line 230 of file util-debug.h.

#define SCLogError (   err_code,
  ... 
)
Value:
__FILE__, __FUNCTION__, __LINE__, \
err_code, __VA_ARGS__)
#define SCLogErr(x, file, func, line, err,...)
Definition: util-debug.h:230

Macro used to log ERROR messages.

Return values
err_codeError code that has to be logged along with the error message
...Takes as argument(s), a printf style format message

Definition at line 294 of file util-debug.h.

Referenced by ActionInitConfig(), AffinityGetNextCPU(), AffinitySetupLoadFromConfig(), AFPGetLinkType(), AFPIsFanoutSupported(), AFPPeersListCheck(), AFPRunModeIsIPS(), AFPSetBPFFilter(), AppLayerGetPktEventInfo(), AppLayerHtpPrintStats(), AppLayerParserConfParserEnabled(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectPPParseConfPorts(), AppLayerProtoDetectSetup(), AppLayerRegisterExpectationProto(), BoyerMooreCtxInit(), BuildCpusetWithCallback(), ByteExtractStringInt16(), ByteExtractStringInt32(), ByteExtractStringInt8(), ByteExtractStringSigned(), CheckValidDaemonModes(), CleanupPcapFileDirectoryVars(), ConfGetChildValueInt(), ConfGetInt(), ConfGetNode(), ConfGetValue(), ConfInit(), ConfUnixSocketIsEnable(), ConfYamlLoadFile(), ConfYamlLoadFileWithPrefix(), CoredumpLoadConfig(), Daemonize(), DecodeAFP(), DecodeErfDag(), DecodePcap(), DecodeThreadVarsAlloc(), DefragInit(), DefragInitConfig(), DefragPolicyGetHostTimeout(), DefragPolicyLoadFromConfig(), DefragTrackerFreeFrags(), DefragTrackerQueueNew(), DetectAddressMergeNot(), DetectAddressParseString(), DetectAddressTestConfVars(), DetectAppLayerEventRegister(), DetectAppLayerInspectEngineRegister(), DetectAppLayerInspectEngineRegister2(), DetectAsn1Register(), DetectBase64DataRegister(), DetectBase64DecodeDoMatch(), DetectBufferTypeGetByIdTransforms(), DetectBypassRegister(), DetectByteExtractDoMatch(), DetectBytejumpDoMatch(), DetectBytetestDoMatch(), DetectCipServiceRegister(), DetectClasstypeRegister(), DetectContentDataParse(), DetectContentPMATCHValidateCallback(), DetectDceIfaceRegister(), DetectDceOpnumRegister(), DetectDepthRegister(), DetectDetectionFilterRegister(), DetectDistanceRegister(), DetectDsizeRegister(), DetectEngineAppendSig(), DetectEngineContentModifierBufferSetup(), DetectEngineCtxFree(), DetectEngineEventRegister(), DetectEngineGetEventInfo(), DetectEngineInspectBufferGeneric(), DetectEngineMultiTenantEnabled(), DetectEngineMultiTenantSetup(), DetectEngineReload(), DetectEngineReloadTenantBlocking(), DetectEngineResetMaxSigId(), DetectEnipCommandRegister(), DetectFastPatternRegister(), DetectFilemagicRegister(), DetectFilesizeRegister(), DetectFilestoreRegister(), DetectFlagsRegister(), DetectFlowbitMatch(), DetectFlowintMatch(), DetectFlowMatch(), DetectFlowSetupImplicit(), DetectFlowvarMatch(), DetectFragBitsRegister(), DetectFragOffsetRegister(), DetectFtpdataRegister(), DetectGeoipRegister(), DetectGidRegister(), DetectHttpMethodRegister(), DetectHttpRawHeaderRegister(), DetectIcmpIdRegister(), DetectIcmpSeqRegister(), DetectIdRegister(), DetectIPProtoRegister(), DetectIPRepRegister(), DetectIsdataatFree(), DetectIsdataatRegister(), DetectIsdataatSetup(), DetectL3ProtoRegister(), DetectLoadCompleteSigPath(), DetectLoadersInit(), DetectLoadersSync(), DetectLuaRegister(), DetectMarkRegister(), DetectMetadataHashFree(), DetectMsgRegister(), DetectNfsProcedureRegister(), DetectNfsVersionRegister(), DetectNoalertRegister(), DetectNocaseRegister(), DetectOffsetRegister(), DetectPcrePayloadMatch(), DetectPktDataRegister(), DetectPktvarRegister(), DetectPortListsAreEqual(), DetectPortTestConfVars(), DetectPrefilterRegister(), DetectPriorityRegister(), DetectRawbytesRegister(), DetectReferenceFree(), DetectReplaceRegister(), DetectRevRegister(), DetectRpcRegister(), DetectSidRegister(), DetectSignatureAddTransform(), DetectSignatureSetAppProto(), DetectSNMPPduTypeRegister(), DetectSNMPVersionRegister(), DetectSshSoftwareVersionRegister(), DetectSshVersionRegister(), DetectSslStateRegister(), DetectSslVersionRegister(), DetectStreamSizeRegister(), DetectTagRegister(), DetectTargetRegister(), DetectTemplate2Register(), DetectTemplateRegister(), DetectThresholdRegister(), DetectTlsJa3SHashRegister(), DetectTlsRegister(), DetectTlsValidityRegister(), DetectTlsVersionRegister(), DetectTosRegister(), DetectTransformMd5Register(), DetectTransformSha1Register(), DetectTransformSha256Register(), DetectTtlRegister(), DetectUricontentRegister(), DetectUrilenRegister(), DetectUrilenValidateContent(), DetectWindowRegister(), DetectWithinRegister(), DetectXbitMatchHost(), DetectXbitsRegister(), DNSStateGetEventInfo(), EngineAnalysisFP(), EngineAnalysisRulesFailure(), EngineDone(), FileContainerAlloc(), FileContainerFree(), FlowInitConfig(), FlowManagerThreadSpawn(), FlowQueueNew(), FlowRecyclerThreadSpawn(), GetIfaceMaxPacketSize(), HostBitInitCtx(), HostInitConfig(), HostQueueNew(), HTPConfigure(), HTPFreeConfig(), HTPParseMemcap(), InitPcapFile(), IPFWRegisterQueue(), IPOnlyCIDRListFree(), IPOnlyInit(), IPOnlyPrepare(), IPOnlySigParseAddress(), IPPairBitInitCtx(), IPPairInitConfig(), IPPairQueueNew(), Ja3BufferAddValue(), Ja3BufferAppendBuffer(), Ja3BufferFree(), Ja3GenerateHash(), LogCustomFormatAlloc(), LogCustomFormatNodeAlloc(), LogHttpLogInitCtx(), LogStatsLogThreadDeinit(), LogTcpDataLogInitCtx(), main(), MimeDecAddEntity(), MimeDecAddField(), MimeDecFindField(), MimeDecInitParser(), MpmACBSRegister(), MpmFactoryGetMpmCtxForProfile(), MpmFactoryRegisterMpmCtxProfile(), NapatechDecode(), NapatechGetStreamConfig(), NapatechPacketLoopZC(), NapatechSetupTraffic(), NapatechStartStats(), NapatechStreamThreadInit(), NFQInitConfig(), NFQParseAndRegisterQueues(), NFQRegisterQueue(), NoNFLOGSupportExit(), NoWinDivertSupportExit(), OutputJsonRegister(), OutputRegisterFiledataLogger(), OutputRegisterFiledataModule(), OutputRegisterFiledataSubModule(), OutputRegisterFileModule(), OutputRegisterFileRotationFlag(), OutputRegisterFileSubModule(), OutputRegisterFlowModule(), OutputRegisterFlowSubModule(), OutputRegisterPacketModule(), OutputRegisterPacketSubModule(), OutputRegisterStatsModule(), OutputRegisterStatsSubModule(), OutputRegisterStreamingModule(), OutputRegisterStreamingSubModule(), OutputRegisterTxLogger(), PacketPoolInit(), ParseSizeDeinit(), ParseSizeInit(), PatternMatchDefaultMatcher(), PcapDetermineDirectoryOrFile(), PcapDirectoryDispatch(), PcapFileDispatch(), PcapFileGlobalInit(), PcapLogProfileSetup(), PerCentEncodingMatch(), PerCentEncodingSetup(), PoolInit(), PoolThreadExpand(), PostRunDeinit(), PrefilterAddSidsResize(), PrintInet(), ReceiveAFPLoop(), ReceiveAFPThreadInit(), ReceiveErfDagLoop(), ReceiveErfDagThreadInit(), ReceiveErfFileLoop(), ReceiveErfFileThreadInit(), ReceiveIPFWThreadInit(), ReceiveNFQThreadInit(), ReceivePcapLoop(), ReceivePcapThreadExitStats(), ReceivePcapThreadInit(), ReceivePfringLoop(), ReceivePfringThreadInit(), RegisterAllModules(), RegisterModbusParsers(), RegisterSMBParsers(), RejectSendLibnet11L3IPv4ICMP(), RejectSendLibnet11L3IPv4TCP(), RejectSendLibnet11L3IPv6ICMP(), RejectSendLibnet11L3IPv6TCP(), ROHashInit(), ROHashInitFinalize(), ROHashInitQueueValue(), RunmodeAutoFpCreatePickupQueuesString(), RunModeDispatch(), RunModeErfFileAutoFp(), RunModeErfFileSingle(), RunModeFilePcapAutoFp(), RunModeFilePcapSingle(), RunModeIdsAFPAutoFp(), RunModeIdsAFPRegister(), RunModeIdsAFPSingle(), RunModeIdsAFPWorkers(), RunModeIdsErfDagAutoFp(), RunModeIdsErfDagSingle(), RunModeIdsErfDagWorkers(), RunModeIdsNetmapAutoFp(), RunModeIdsNetmapRegister(), RunModeIdsNetmapSingle(), RunModeIdsNetmapWorkers(), RunModeIdsNflogAutoFp(), RunModeIdsNflogRegister(), RunModeIdsNflogSingle(), RunModeIdsNflogWorkers(), RunModeIdsPcapAutoFp(), RunModeIdsPcapRegister(), RunModeIdsPcapSingle(), RunModeIdsPcapWorkers(), RunModeIdsPfringAutoFp(), RunModeIdsPfringRegister(), RunModeIdsPfringSingle(), RunModeIdsPfringWorkers(), RunModeNapatechRegister(), RunModeRegisterNewRunMode(), RunModeSetIPSAutoFp(), RunModeSetIPSWorker(), RunModeSetLiveCaptureAutoFp(), RunModeSetLiveCaptureSingle(), RunModeSetLiveCaptureWorkers(), RunModeShutDown(), RunModeUnixSocketGetDefaultMode(), RunUnittests(), SCACBSPreparePatterns(), SCACPreparePatterns(), SCACTilePreparePatterns(), SCAsn1CtxNew(), SCClassConfAllocClasstype(), SCClassConfDeinit(), SCClassConfDeInitContext(), SCClassConfLoadClassficationConfigFile(), SCConfLogOpenGeneric(), SCGetGroupID(), SCGetUserID(), SCHInfoAddHostOSInfo(), SCHInfoGetHostOSFlavour(), SCHInfoLoadFromConfig(), SCKernelVersionIsAtLeast(), SCLogAddToFGFFileList(), SCLogAddToFGFFuncList(), SCLogAddToFGFLineList(), SCLogAllocLogOPBuffer(), SCLogInitLogModule(), SCLogLoadConfig(), SCLogMessage(), SCPidfileCreate(), SCPidfileTestRunning(), SCProfilingDumpPacketStats(), SCProfilingInit(), SCProfilingKeywordsGlobalInit(), SCProfilingKeywordUpdateCounter(), SCProfilingPrefilterGlobalInit(), SCProfilingPrefilterUpdateCounter(), SCProfilingRulesGlobalInit(), SCProfilingRuleUpdateCounter(), SCProfilingSghsGlobalInit(), SCProfilingSghUpdateCounter(), SCProtoNameInit(), SCRadixAddKeyIPV6String(), SCRadixCreateRadixTree(), SCRadixReleaseRadixTree(), SCRConfAllocSCRConfReference(), SCRConfDeInitContext(), SCRConfLoadReferenceConfigFile(), SCReferenceConfDeinit(), SCRuleVarsGetConfVar(), SCThresholdConfInitContext(), SetupFPAnalyzer(), SetupRuleAnalyzer(), SigGroupBuild(), SigMatchList2DataArray(), SigMatchListSMBelongsTo(), SigStringAlloc(), SinglePatternMatchDefaultMatcher(), SMTPProcessDataChunk(), SMTPStateAlloc(), SRepCatGetByShortname(), SRepInit(), SRepLoadCatFileFromFD(), SRepLoadFileFromFD(), SRepResetVersion(), SSLVersionToString(), StatsInit(), StatsSetUI64(), StatsSpawnThreads(), StorageRegister(), StreamTcpAppLayerIsDisabled(), StreamTcpInitConfig(), StreamTcpReassembleInitThreadCtx(), StreamTcpThreadInit(), TagInitCtx(), TAILQ_HEAD(), ThresholdHashInit(), ThresholdInit(), ThresholdIPPairTimeoutCheck(), TLSGetIPInformations(), TmModuleDecodeNetmapRegister(), TmModuleDecodePcapRegister(), TmModuleGetById(), TmqCreateQueue(), TmqhFlowRegister(), TmThreadCreate(), TmThreadGetNbThreads(), TmThreadInitMC(), TmThreadSetCPU(), TmThreadSetGroupName(), TmThreadSetPrio(), TmThreadsSlotVarRun(), TmThreadWaitOnThreadInit(), TmValidateQueueState(), Unified2AlertInitCtx(), Unified2AlertRegister(), UnixManagerThreadSpawn(), UnixSocketPcapFile(), UTHAppendSigs(), UTHBuildPacketArrayFromEth(), UTHCheckPacketMatchResults(), UTHGenericTest(), UTHMatchPackets(), UTHMatchPacketsWithResults(), UtilCpuGetNumProcessorsConfigured(), UtilCpuGetNumProcessorsMax(), UtilCpuGetNumProcessorsOnline(), ValidateIPV4Address(), ValidateIPV6Address(), and ValidateLinkType().

#define SCLogErrorRaw (   err_code,
  file,
  func,
  line,
  ... 
)
Value:
(file), (func), (line), err_code, __VA_ARGS__)
#define SCLogErr(x, file, func, line, err,...)
Definition: util-debug.h:230

Definition at line 297 of file util-debug.h.

#define SCLogInfo (   ...)
Value:
__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
#define SCLog(x, file, func, line,...)
Definition: util-debug.h:211

Macro used to log INFORMATIONAL messages.

Return values
...Takes as argument(s), a printf style format message

Definition at line 254 of file util-debug.h.

Referenced by AffinitySetupLoadFromConfig(), AFPGetLinkType(), AFPIsFanoutSupported(), AFPPeersListCheck(), AFPRunModeIsIPS(), AFPSetBPFFilter(), AppLayerParserRegisterProtocolParsers(), ChecksumAutoModeCheck(), CleanupRuleAnalyzer(), ConfUnixSocketIsEnable(), CoredumpLoadConfig(), DecodeIPFW(), DetectAddressLookupInHead(), DetectAddressPrintList(), DetectEngineInspectBufferGeneric(), DetectEngineMTApply(), DetectEngineMultiTenantSetup(), DetectEngineResetMaxSigId(), DetectEngineTentantRegisterPcapFile(), DetectEngineTentantUnregisterPcapFile(), DetectFastPatternRegister(), DetectFilemagicRegister(), DetectHostbitFree(), DetectLoadersInit(), DetectLuaRegister(), DetectPcreRegister(), FileForceHashParseCfg(), GetIfaceMTU(), GetIfaceRSSQueuesNum(), GlobalsInitPreConfig(), HTPParseMemcap(), InitPcapFile(), IPFWSetVerdict(), LiveGetDeviceName(), LogTcpDataLogInitCtx(), main(), MimeDecParseFullMsg(), MpmTableSetup(), NapatechDeleteFilter(), NapatechGetStreamConfig(), NapatechPacketLoopZC(), NapatechSetupNuma(), NapatechSetupTraffic(), NapatechStreamThreadExitStats(), NFQInitConfig(), NoWinDivertSupportExit(), OutputJsonRegister(), OutputRegisterFiledataLogger(), PacketCreateMask(), PcapDetermineDirectoryOrFile(), PcapDirectoryDispatch(), PcapFileDispatch(), PcapFileGlobalInit(), PcapLogProfileSetup(), PostRunDeinit(), ReceiveErfDagLoop(), ReceiveErfDagThreadExitStats(), ReceiveErfDagThreadInit(), ReceiveErfFileLoop(), ReceiveErfFileThreadExitStats(), ReceiveErfFileThreadInit(), ReceiveIPFWLoop(), ReceivePcapThreadExitStats(), ReceivePcapThreadInit(), ReceivePfringThreadInit(), RegisterAllModules(), RegisterDCERPCParsers(), RegisterDCERPCUDPParsers(), RegisterENIPUDPParsers(), RegisterFTPParsers(), RegisterHTPParsers(), RegisterSMBParsers(), RegisterSMTPParsers(), RegisterSSLParsers(), RunModeErfFileAutoFp(), RunModeErfFileSingle(), RunModeIdsAFPRegister(), RunModeIdsErfDagAutoFp(), RunModeIdsErfDagSingle(), RunModeIdsErfDagWorkers(), RunModeIdsNetmapRegister(), RunModeIdsNflogAutoFp(), RunModeIdsNflogRegister(), RunModeIdsNflogSingle(), RunModeIdsNflogWorkers(), RunModeIdsPcapAutoFp(), RunModeIdsPcapRegister(), RunModeIdsPcapSingle(), RunModeIdsPcapWorkers(), RunModeIdsPfringAutoFp(), RunModeIdsPfringRegister(), RunModeIdsPfringSingle(), RunModeIdsPfringWorkers(), RunModeInitializeOutputs(), RunModeNapatechRegister(), RunModeSetLiveCaptureAutoFp(), RunModeUnixSocketGetDefaultMode(), RunUnittests(), SCClassConfDeInitContext(), SCConfLogOpenGeneric(), SCLogDeInitLogModule(), SCProfilingInit(), SCRConfDeInitContext(), SCThresholdConfInitContext(), SCThresholdConfParseFile(), SetupFPAnalyzer(), SetupRuleAnalyzer(), SigAddressCleanupStage1(), SigAddressPrepareStage1(), SigInit(), SigLoadSignatures(), SinglePatternMatchDefaultMatcher(), SRepInit(), StatsSetUI64(), StreamTcpCheckStreamContents(), StreamTcpReassembleFree(), TLSGetIPInformations(), TmModuleDecodeAFPRegister(), TmModuleDecodeIPFWRegister(), TmModuleDecodePcapRegister(), TmThreadsListThreads(), Unified2AlertInitCtx(), UnixSocketPcapFile(), UTHCheckPacketMatchResults(), UtilCpuPrintSummary(), UtRunTests(), and VerdictIPFWThreadExitStats().

#define SCLogInfoRaw (   file,
  func,
  line,
  ... 
)
Value:
(file), (func), (line), __VA_ARGS__)
#define SCLog(x, file, func, line,...)
Definition: util-debug.h:211

Definition at line 256 of file util-debug.h.

#define SCLogNoticeRaw (   file,
  func,
  line,
  ... 
)
Value:
(file), (func), (line), __VA_ARGS__)
#define SCLog(x, file, func, line,...)
Definition: util-debug.h:211

Definition at line 271 of file util-debug.h.

#define SCLogWarning (   err_code,
  ... 
)
Value:
__FILE__, __FUNCTION__, __LINE__, \
err_code, __VA_ARGS__)
#define SCLogErr(x, file, func, line, err,...)
Definition: util-debug.h:230

Macro used to log WARNING messages.

Return values
err_codeError code that has to be logged along with the warning message
...Takes as argument(s), a printf style format message

Definition at line 281 of file util-debug.h.

Referenced by AFPGetLinkType(), AFPIsFanoutSupported(), AppLayerParserRegisterMpmIDsFuncs(), CleanupPcapFileFileVars(), DefragRbFragCompare(), DefragTrackerFreeFrags(), DetectEngineAppendSig(), DetectEngineContentInspection(), DetectEngineCtxFree(), DetectEngineMultiTenantSetup(), DetectEngineReloadTenantBlocking(), DetectEngineThreadCtxDeinit(), DetectFilemagicRegister(), DetectFlowbitsAnalyze(), DetectHttpHHRegister(), DetectLoadCompleteSigPath(), DetectPcrePayloadMatch(), DetectReplaceRegister(), DetectTagRegister(), DetectTlsFingerprintRegister(), DetectTlsJa3HashRegister(), DetectTlsJa3SHashRegister(), DetectTlsSerialRegister(), EngineAnalysisRulesFailure(), FileForceHashParseCfg(), GetIfaceMaxPacketSize(), GetIfaceMTU(), GetIfaceRSSQueuesNum(), HashTableAdd(), HashTableLookup(), HTPFreeConfig(), HttpXFFGetCfg(), IPFWSetVerdict(), Ja3IsDisabled(), LiveGetDevice(), LogCustomFormatAddNode(), MemBufferCreateNew(), MemBufferExpand(), MimeDecSetConfig(), MpmAddPattern(), MpmRegisterTests(), NapatechStreamThreadInit(), NFQGetThread(), NFQInitConfig(), NFQRegisterQueue(), NFQSetVerdict(), NoNFLOGSupportExit(), NoWinDivertSupportExit(), OutputJsonRegister(), PacketCreateMask(), PcapDetermineDirectoryOrFile(), PcapFileGlobalInit(), PostRunDeinit(), ReceiveAFPLoop(), ReceiveAFPThreadInit(), ReceiveIPFWLoop(), ReceiveIPFWThreadDeinit(), ReceivePfringThreadInit(), RegisterAllModules(), RegisterSMBParsers(), RegisterSSLParsers(), RunModeDispatch(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsNflogRegister(), RunModeIdsPcapRegister(), RunModeIdsPfringRegister(), RunModeInitializeOutputs(), RunModeSetIPSAutoFp(), RunModeSetLiveCaptureAutoFp(), RunModeShutDown(), SCConfLogReopen(), SCLogLoadConfig(), SCProfilingInit(), SCProfilingRulesGlobalInit(), SCProfilingSghsGlobalInit(), SCThresholdConfInitContext(), SigLoadSignatures(), SigMatchListSMBelongsTo(), SigTableRegisterTests(), SRepResetVersion(), StatsSetUI64(), StreamSegmentForEach(), StreamTcpInitConfig(), TmModuleDecodeAFPRegister(), TmModuleDecodePfringRegister(), TmModuleRegisterTests(), TmThreadRemove(), and TmThreadsSlotVarRun().

#define SCLogWarningRaw (   err_code,
  file,
  func,
  line,
  ... 
)    SCLogErr(SC_LOG_WARNING, (file), (func), (line), err_code, __VA_ARGS__)

Definition at line 284 of file util-debug.h.

#define SCReturn   return

Definition at line 339 of file util-debug.h.

Referenced by AppLayerDestroyCtxThread(), AppLayerHtpEnableRequestBodyCallback(), AppLayerHtpEnableResponseBodyCallback(), AppLayerHtpNeedFileInspection(), AppLayerListSupportedProtocols(), AppLayerParserBackupParserTable(), AppLayerParserDestroyProtocolParserLocalStorage(), AppLayerParserRegisterDetectFlagsFuncs(), AppLayerParserRegisterDetectStateFuncs(), AppLayerParserRegisterGetEventInfo(), AppLayerParserRegisterGetEventsFunc(), AppLayerParserRegisterGetFilesFunc(), AppLayerParserRegisterGetStateProgressCompletionStatus(), AppLayerParserRegisterGetStateProgressFunc(), AppLayerParserRegisterGetTx(), AppLayerParserRegisterGetTxCnt(), AppLayerParserRegisterGetTxIterator(), AppLayerParserRegisterLocalStorageFunc(), AppLayerParserRegisterLogger(), AppLayerParserRegisterLoggerBits(), AppLayerParserRegisterLoggerFuncs(), AppLayerParserRegisterMpmIDsFuncs(), AppLayerParserRegisterOptionFlags(), AppLayerParserRegisterParserAcceptableDataDirection(), AppLayerParserRegisterProtocolUnittests(), AppLayerParserRegisterStateFuncs(), AppLayerParserRegisterTruncateFunc(), AppLayerParserRegisterTxFreeFunc(), AppLayerParserRegisterUnittests(), AppLayerParserRestoreParserTable(), AppLayerParserSetEOF(), AppLayerParserSetStreamDepth(), AppLayerParserSetTransactionInspectId(), AppLayerParserSetTransactionLogId(), AppLayerParserSetTxDetectFlags(), AppLayerParserSetTxLogged(), AppLayerParserStateCleanup(), AppLayerParserStateFree(), AppLayerParserStateSetFlag(), AppLayerParserStreamTruncated(), AppLayerParserThreadCtxFree(), AppLayerParserTransactionsCleanup(), AppLayerParserTriggerRawStreamReassembly(), AppLayerProtoDetectDestroyCtxThread(), AppLayerProtoDetectGetProto(), AppLayerProtoDetectPPRegister(), AppLayerProtoDetectRegisterProtocol(), AppLayerProtoDetectSupportedAppProtocols(), AppLayerProtoDetectSupportedIpprotos(), AppLayerProtoDetectUnittestCtxBackup(), AppLayerProtoDetectUnittestCtxRestore(), AppLayerProtoDetectUnittestsRegister(), AppLayerUnittestsRegister(), BoyerMooreCtxDeInit(), CleanupPcapFileFileVars(), DecodeIPV6FragHeader(), DefragPolicyLoadFromConfig(), DetectCipServiceRegister(), DetectContentFree(), DetectDsizeRegister(), DetectFlagsSignatureNeedsSynOnlyPackets(), DetectFlowvarRegister(), DetectICodeFree(), DetectITypeFree(), DetectMetadataFree(), DetectReferenceFree(), DetectRpcFree(), DetectTemplate2Free(), DetectTtlFree(), DetectUricontentRegister(), EngineAnalysisRulesFailure(), FileDisableFilesize(), FileDisableMagic(), FileDisableMd5(), FileDisableSha1(), FileDisableSha256(), FileDisableStoring(), FileDisableStoringForTransaction(), FlowInit(), HTPAtExitPrintStats(), HtpBodyPrune(), HTPConfigure(), HTPFreeConfig(), HTPStateFree(), IPOnlyCIDRListFree(), NoWinDivertSupportExit(), OutputRegisterFiledataLogger(), PoolReturn(), Prefilter(), PrefilterPktStreamRegister(), ReceiveIPFWThreadExitStats(), RegisterDNP3Parsers(), RegisterENIPTCPParsers(), RegisterENIPUDPParsers(), RegisterHTPParsers(), RegisterModbusParsers(), SCACBSInitCtx(), SCACInitCtx(), SigAlloc(), SigGroupHeadPrintSigs(), SigMatchSignaturesGetSgh(), StatsSetUI64(), StatsSpawnThreads(), StreamTcpInlineSegmentReplacePacket(), StreamTcpPruneSession(), StreamTcpPseudoPacketCreateStreamEndPacket(), StreamTcpReassembleFreeThreadCtx(), StreamTcpSackFreeList(), StreamTcpSackPruneList(), StreamTcpSessionCleanup(), StreamTcpSessionClear(), StreamTcpSessionPktFree(), TagHandlePacket(), TmModuleDecodePcapRegister(), TmqhOutputPacketpool(), and TmThreadSetPrio().

#define SCReturnChar (   x)    return x

Definition at line 347 of file util-debug.h.

#define SCReturnCharPtr (   x)    return x

Definition at line 349 of file util-debug.h.

Referenced by SCRuleVarsGetConfVar().

#define SCReturnDbl (   x)    return x

Definition at line 345 of file util-debug.h.

#define SCReturnInt (   x)    return x

Definition at line 341 of file util-debug.h.

Referenced by AFPPeersListCheck(), AFPPeersListInit(), AppLayerDeSetup(), AppLayerHandleTCPData(), AppLayerHandleUdp(), AppLayerParserConfParserEnabled(), AppLayerParserDeSetup(), AppLayerParserGetEventInfo(), AppLayerParserGetStateProgress(), AppLayerParserGetStateProgressCompletionStatus(), AppLayerParserGetStreamDepth(), AppLayerParserParse(), AppLayerParserProtocolHasLogger(), AppLayerParserProtocolIsTxEventAware(), AppLayerParserRegisterParser(), AppLayerParserSetTxDetectState(), AppLayerParserSetup(), AppLayerParserStateIssetFlag(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectDeSetup(), AppLayerProtoDetectPMRegisterPatternCI(), AppLayerProtoDetectPMRegisterPatternCS(), AppLayerProtoDetectPMRegisterPatternCSwPP(), AppLayerProtoDetectPPParseConfPorts(), AppLayerProtoDetectPrepareState(), AppLayerProtoDetectSetup(), AppLayerSetup(), CleanupPcapFileDirectoryVars(), ConfigCheckLogDirectory(), DCERPCParser(), DecodeAFP(), DecodeAFPThreadDeinit(), DecodeAFPThreadInit(), DecodeErfDag(), DecodeErfDagThreadDeinit(), DecodeErfDagThreadInit(), DecodeErfFile(), DecodeErfFileThreadDeinit(), DecodeErfFileThreadInit(), DecodeIPFW(), DecodeIPFWThreadDeinit(), DecodeIPFWThreadInit(), DecodeNFQThreadDeinit(), DecodeNFQThreadInit(), DecodePcap(), DecodePcapThreadDeinit(), DecodePcapThreadInit(), DecodePfringThreadDeinit(), DecodePfringThreadInit(), DetectAddressMatch(), DetectAddressMatchIPv4(), DetectAddressMatchIPv6(), DetectBytejumpDoMatch(), DetectBytetestDoMatch(), DetectCipServiceRegister(), DetectDceIfaceRegister(), DetectDceOpnumRegister(), DetectDetectionFilterRegister(), DetectDsizeRegister(), DetectEngineContentInspection(), DetectEngineEventRegister(), DetectEngineInspectCIP(), DetectEngineInspectENIP(), DetectEngineInspectModbus(), DetectEngineInspectPacketPayload(), DetectEnipCommandRegister(), DetectFileextRegister(), DetectFileInspectGeneric(), DetectFilemagicRegister(), DetectFilenameRegister(), DetectFilesizeRegister(), DetectFilestoreRegister(), DetectFlagsRegister(), DetectFlowMatch(), DetectFtpbounceRegister(), DetectHttpRawHeaderRegister(), DetectLuaRegister(), DetectNfsProcedureRegister(), DetectNfsVersionRegister(), DetectNocaseRegister(), DetectPcrePayloadMatch(), DetectPrefilterRegister(), DetectRawbytesRegister(), DetectReferenceFree(), DetectSignatureAddTransform(), DetectSNMPPduTypeRegister(), DetectSNMPVersionRegister(), DetectSshSoftwareVersionRegister(), DetectSshVersionRegister(), DetectSslVersionRegister(), DetectStreamSizeRegister(), DetectThresholdRegister(), DetectTlsRegister(), DetectTlsValidityRegister(), DetectTlsVersionRegister(), DetectTransformCompressWhitespaceRegister(), DetectTransformMd5Register(), DetectTransformSha1Register(), DetectTransformSha256Register(), DetectTransformStripWhitespaceRegister(), DetectUricontentRegister(), DetectUrilenRegister(), FileAppendData(), FileAppendDataById(), FileAppendGAPById(), FileCloseFile(), FileCloseFileById(), FileCloseFilePtr(), FileContainerSetTx(), FileSetRange(), FileSetTx(), FileStore(), FileTrackedSize(), FlowClearMemory(), FlowForceReassemblyNeedReassembly(), HtpBodyAppendChunk(), HTPFileClose(), HTPFileOpen(), HTPFileSetRange(), HTPFileStoreChunk(), HTPFreeConfig(), InitPcapFile(), IPFWSetVerdict(), JsonDNSLogAnswer(), LiveDeviceListClean(), LogFileFreeCtx(), LogHttpLogger(), LogTcpDataLogger(), NapatechDecode(), NapatechDecodeThreadDeinit(), NapatechDecodeThreadInit(), NapatechPacketLoopZC(), NapatechStreamThreadDeinit(), NapatechStreamThreadInit(), NoNFLOGSupportExit(), NoWinDivertSupportExit(), OutputRegisterFiledataLogger(), OutputRegisterFileLogger(), PacketAlertGetTag(), PacketAlertThreshold(), PacketCreateMask(), PcapDetermineDirectoryOrFile(), PcapDirectoryDispatch(), PcapFileDispatch(), PcapFileGlobalInit(), PmqSetup(), PostRunDeinit(), printUUID(), ReceiveAFPLoop(), ReceiveAFPThreadDeinit(), ReceiveAFPThreadInit(), ReceiveErfDagLoop(), ReceiveErfDagThreadDeinit(), ReceiveErfDagThreadInit(), ReceiveErfFileLoop(), ReceiveErfFileThreadInit(), ReceiveIPFWLoop(), ReceiveIPFWThreadDeinit(), ReceiveIPFWThreadInit(), ReceiveNFQLoop(), ReceivePcapBreakLoop(), ReceivePcapLoop(), ReceivePcapThreadDeinit(), ReceivePcapThreadInit(), ReceivePfringLoop(), ReceivePfringThreadInit(), RegisterAllModules(), RejectSendIPv4ICMP(), RejectSendIPv4TCP(), RejectSendIPv6ICMP(), RejectSendIPv6TCP(), RunModeErfFileAutoFp(), RunModeErfFileSingle(), RunModeIdsAFPAutoFp(), RunModeIdsAFPSingle(), RunModeIdsAFPWorkers(), RunModeIdsErfDagAutoFp(), RunModeIdsErfDagSingle(), RunModeIdsErfDagWorkers(), RunModeIdsNetmapAutoFp(), RunModeIdsNetmapSingle(), RunModeIdsNetmapWorkers(), RunModeIdsNflogAutoFp(), RunModeIdsNflogSingle(), RunModeIdsNflogWorkers(), RunModeIdsPcapAutoFp(), RunModeIdsPcapSingle(), RunModeIdsPcapWorkers(), SBBCompare(), SCPidfileCreate(), SigAddressPrepareStage4(), SigGroupHeadContainsSigId(), SigLoadSignatures(), SigMatchList2DataArray(), SigMatchListSMBelongsTo(), SignatureHasPacketContent(), SignatureHasStreamContent(), SignatureIsIPOnly(), SigParseGetMaxDsize(), SMTPProcessDataChunk(), SSLVersionToString(), StreamNeedsReassembly(), StreamReassembleLog(), StreamTcpCheckStreamContents(), StreamTcpInlineSegmentCompare(), StreamTcpPacket(), StreamTcpReassembleAppLayer(), StreamTcpReassembleHandleSegment(), StreamTcpReassembleHandleSegmentHandleData(), StreamTcpReassembleInsertSegment(), StreamTcpSackUpdatePacket(), StreamTcpThreadDeinit(), StreamTcpThreadInit(), TagHashAddTag(), TcpSackCompare(), TcpSegmentCompare(), TmModuleDecodeAFPRegister(), TmModuleDecodeNetmapRegister(), UnixSocketPcapFile(), UTHPacketMatchSigMpm(), ValidateLinkType(), VerdictIPFW(), VerdictIPFWThreadDeinit(), and VerdictIPFWThreadInit().

Typedef Documentation

typedef struct SCLogConfig_ SCLogConfig

Holds the config state used by the logging api.

typedef struct SCLogInitData_ SCLogInitData

Structure containing init data, that would be passed to SCInitDebugModule()

typedef struct SCLogOPBuffer_ SCLogOPBuffer

Structure to be used when log_level override support would be provided by the logging module.

The output interface context for the logging module.

Enumeration Type Documentation

enum SCLogLevel

The various log levels NOTE: when adding new level, don't forget to update SCLogMapLogLevelToSyslogLevel() or it may result in logging to syslog with LOG_EMERG priority.

Enumerator
SC_LOG_NOTSET 
SC_LOG_NONE 
SC_LOG_EMERGENCY 
SC_LOG_ALERT 
SC_LOG_CRITICAL 
SC_LOG_ERROR 
SC_LOG_WARNING 
SC_LOG_NOTICE 
SC_LOG_INFO 
SC_LOG_PERF 
SC_LOG_CONFIG 
SC_LOG_DEBUG 
SC_LOG_LEVEL_MAX 

Definition at line 51 of file util-debug.h.

The various output interfaces supported.

Enumerator
SC_LOG_OP_IFACE_CONSOLE 
SC_LOG_OP_IFACE_FILE 
SC_LOG_OP_IFACE_SYSLOG 
SC_LOG_OP_IFACE_MAX 

Definition at line 70 of file util-debug.h.

Enumerator
SC_LOG_OP_TYPE_REGULAR 
SC_LOG_OP_TYPE_JSON 

Definition at line 77 of file util-debug.h.

Function Documentation

SCLogInitData* SCLogAllocLogInitData ( void  )

Returns a pointer to a new SCLogInitData. This is a public interface intended to be used after the logging paramters are read from the conf file.

Return values
sc_lidPointer to the newly created SCLogInitData

Definition at line 1111 of file util-debug.c.

References SCLogConfig_::log_format, SCLogConfig_::op_filter, SCLogConfig_::op_filter_regex, SCLogConfig_::op_filter_regex_study, SCLogInitData_::op_ifaces, SCLogConfig_::op_ifaces, pcre_free_study, SCFree, SCMalloc, and SCLogConfig_::startup_message.

Referenced by SCLogDeInitLogModule(), and SCLogLoadConfig().

Here is the caller graph for this function:

SCLogOPBuffer* SCLogAllocLogOPBuffer ( void  )

Allocates an output buffer for an output interface. Used when we want the op_interface log_format to override the global_log_format. Currently not used.

Return values
bufferPointer to the newly created output_buffer

Definition at line 650 of file util-debug.c.

References closelog, SCLogOPIfaceCtx_::facility, SCLogOPIfaceCtx_::file, SCLogOPIfaceCtx_::file_d, SCLogOPIfaceCtx_::fp_mutex, SCLogInitData_::global_log_format, SCLogInitData_::global_log_level, SCLogOPIfaceCtx_::iface, SCLogOPBuffer_::log_format, SCLogOPIfaceCtx_::log_format, SCLogConfig_::log_format, SCLogOPIfaceCtx_::log_level, SCLogConfig_::log_level, SCLogOPBuffer_::msg, SCLogOPIfaceCtx_::next, SCLogInitData_::op_filter, SCLogConfig_::op_filter, SCLogConfig_::op_filter_regex, SCLogConfig_::op_filter_regex_study, SCLogInitData_::op_ifaces, SCLogConfig_::op_ifaces, SCLogInitData_::op_ifaces_cnt, SCLogConfig_::op_ifaces_cnt, openlog, OutputRegisterFileRotationFlag(), SCLogOPIfaceCtx_::rotation_flag, SC_ERR_FATAL, SC_LOG_DEF_LOG_FILE, SC_LOG_DEF_LOG_FORMAT, SC_LOG_DEF_LOG_LEVEL, SC_LOG_DEF_LOG_OP_IFACE, SC_LOG_DEF_SYSLOG_FACILITY, SC_LOG_DEF_SYSLOG_FACILITY_STR, SC_LOG_ENV_LOG_FACILITY, SC_LOG_ENV_LOG_FILE, SC_LOG_ENV_LOG_FORMAT, SC_LOG_ENV_LOG_LEVEL, SC_LOG_ENV_LOG_OP_FILTER, SC_LOG_ENV_LOG_OP_IFACE, sc_log_global_log_level, SC_LOG_LEVEL_MAX, SC_LOG_MAX_LOG_FORMAT_LEN, SC_LOG_NOTSET, SC_LOG_OP_IFACE_CONSOLE, SC_LOG_OP_IFACE_FILE, SC_LOG_OP_IFACE_MAX, SC_LOG_OP_IFACE_SYSLOG, SCFree, SCLogError, SCMalloc, SCMapEnumNameToValue(), SCMapEnumValueToName(), SCMutexDestroy, SCMutexInit, SCStrdup, SCSyslogGetFacilityMap(), str, SCLogOPBuffer_::temp, TRUE, SCLogOPIfaceCtx_::type, type, and SCLogOPIfaceCtx_::use_color.

Here is the call graph for this function:

void SCLogAppendOPIfaceCtx ( SCLogOPIfaceCtx iface_ctx,
SCLogInitData sc_lid 
)

Appends an output_interface to the output_interface list sent in head.

Parameters
iface_ctxPointer to the output_interface that has to be added to head
headPointer to the output_interface list

Definition at line 1174 of file util-debug.c.

References head, SCLogOPIfaceCtx_::next, SCLogInitData_::op_ifaces, and SCLogInitData_::op_ifaces_cnt.

Referenced by SCLogDeInitLogModule(), and SCLogLoadConfig().

Here is the caller graph for this function:

int SCLogDebugEnabled ( void  )

Returns whether debug messages are enabled to be logged or not.

Return values
1if debug messages are enabled to be logged
0if debug messages are not enabled to be logged

Definition at line 631 of file util-debug.c.

References SC_LOG_DEBUG, and sc_log_global_log_level.

Referenced by AppLayerProtoDetectPrepareState(), DecodeIPV4(), DecodeIPV6(), DetectBytejumpDoMatch(), DetectFileextRegister(), DetectFilemagicRegister(), DetectFilenameRegister(), DetectMsgRegister(), DetectPortInsert(), FlowVarPrint(), HtpBodyPrint(), printUUID(), SigAddressPrepareStage1(), SMTPProcessDataChunk(), SRepLoadFileFromFD(), and StreamTcpReassembleInsertSegment().

Here is the caller graph for this function:

void SCLogInitLogModule ( SCLogInitData sc_lid)

Initializes the logging module.

Parameters
sc_lidThe initialization data for the logging module. If sc_lid is NULL, we would stick to the default configuration for the logging subsystem.

Definition at line 1259 of file util-debug.c.

References SC_ERR_FATAL, SC_ERR_MUTEX, sc_log_global_log_level, sc_log_module_cleaned, sc_log_module_initialized, SCLogDeInitLogModule(), SCLogError, SCMalloc, and SCMutexInit.

Referenced by main(), SCLogDeInitLogModule(), and SCLogLoadConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

SCLogOPIfaceCtx* SCLogInitOPIfaceCtx ( const char *  iface_name,
const char *  log_format,
int  log_level,
const char *  arg 
)

Creates a new output interface based on the arguments sent. The kind of output interface to be created is decided by the iface_name arg. If iface_name is "file", the arg argument will hold the filename to be used for logging purposes. If iface_name is "syslog", the arg argument holds the facility code. If iface_name is "console", arg is NULL.

Parameters
iface_nameInterface name. Can be "console", "file" or "syslog"
log_formatOverride for the global_log_format
log_levelOverride for the global_log_level
log_levelParameter required by a particular interface. Explained in the function description
Return values
iface_ctxPointer to the newly created output interface

Definition at line 1219 of file util-debug.c.

References SC_LOG_DEBUG, SC_LOG_NOTSET, SC_LOG_OP_IFACE_CONSOLE, SC_LOG_OP_IFACE_FILE, SC_LOG_OP_IFACE_SYSLOG, SC_LOG_OP_TYPE_REGULAR, SCMapEnumNameToValue(), and SCSyslogGetFacilityMap().

Referenced by SCLogDeInitLogModule().

Here is the call graph for this function:

Here is the caller graph for this function:

SCError SCLogMessage ( const SCLogLevel  log_level,
const char *  file,
const unsigned int  line,
const char *  function,
const SCError  error_code,
const char *  message 
)

Adds the global log_format to the outgoing buffer.

Parameters
log_levellog_level of the message that has to be logged
msgBuffer containing the outgoing message
fileFile_name from where the message originated
functionFunction_name from where the message originated
lineLine_no from where the messaged originated
Return values
SC_OKon success; else an error code

Definition at line 548 of file util-debug.c.

References SCLogOPIfaceCtx_::file, SCLogOPIfaceCtx_::file_d, SCLogOPIfaceCtx_::fp_mutex, SCLogOPIfaceCtx_::iface, SCLogOPIfaceCtx_::log_format, SCLogConfig_::log_format, SCLogOPIfaceCtx_::log_level, SCLogOPIfaceCtx_::next, SCLogConfig_::op_ifaces, SCLogOPIfaceCtx_::rotation_flag, SC_ERR_FOPEN, SC_LOG_ERROR, SC_LOG_MAX_LOG_MSG_LEN, sc_log_module_initialized, SC_LOG_NOTSET, SC_LOG_OP_IFACE_CONSOLE, SC_LOG_OP_IFACE_FILE, SC_LOG_OP_IFACE_SYSLOG, SC_OK, SCLogError, SCMutexLock, SCMutexUnlock, SCLogOPIfaceCtx_::type, and SCLogOPIfaceCtx_::use_color.

Referenced by main().

Here is the caller graph for this function:

void SCLogRegisterTests ( void  )

Definition at line 1680 of file util-debug.c.

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

SCLogLevel sc_log_global_log_level

Holds the global log level. Is the same as sc_log_config->log_level.

Definition at line 97 of file util-debug.c.

Referenced by SCLogAllocLogOPBuffer(), SCLogDebugEnabled(), SCLogDeInitLogModule(), SCLogInitLogModule(), and SCLogLoadConfig().

int sc_log_module_cleaned

Used to indicate whether the logging module has been cleaned or not.

Definition at line 107 of file util-debug.c.

Referenced by SCLogDeInitLogModule(), and SCLogInitLogModule().

int sc_log_module_initialized

Used to indicate whether the logging module has been init or not.

Definition at line 102 of file util-debug.c.

Referenced by SCLogDeInitLogModule(), SCLogInitLogModule(), and SCLogMessage().