6117b643393d6ec743769194e544329cc30a4c3a
[ossec-hids.git] / src / logcollector / logcollector.h
1 /* @(#) $Id$ */
2
3 /* Copyright (C) 2009 Trend Micro Inc.
4  * All right reserved.
5  *
6  * This program is a free software; you can redistribute it
7  * and/or modify it under the terms of the GNU General Public
8  * License (version 2) as published by the FSF - Free Software
9  * Foundation
10  */
11
12
13
14 #ifndef __LOGREADER_H
15
16 #define __LOGREADER_H
17
18 #ifndef ARGV0
19 #define ARGV0 "ossec-logcollector"
20 #endif
21
22
23 #include "shared.h"
24 #include "config/localfile-config.h"
25 #include "config/config.h"
26
27
28
29
30 /*** Function prototypes ***/
31
32
33 /* Read logcollector config */
34 int LogCollectorConfig(char * cfgfile);
35
36 /* Stary log collector daemon */
37 void LogCollectorStart();
38
39 /* Handle files */
40 int handle_file(int i, int do_fseek, int do_log);
41
42 /* Read syslog file */
43 void *read_syslog(int pos, int *rc, int drop_it);
44
45 /* Read snort full file */
46 void *read_snortfull(int pos, int *rc, int drop_it);
47
48 /* Read nmap grepable format */
49 void *read_nmapg(int pos, int *rc, int drop_it);
50
51 /* Read mysql log format */
52 void *read_mysql_log(int pos, int *rc, int drop_it);
53
54 /* Read mysql log format */
55 void *read_mssql_log(int pos, int *rc, int drop_it);
56
57 /* Read postgresql log format */
58 void *read_postgresql_log(int pos, int *rc, int drop_it);
59
60 /* read multi line logs. */
61 void *read_multiline(int pos, int *rc, int drop_it);
62
63 /* Read DJB multilog format */
64 /* Initializes multilog. */
65 int init_djbmultilog(int pos);
66 void *read_djbmultilog(int pos, int *rc, int drop_it);
67
68
69 /* Read events from output of command */
70 void *read_command(int pos, int *rc, int drop_it);
71 void *read_fullcommand(int pos, int *rc, int drop_it);
72
73
74 #ifdef WIN32
75 /* Windows only */
76 void win_startel();
77 void win_readel();
78 void win_read_vista_sec();
79 #endif
80
81
82 /*** Global variables ***/
83
84
85 int loop_timeout;
86 int logr_queue;
87 int open_file_attempts;
88 logreader *logff;
89
90
91 #endif