-/* @(#) $Id$ */
+/* @(#) $Id: ./src/analysisd/decoders/decoders_list.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
* 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
*/
{
return(osdecodernode_forpname);
}
-
+
return(osdecodernode_nopname);
}
{
OSDecoderNode *tmp_node = s_node;
int rm_f = 0;
-
+
if(tmp_node)
{
OSDecoderNode *new_node;
-
+
new_node = (OSDecoderNode *)calloc(1,sizeof(OSDecoderNode));
if(new_node == NULL)
{
if((tmp_node->osdecoder->prematch ||
tmp_node->osdecoder->regex) && pi->regex_offset)
{
- rm_f = 1;
+ rm_f = 1;
}
-
+
/* Multi-regexes patterns cannot have prematch */
if(pi->prematch)
{
return(NULL);
}
}
-
+
}while(tmp_node->next && (tmp_node = tmp_node->next));
-
-
+
+
/* Must have a prematch set */
if(!rm_f && (pi->regex_offset & AFTER_PREVREGEX))
{
merror(INV_OFFSET, ARGV0, pi->name);
return(NULL);
}
-
+
tmp_node->next = new_node;
-
+
new_node->next = NULL;
- new_node->osdecoder = pi;
+ new_node->osdecoder = pi;
new_node->child = NULL;
}
-
+
else
{
/* Must not have a previous regex set */
/* We can actually have two lists. One with program
* name and the other without.
*/
- if(pi->program_name)
+ if(pi->program_name)
{
osdecodernode = osdecodernode_forpname;
}
osdecodernode = osdecodernode_nopname;
}
-
+
/* Search for parent on both lists */
if(pi->parent)
{
}
tmp_node = tmp_node->next;
}
-
+
/* List without p name */
tmp_node = osdecodernode_nopname;
{
return(1);
}
-
+
merror(PPLUGIN_INV, ARGV0, pi->parent);
- return(0);
+ return(0);
}
else
{