*
* 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
*/
/* Remote options */
char *xml_remote_port = "port";
char *xml_remote_proto = "protocol";
+ char *xml_remote_ipv6 = "ipv6";
char *xml_remote_connection = "connection";
char *xml_remote_lip = "local_ip";
while(logr->denyips[deny_size -1])
deny_size++;
}
-
-
+
+
/* conn and port must not be null */
if(!logr->conn)
{
os_calloc(1, sizeof(int), logr->proto);
logr->proto[0] = 0;
}
+ if(!logr->ipv6)
+ {
+ os_calloc(1, sizeof(int), logr->ipv6);
+ logr->ipv6[0] = 0;
+ }
if(!logr->lip)
{
os_calloc(1, sizeof(char *), logr->lip);
logr->lip[0] = NULL;
}
-
-
+
+
/* Cleaning */
while(logr->conn[pl] != 0)
pl++;
logr->port = realloc(logr->port, sizeof(int)*(pl +2));
logr->conn = realloc(logr->conn, sizeof(int)*(pl +2));
logr->proto = realloc(logr->proto, sizeof(int)*(pl +2));
+ logr->ipv6 = realloc(logr->ipv6, sizeof(int)*(pl +2));
logr->lip = realloc(logr->lip, sizeof(char *)*(pl +2));
if(!logr->port || !logr->conn || !logr->proto || !logr->lip)
{
merror(MEM_ERROR, ARGV0);
}
-
+
logr->port[pl] = 0;
logr->conn[pl] = 0;
logr->proto[pl] = 0;
+ logr->ipv6[pl] = 0;
logr->lip[pl] = NULL;
-
+
logr->port[pl +1] = 0;
logr->conn[pl +1] = 0;
logr->proto[pl +1] = 0;
+ logr->ipv6[pl +1] = 0;
logr->lip[pl +1] = NULL;
-
+
while(node[i])
{
if(!node[i]->element)
return(OS_INVALID);
}
}
+ else if(strcasecmp(node[i]->element,xml_remote_ipv6) == 0)
+ {
+ if(strcasecmp(node[i]->content, "yes") == 0)
+ {
+ logr->ipv6[pl] = 1;
+ }
+ }
else if(strcasecmp(node[i]->element,xml_remote_lip) == 0)
{
os_strdup(node[i]->content,logr->lip[pl]);
os_calloc(1, sizeof(os_ip), logr->allowips[allow_size -2]);
logr->allowips[allow_size -1] = NULL;
-
+
if(!OS_IsValidIP(node[i]->content,logr->allowips[allow_size -2]))
{
merror(INVALID_IP, ARGV0, node[i]->content);
{
deny_size++;
logr->denyips = realloc(logr->denyips,sizeof(os_ip *)*deny_size);
- if(!logr->denyips)
+ if(!logr->denyips)
{
merror(MEM_ERROR, ARGV0);
return(OS_INVALID);
merror(CONN_ERROR, ARGV0);
return(OS_INVALID);
}
-
+
/* Set port in here */
if(logr->port[pl] == 0)
{
if(logr->conn[pl] == SECURE_CONN)
logr->port[pl] = DEFAULT_SECURE;
else
- logr->port[pl] = DEFAULT_SYSLOG;
+ logr->port[pl] = DEFAULT_SYSLOG;
}
/* set default protocol */
{
logr->proto[pl] = UDP_PROTO;
}
-
+
return(0);
}