ident->ewma_weight = pow(ident->fixed_ewma_weight,
(limiter.estintms/1000.0) * config->mainloop_intervals);
ident->parent = NULL;
+ ident->independent = config->independent;
pthread_mutex_init(&ident->table_mutex, NULL);
switch (config->accounting) {
return EINVAL;
}
+ if (mlist->independent) {
+ printlog(LOG_CRITICAL, "Makes no sense to have independent machine node - setting independent to false.\n");
+ mlist->independent = 0;
+ }
+
mlist = mlist->next;
}
instance->sets = malloc(configs.set_count * sizeof(identity_t *));
if (instance->sets == NULL) {
+ printlog(LOG_CRITICAL, "Not enough memory to allocate set identity collection.\n");
return ENOMEM;
}
instance->sets[i] = new_identity(slist);
if (instance->sets[i] == NULL) {
+ printlog(LOG_CRITICAL, "Not enough memory to allocate set identity.\n");
return ENOMEM;
}
child_leaf = map_search(instance->leaf_map, &members->value,
sizeof(members->value));
if (child_leaf == NULL) {
+ printlog(LOG_CRITICAL, "xid: child leaf not found.\n");
return EINVAL;
}
if (child_leaf->parent != NULL) {
/* Error - This leaf already has a parent. */
+ printlog(LOG_CRITICAL, "xid: child already has a parent.\n");
return EINVAL;
}
child_leaf->parent = instance->sets[i];
child_ident = map_search(instance->ident_map, &members->value,
sizeof(members->value));
if (child_ident == NULL) {
+ printlog(LOG_CRITICAL, "guid: child identity not found.\n");
return EINVAL;
}
if (child_ident->parent != NULL) {
/* Error - This identity already has a parent. */
+ printlog(LOG_CRITICAL, "guid: child identity already has a parent.\n");
return EINVAL;
}
child_ident->parent = instance->sets[i];
identity_action *loop_action;
identity_action *comm_action;
- if (instance->sets[i]->parent == NULL) {
+ if (instance->sets[i]->parent == NULL && instance->sets[i]->independent == 0) {
instance->sets[i]->parent = instance->last_machine;
}
* already there. */
for (j = (instance->set_count - 1); j >= 0; --j) {
if (instance->sets[j]->parent == NULL) {
+ /* Independent node - goes under 0x10 away from machine nodes. */
instance->sets[j]->htb_parent = 0x10;
} else {
instance->sets[j]->htb_parent = instance->sets[j]->parent->htb_node;
}
}
-#if 0
-#ifdef DELAY40MS
- /* Only for artificial delay testing. */
- sprintf(cmd, "/sbin/tc qdisc del dev eth0 parent 1:1000 handle 1000 pfifo");
- execute_cmd(cmd);
-
- sprintf(cmd, "/sbin/tc qdisc replace dev eth0 parent 1:1000 handle 1000 netem loss 0 delay 40ms");
- execute_cmd(cmd);
- sprintf(cmd, "/sbin/tc qdisc del dev eth0 parent 1:11f9 handle 11f9 pfifo");
- execute_cmd(cmd);
-
- sprintf(cmd, "/sbin/tc qdisc replace dev eth0 parent 1:11f9 handle 11f9 netem loss 0 delay 40ms");
- execute_cmd(cmd);
- sprintf(cmd, "/sbin/tc qdisc del dev eth0 parent 1:11fa handle 11fa pfifo");
- execute_cmd(cmd);
-
- sprintf(cmd, "/sbin/tc qdisc replace dev eth0 parent 1:11fa handle 11fa netem loss 0 delay 40ms");
- execute_cmd(cmd);
- /* End delay testing */
-#endif
-#endif
-
return 0;
}
free_ident_list(configs.machines);
free_ident_list(configs.sets);
- /* Debugging - FIXME: remove this? */
print_instance(&limiter.stable_instance);
switch (limiter.policy) {
free_ident_list(configs.machines);
free_ident_list(configs.sets);
- /* Debugging - FIXME: remove this? */
print_instance(&limiter.new_instance);
/* Lock */