new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / client-agent / config.c
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All right reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation
8  */
9
10 #include "shared.h"
11 #include "os_xml/os_xml.h"
12 #include "os_regex/os_regex.h"
13 #include "os_net/os_net.h"
14 #include "agentd.h"
15
16 /* Global variables */
17 time_t available_server;
18 int run_foreground;
19 keystore keys;
20 agent *agt;
21
22
23 /* Read the config file (for the remote client) */
24 int ClientConf(const char *cfgfile)
25 {
26     int modules = 0;
27     agt->port = DEFAULT_SECURE;
28     agt->rip = NULL;
29     agt->lip = NULL;
30     agt->rip_id = 0;
31     agt->execdq = 0;
32     agt->profile = NULL;
33
34     modules |= CCLIENT;
35
36     if (ReadConfig(modules, cfgfile, agt, NULL) < 0) {
37         return (OS_INVALID);
38     }
39
40     return (1);
41 }
42