*
* 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
*/
#include "os_net/os_net.h"
-int Read_Client(XML_NODE node, void *d1, void *d2)
+int Read_Client(XML_NODE node, void *d1, void *d2)
{
int i = 0;
-
+
/* XML definitions */
char *xml_client_ip = "server-ip";
char *xml_client_hostname = "server-hostname";
char *xml_local_ip = "local_ip";
char *xml_client_port = "port";
char *xml_ar_disabled = "disable-active-response";
+ /* cmoraes */
+ char *xml_profile_name = "config-profile";
agent *logr;
os_realloc(logr->rip, (ip_id + 2) * sizeof(char*), logr->rip);
logr->rip[ip_id] = NULL;
logr->rip[ip_id +1] = NULL;
-
+
os_strdup(node[i]->content, logr->rip[ip_id]);
if(OS_IsValidIP(logr->rip[ip_id], NULL) != 1)
{
os_realloc(logr->rip, (ip_id + 2) * sizeof(char*),
logr->rip);
-
+
s_ip = OS_GetHost(node[i]->content, 5);
if(!s_ip)
{
os_strdup("invalid_ip", s_ip);
}
-
+
f_ip[127] = '\0';
snprintf(f_ip, 127, "%s/%s", node[i]->content, s_ip);
return(OS_INVALID);
}
}
+ /* cmoraes */
+ else if(strcmp(node[i]->element,xml_profile_name) == 0)
+ {
+ /* profile name can be anything hence no validation */
+ os_strdup(node[i]->content, logr->profile);
+ }
else
{
merror(XML_INVELEM, ARGV0, node[i]->element);