Added an 'independent' option for set identites that will put them under the
[distributedratelimiting.git] / drl / config.c
index 65d8eb9..8b15cd2 100644 (file)
@@ -107,6 +107,7 @@ static int parse_common(xmlDocPtr doc, xmlNodePtr ident, ident_config *common) {
     xmlChar *ewma;
     xmlChar *mainloop_intervals;
     xmlChar *communication_intervals;
+    xmlChar *independent;
     xmlNodePtr fields = ident->children;
     ident_peer *current = NULL;
 
@@ -206,6 +207,14 @@ static int parse_common(xmlDocPtr doc, xmlNodePtr ident, ident_config *common) {
         xmlFree(communication_intervals);
     }
 
+    independent = xmlGetProp(ident, (const xmlChar *) "independent");
+    if (independent == NULL) {
+        common->independent = 0;
+    } else {
+        common->independent = atoi((const char *) independent);
+        xmlFree(independent);
+    }
+
     while (fields != NULL) {
         if((!xmlStrcmp(fields->name, (const xmlChar *) "peer"))) {
             xmlChar *ip = xmlNodeListGetString(doc, fields->children, 1);