summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-03-21 17:43:51 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-21 17:51:38 +0100
commitfd5508b8daec47e9f646c086d4cc310583154b97 (patch)
treec27d93cee13d9183eecbef842575f94848b2f079 /src
parent4230103ff633904c69cc18d861bf42781f57bb64 (diff)
downloadouroboros-fd5508b8daec47e9f646c086d4cc310583154b97.tar.gz
ouroboros-fd5508b8daec47e9f646c086d4cc310583154b97.zip
irmd: Remove obsolete layer to name mappings
The IRMd kept a mapping from layer names to registered names, but this is obsolete since the introduction of the query functionality. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src')
-rw-r--r--src/irmd/main.c10
-rw-r--r--src/irmd/registry.c93
-rw-r--r--src/irmd/registry.h9
3 files changed, 0 insertions, 112 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index f9cb8fd2..411df6dd 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -964,13 +964,6 @@ static int name_reg(const char * name,
pthread_rwlock_wrlock(&irmd.reg_lock);
- if (registry_add_name_to_layer(&irmd.registry,
- name,
- e->layer_name,
- e->type) < 0)
- log_warn("Registered unbound name %s. "
- "Registry may be corrupt.",
- name);
log_info("Registered %s in %s as " HASH_FMT ".",
name, e->layer_name, HASH_VAL(hash));
++ret;
@@ -1035,9 +1028,6 @@ static int name_unreg(const char * name,
pthread_rwlock_wrlock(&irmd.reg_lock);
- registry_del_name_from_layer(&irmd.registry,
- name,
- e->layer_name);
log_info("Unregistered %s from %s.",
name, e->layer_name);
++ret;
diff --git a/src/irmd/registry.c b/src/irmd/registry.c
index ace9f225..6da36055 100644
--- a/src/irmd/registry.c
+++ b/src/irmd/registry.c
@@ -42,12 +42,6 @@
#include <limits.h>
#include <assert.h>
-struct reg_layer {
- struct list_head next;
- char * layer_name;
- enum ipcp_type type;
-};
-
static struct reg_entry * reg_entry_create(void)
{
struct reg_entry * e = malloc(sizeof(*e));
@@ -69,7 +63,6 @@ static int reg_entry_init(struct reg_entry * e,
return -1;
list_head_init(&e->next);
- list_head_init(&e->layers);
list_head_init(&e->reg_progs);
list_head_init(&e->reg_pids);
@@ -121,13 +114,6 @@ static void cancel_reg_entry_destroy(void * o)
free(a);
}
- list_for_each_safe(p, h, &e->layers) {
- struct reg_layer * d = list_entry(p, struct reg_layer, next);
- list_del(&d->next);
- free(d->layer_name);
- free(d);
- }
-
free(e);
}
@@ -158,62 +144,6 @@ static void reg_entry_destroy(struct reg_entry * e)
pthread_cleanup_pop(true);
}
-static bool reg_entry_is_local_in_layer(struct reg_entry * e,
- const char * layer_name)
-{
- struct list_head * p = NULL;
-
- list_for_each(p, &e->layers) {
- struct reg_layer * d = list_entry(p, struct reg_layer, next);
- if (!strcmp(layer_name, d->layer_name))
- return true;
- }
-
- return false;
-}
-
-static int reg_entry_add_local_in_layer(struct reg_entry * e,
- const char * layer_name,
- enum ipcp_type type)
-{
- struct reg_layer * rdn;
-
- /* already registered. Is ok */
- if (reg_entry_is_local_in_layer(e, layer_name))
- return 0;
-
- rdn = malloc(sizeof(*rdn));
- if (rdn == NULL)
- return -1;
-
- rdn->layer_name = strdup(layer_name);
- if (rdn->layer_name == NULL) {
- free(rdn);
- return -1;
- }
-
- rdn->type = type;
- list_add(&rdn->next, &e->layers);
-
- return 0;
-}
-
-static void reg_entry_del_local_from_layer(struct reg_entry * e,
- const char * layer_name)
-{
- struct list_head * p = NULL;
- struct list_head * h = NULL;
-
- list_for_each_safe(p, h, &e->layers) {
- struct reg_layer * d = list_entry(p, struct reg_layer, next);
- if (!strcmp(layer_name, d->layer_name)) {
- list_del(&d->next);
- free(d->layer_name);
- free(d);
- }
- }
-}
-
static bool reg_entry_has_prog(struct reg_entry * e,
const char * prog)
{
@@ -637,29 +567,6 @@ void registry_del_process(struct list_head * registry,
return;
}
-int registry_add_name_to_layer(struct list_head * registry,
- const char * name,
- const char * layer_name,
- enum ipcp_type type)
-{
- struct reg_entry * re = registry_get_entry(registry, name);
- if (re == NULL)
- return -1;
-
- return reg_entry_add_local_in_layer(re, layer_name, type);
-}
-
-void registry_del_name_from_layer(struct list_head * registry,
- const char * name,
- const char * layer_name)
-{
- struct reg_entry * re = registry_get_entry(registry, name);
- if (re == NULL)
- return;
-
- reg_entry_del_local_from_layer(re, layer_name);
-}
-
void registry_destroy(struct list_head * registry)
{
struct list_head * p = NULL;
diff --git a/src/irmd/registry.h b/src/irmd/registry.h
index 08fa9f28..c570be32 100644
--- a/src/irmd/registry.h
+++ b/src/irmd/registry.h
@@ -119,15 +119,6 @@ struct reg_entry * registry_get_entry_by_hash(struct list_head * registry,
const uint8_t * hash,
size_t len);
-int registry_add_name_to_layer(struct list_head * registry,
- const char * name,
- const char * layer_name,
- enum ipcp_type type);
-
-void registry_del_name_from_layer(struct list_head * registry,
- const char * name,
- const char * layer_name);
-
void registry_destroy(struct list_head * registry);
#endif /* OUROBOROS_IRMD_REGISTRY_H */