xmlChar *mainloop_intervals;
xmlChar *communication_intervals;
xmlChar *independent;
+ xmlChar *htb_node;
+ xmlChar *htb_parent;
xmlNodePtr fields = ident->children;
ident_peer *current = 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);
/** List of the identity's members (type IDENT_SET only). */
ident_member *members;
+ /** If NM is setting up the hierarchy for us, this is the htb node to use
+ * for this identity. */
+ int htb_node;
+
+ /** If NM is setting up the hierarchy for us, this is the htb parent node
+ * to use for this identity. */
+ int htb_parent;
+
/** Pointer to the next ident in the list or NULL if this is the last. */
struct ident_config *next;
} ident_config;
* Add the config options for DRL.
*/
-static config_entry_t enforce_on = {
+static config_entry_t create_htb = {
.next = NULL,
+ .key = "create_htb",
+ .type = CONFIG_TYPE_INT,
+ .options = CONFIG_OPT_NONE,
+ .u = { .value = 1 },
+};
+
+static config_entry_t enforce_on = {
+ .next = &create_htb,
.key = "enforce_on",
.type = CONFIG_TYPE_INT,
.options = CONFIG_OPT_NONE,
ident->comm.remote_nodes = comm_nodes;
+ if (!create_htb.u.value) {
+ ident->htb_node = config->htb_node;
+ ident->htb_parent = config->htb_parent;
+ }
+
return ident;
}
return 1;
}
+ if (!create_htb.u.value) {
+ if (config->htb_node < 0 || config->htb_parent < 0) {
+ printlog(LOG_CRITICAL, "When create_htb is disabled in ulogd.conf, an identity must specify the htb_node and htb_parent propertities in its configuration.\n");
+ return 1;
+ }
+ } else {
+ if (config->htb_node > -1 || config->htb_parent > -1) {
+ printlog(LOG_WARN, "htb_node or htb_parent are configured but ignored because we're configured to create our own htb hierarchy.\n");
+ }
+ }
+
/* Note: Parsing stage requires that each ident has at least one peer. */
return 0;
}
int i, j;
int next_node = 0x100;
+ /* If we're not going to create our own htb hierarchy (for instance,
+ * if we're going to let PL's node manager do it for us), then we don't
+ * want this function to do anything. */
+ if (!create_htb.u.value) {
+ printlog(LOG_DEBUG, "Skipping assign_htb_hierarchy becase ulogd.conf's create_htb set to 0.\n");
+ return 0;
+ }
+
/* Chain machine nodes under 1:10. */
for (i = 0; i < instance->machine_count; ++i) {
if (instance->machines[i]->parent == NULL) {
int i, j, k;
uint64_t gigabit = 1024 * 1024 * 1024;
+ /* If we're not going to create our own htb hierarchy (for instance,
+ * if we're going to let PL's node manager do it for us), then we don't
+ * want this function to do anything. */
+ if (!create_htb.u.value) {
+ printlog(LOG_DEBUG, "Skipping create_htb_hierarchy becase ulogd.conf's create_htb set to 0.\n");
+ return 0;
+ }
+
/* Nuke the hierarchy. */
sprintf(cmd, "tc qdisc del dev eth0 root handle 1: htb");
execute_cmd(cmd);