xmlChar *mainloop_intervals;
xmlChar *communication_intervals;
xmlChar *independent;
+ xmlChar *htb_node;
+ xmlChar *htb_parent;
xmlNodePtr fields = ident->children;
ident_peer *current = NULL;
/* The struct has been memsetted to 0, this is just to be safe. */
+#ifdef BUILD_ZOOKEEPER
common->zk_host = NULL;
+#endif
common->peers = NULL;
common->members = NULL;
common->next = NULL;
xmlFree(independent);
}
+ htb_node = xmlGetProp(ident, (const xmlChar *) "htb_node");
+ htb_parent = xmlGetProp(ident, (const xmlChar *) "htb_parent");
+ if (htb_node == NULL) {
+ common->htb_node = -1;
+ } else {
+ sscanf((const char *)htb_node, "%x", &common->htb_node);
+ xmlFree(htb_node);
+ }
+ if (htb_parent == NULL) {
+ common->htb_parent = -1;
+ } else {
+ sscanf((const char *)htb_parent, "%x", &common->htb_parent);
+ xmlFree(htb_parent);
+ }
+
while (fields != NULL) {
if((!xmlStrcmp(fields->name, (const xmlChar *) "peer"))) {
xmlChar *ip = xmlNodeListGetString(doc, fields->children, 1);
} else if ((!xmlStrcmp(fields->name, (const xmlChar *) "zkhost"))) {
xmlChar *host = xmlNodeListGetString(doc, fields->children, 1);
+#ifdef BUILD_ZOOKEEPER
common->zk_host = strdup((const char *) host);
if (common->zk_host == NULL) {
return ENOMEM;
}
-
+#endif
xmlFree(host);
}
fields = fields->next;
return EINVAL;
}
+#ifdef BUILD_ZOOKEEPER
if (common->membership == ZOOKEEPER && common->zk_host == NULL) {
printlog(LOG_CRITICAL, "Group membership protocol ZOOKEEPER requires a zkhost field.\n");
return EINVAL;
}
-
+#endif
/* No errors. */
return 0;
}