X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fanalysisd%2Flists.h;fp=src%2Fanalysisd%2Flists.h;h=a17cbe7c04855ef5888b41fb366daf9e050bb8d0;hp=0000000000000000000000000000000000000000;hb=301048b51990573e58a30dc4a5bb4ec285cad554;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a diff --git a/src/analysisd/lists.h b/src/analysisd/lists.h new file mode 100644 index 0000000..a17cbe7 --- /dev/null +++ b/src/analysisd/lists.h @@ -0,0 +1,57 @@ +/* @(#) $Id$ */ + +/* Copyright (C) 2009 Trend Micro Inc. + * All right reserved. + * + * This program is a free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public + * License (version 3) as published by the FSF - Free Software + * Foundation + */ + + +/* Rules are needed for lists */ + +#include "cdb/cdb.h" +#include "cdb/uint32.h" + +#define LR_STRING_MATCH 0 +#define LR_STRING_NOT_MATCH 1 +#define LR_STRING_MATCH_VALUE 2 + +#define LR_ADDRESS_MATCH 10 +#define LR_ADDRESS_NOT_MATCH 11 +#define LR_ADDRESS_MATCH_VALUE 12 + + +typedef struct ListNode +{ + int loaded; + char *cdb_filename; + char *txt_filename; + struct cdb cdb; + struct ListNode *next; +}ListNode; + +typedef struct ListRule +{ + int loaded; + int field; + int lookup_type; + OSMatch *matcher; + char *filename; + ListNode *db; + struct ListRule *next; +}ListRule; + +/* create the rule list */ +void OS_CreateListsList(); +/* Add rule information to the list */ +int OS_AddList( ListNode *new_listnode ); +int Lists_OP_LoadList(char *listfile); +int OS_DBSearchKey(ListRule *lrule, char *key); +int OS_DBSearch(ListRule *lrule, char *key); +void OS_ListLoadRules(); +ListRule *OS_AddListRule(ListRule *first_rule_list, int lookup_type, int field, char *listname, OSMatch *matcher); +ListNode *OS_GetFirstList(); +ListNode *OS_FindList(char *listname);