new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / analysisd / decoders / decoder.h
old mode 100755 (executable)
new mode 100644 (file)
index 68a3339..cc008da
@@ -1,37 +1,28 @@
-/* @(#) $Id: decoder.h,v 1.20 2009/06/24 17:06:23 dcid Exp $ */
-
 /* Copyright (C) 2009 Trend Micro Inc.
  * All rights 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
+ * License (version 2) as published by the FSF - Free Software
  * Foundation.
- *
- * License details at the LICENSE file included with OSSEC or 
- * online at: http://www.ossec.net/en/licensing.html
  */
 
-
 #ifndef __DECODER_H
-
 #define __DECODER_H
 
-
-/* We need the eventinfo and os_regex in here */
 #include "shared.h"
 #include "os_regex/os_regex.h"
 
 #define AFTER_PARENT    0x001   /* 1   */
 #define AFTER_PREMATCH  0x002   /* 2   */
-#define AFTER_PREVREGEX 0x004   /* 4   */ 
-#define AFTER_ERROR     0x010   
+#define AFTER_PREVREGEX 0x004   /* 4   */
+#define AFTER_ERROR     0x010
 
+struct _Eventinfo;
 
 
 /* Decoder structure */
-typedef struct
-{
+typedef struct {
     u_int8_t  get_next;
     u_int8_t  type;
     u_int8_t  use_own_name;
@@ -39,39 +30,49 @@ typedef struct
     u_int16_t id;
     u_int16_t regex_offset;
     u_int16_t prematch_offset;
-    
+
     int fts;
+    int accumulate;
     char *parent;
     char *name;
     char *ftscomment;
-    
+    char **fields;
+
+
+
     OSRegex *regex;
     OSRegex *prematch;
     OSMatch *program_name;
-    
+
+    OSPcre2 *pcre2;
+    OSPcre2 *prematch_pcre2;
+    OSPcre2 *program_name_pcre2;
+
     void (*plugindecoder)(void *lf);
-    void (**order)(void *lf, char *field);
-}OSDecoderInfo;
+    void* (**order)(struct _Eventinfo *, char *, int);
+} OSDecoderInfo;
 
 /* List structure */
-typedef struct _OSDecoderNode
-{
+typedef struct _OSDecoderNode {
     struct _OSDecoderNode *next;
     struct _OSDecoderNode *child;
     OSDecoderInfo *osdecoder;
-}OSDecoderNode;
-
-
+} OSDecoderNode;
 
-/* Functions to Create the list, Add a osdecoder to the
- * list and to get the first osdecoder.
+/* Functions to Create the list, add a osdecoder to the
+ * list and to get the first osdecoder
  */
-void OS_CreateOSDecoderList();
+void OS_CreateOSDecoderList(void);
 int OS_AddOSDecoder(OSDecoderInfo *pi);
-OSDecoderNode *OS_GetFirstOSDecoder(char *pname);
-int getDecoderfromlist(char *name);
+OSDecoderNode *OS_GetFirstOSDecoder(const char *pname);
+int getDecoderfromlist(const char *name);
+char *GetGeoInfobyIP(char *ip_addr);
+int SetDecodeXML(void);
+void HostinfoInit(void);
+void SyscheckInit(void);
+void RootcheckInit(void);
 
+int ReadDecodeXML(const char *file);
 
 #endif
 
-/* EOF */