X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fanalysisd%2Feventinfo_list.c;h=a2d096f7b8dad062f4c1c2f42ffb147fd4bd3b48;hp=282212d2d8b17f4ad51a77ccaf39c84998086e1e;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/analysisd/eventinfo_list.c b/src/analysisd/eventinfo_list.c index 282212d..a2d096f 100755 --- a/src/analysisd/eventinfo_list.c +++ b/src/analysisd/eventinfo_list.c @@ -1,4 +1,5 @@ -/* @(#) $Id$ */ +/* @(#) $Id: ./src/analysisd/eventinfo_list.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. @@ -8,12 +9,12 @@ * License (version 2) as published by the FSF - Free Software * Foundation. * - * License details at the LICENSE file included with OSSEC or + * License details at the LICENSE file included with OSSEC or * online at: http://www.ossec.net/en/licensing.html */ -#include "shared.h" +#include "shared.h" #include "eventinfo.h" @@ -43,46 +44,46 @@ EventNode *OS_GetLastEvent() { EventNode *eventnode_pt = eventnode; - return(eventnode_pt); + return(eventnode_pt); } /* Add an event to the list -- always to the begining */ void OS_AddEvent(Eventinfo *lf) { EventNode *tmp_node = eventnode; - + if(tmp_node) { EventNode *new_node; new_node = (EventNode *)calloc(1,sizeof(EventNode)); - + if(new_node == NULL) { ErrorExit(MEM_ERROR,ARGV0); } - /* Always adding to the beginning of the list + /* Always adding to the beginning of the list * The new node will become the first node and * new_node->next will be the previous first node */ new_node->next = tmp_node; new_node->prev = NULL; tmp_node->prev = new_node; - + eventnode = new_node; /* Adding the event to the node */ new_node->event = lf; _memoryused++; - + /* Need to remove the last nodes */ if(_memoryused > _memorymaxsize) { int i = 0; EventNode *oldlast; - - /* Remove at least the last 10 events + + /* Remove at least the last 10 events * or the events that will not match anymore * (higher than max frequency) */ @@ -101,7 +102,7 @@ void OS_AddEvent(Eventinfo *lf) } } } - + else { /* Adding first node */ @@ -114,8 +115,8 @@ void OS_AddEvent(Eventinfo *lf) eventnode->prev = NULL; eventnode->next = NULL; eventnode->event = lf; - - lastnode = eventnode; + + lastnode = eventnode; } return;