static void OutputSshLogDeinit(OutputCtx *output_ctx)
{
- OutputSshLoggerDisable();
-
OutputSshCtx *ssh_ctx = output_ctx->data;
LogFileCtx *logfile_ctx = ssh_ctx->file_ctx;
LogFileFreeCtx(logfile_ctx);
#define DEFAULT_LOG_FILENAME "ssh.json"
OutputCtx *OutputSshLogInit(ConfNode *conf)
{
- if (OutputSshLoggerEnable() != 0) {
- SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'ssh' logger "
- "can be enabled");
- return NULL;
- }
-
LogFileCtx *file_ctx = LogFileNewCtx();
if(file_ctx == NULL) {
SCLogError(SC_ERR_SSH_LOG_GENERIC, "couldn't create new file_ctx");
static void OutputSshLogDeinitSub(OutputCtx *output_ctx)
{
- OutputSshLoggerDisable();
-
OutputSshCtx *ssh_ctx = output_ctx->data;
SCFree(ssh_ctx);
SCFree(output_ctx);
{
OutputJsonCtx *ojc = parent_ctx->data;
- if (OutputSshLoggerEnable() != 0) {
- SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'ssh' logger "
- "can be enabled");
- return NULL;
- }
-
OutputSshCtx *ssh_ctx = SCMalloc(sizeof(OutputSshCtx));
if (unlikely(ssh_ctx == NULL))
return NULL;
drop_loggers--;
}
-static int ssh_loggers = 0;
-
-int OutputSshLoggerEnable(void)
-{
- if (ssh_loggers)
- return -1;
- ssh_loggers++;
- return 0;
-}
-
-void OutputSshLoggerDisable(void)
-{
- if (ssh_loggers)
- ssh_loggers--;
-}
-
/**
* \brief Register a flag for file rotation notification.
*
int OutputDropLoggerEnable(void);
void OutputDropLoggerDisable(void);
-int OutputSshLoggerEnable(void);
-void OutputSshLoggerDisable(void);
-
void OutputRegisterFileRotationFlag(int *flag);
void OutputUnregisterFileRotationFlag(int *flag);
void OutputNotifyFileRotation(void);