Alert file formatting clean up.

Put { on new line for function declarations. Remove space after function
name.

Add static to unit tests delcaration.
pull/822/head
Ken Steele 12 years ago
parent 1ac805f1b3
commit 235cd0211a

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2013 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2013 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -197,7 +197,8 @@ TmEcode AlertFastLogThreadDeinit(ThreadVars *t, void *data)
return TM_ECODE_OK;
}
void AlertFastLogExitPrintStats(ThreadVars *tv, void *data) {
void AlertFastLogExitPrintStats(ThreadVars *tv, void *data)
{
AlertFastLogThread *aft = (AlertFastLogThread *)data;
if (aft == NULL) {
return;
@ -244,7 +245,7 @@ static void AlertFastLogDeInitCtx(OutputCtx *output_ctx)
#ifdef UNITTESTS
int AlertFastLogTest01()
static int AlertFastLogTest01()
{
int result = 0;
uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
@ -292,7 +293,7 @@ int AlertFastLogTest01()
return result;
}
int AlertFastLogTest02()
static int AlertFastLogTest02()
{
int result = 0;
uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2011 Open Information Security Foundation
/* Copyright (C) 2011-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2011 Open Information Security Foundation
/* Copyright (C) 2011-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -864,7 +864,6 @@ err:
if (idmef != NULL)
idmef_message_destroy(idmef);
SCReturnInt(TM_ECODE_FAILED);
}
void TmModuleAlertPreludeRegister (void) {

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2013 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -239,7 +239,7 @@ TmEcode Unified2AlertThreadDeinit(ThreadVars *, void *);
static int Unified2IPv4TypeAlert(ThreadVars *, const Packet *, void *);
static int Unified2IPv6TypeAlert(ThreadVars *, const Packet *, void *);
static int Unified2PacketTypeAlert(Unified2AlertThread *, const Packet *, uint32_t, int);
void Unified2RegisterTests();
void Unified2RegisterTests(void);
int Unified2AlertOpenFileCtx(LogFileCtx *, const char *);
static void Unified2AlertDeInitCtx(OutputCtx *);
@ -248,7 +248,8 @@ int Unified2Logger(ThreadVars *tv, void *data, const Packet *p);
#define MODULE_NAME "Unified2Alert"
void TmModuleUnified2AlertRegister (void) {
void TmModuleUnified2AlertRegister(void)
{
tmm_modules[TMM_ALERTUNIFIED2ALERT].name = MODULE_NAME;
tmm_modules[TMM_ALERTUNIFIED2ALERT].ThreadInit = Unified2AlertThreadInit;
// tmm_modules[TMM_ALERTUNIFIED2ALERT].Func = Unified2Alert;
@ -269,7 +270,8 @@ void TmModuleUnified2AlertRegister (void) {
* \param aun Unified2 thread variable.
*/
int Unified2AlertCloseFile(ThreadVars *t, Unified2AlertThread *aun) {
int Unified2AlertCloseFile(ThreadVars *t, Unified2AlertThread *aun)
{
if (aun->unified2alert_ctx->file_ctx->fp != NULL) {
fclose(aun->unified2alert_ctx->file_ctx->fp);
}
@ -287,7 +289,8 @@ int Unified2AlertCloseFile(ThreadVars *t, Unified2AlertThread *aun) {
* \retval -1 on failure
*/
int Unified2AlertRotateFile(ThreadVars *t, Unified2AlertThread *aun) {
int Unified2AlertRotateFile(ThreadVars *t, Unified2AlertThread *aun)
{
if (Unified2AlertCloseFile(t,aun) < 0) {
SCLogError(SC_ERR_UNIFIED2_ALERT_GENERIC,
"Error: Unified2AlertCloseFile failed");
@ -1520,7 +1523,8 @@ int Unified2AlertOpenFileCtx(LogFileCtx *file_ctx, const char *prefix)
* \retval 0 on failure
*/
static int Unified2Test01 (void) {
static int Unified2Test01(void)
{
ThreadVars tv;
DecodeThreadVars dtv;
PacketQueue pq;
@ -1608,7 +1612,8 @@ end:
* \retval 0 on failure
*/
static int Unified2Test02 (void) {
static int Unified2Test02(void)
{
ThreadVars tv;
DecodeThreadVars dtv;
PacketQueue pq;
@ -1698,7 +1703,8 @@ end:
* \retval 0 on failure
*/
static int Unified2Test03 (void) {
static int Unified2Test03(void)
{
ThreadVars tv;
DecodeThreadVars dtv;
PacketQueue pq;
@ -1806,7 +1812,8 @@ end:
* \retval 0 on failure
*/
static int Unified2Test04 (void) {
static int Unified2Test04(void)
{
ThreadVars tv;
DecodeThreadVars dtv;
PacketQueue pq;
@ -1889,7 +1896,8 @@ end:
* \retval 0 on failure
*/
static int Unified2Test05 (void) {
static int Unified2Test05(void)
{
ThreadVars tv;
DecodeThreadVars dtv;
PacketQueue pq;
@ -2041,7 +2049,8 @@ error:
/**
* \brief this function registers unit tests for Unified2
*/
void Unified2RegisterTests (void) {
void Unified2RegisterTests(void)
{
#ifdef UNITTESTS
UtRegisterTest("Unified2Test01 -- Ipv4 test", Unified2Test01, 1);
UtRegisterTest("Unified2Test02 -- Ipv6 test", Unified2Test02, 1);

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2010 Open Information Security Foundation
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free

Loading…
Cancel
Save