From f0646875d0bc941e339d305d0c68b13543cd6f2a Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 25 Oct 2016 13:22:51 +0200 Subject: lib, irmd, ipcpd: Add name querying to IPCPs This adds the ability to query IPCPs if a name can be reached through them, e.g. if a name is available in a DIF. This means that in the shim-udp a DNS query is performed, in the shim-eth-llc an ARP-like query has been added, in the local a check is done to see if the name is registered, and in the normal currently no application is reachable through it. --- src/irmd/registry.c | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'src/irmd/registry.c') diff --git a/src/irmd/registry.c b/src/irmd/registry.c index 9442f3db..07ec370c 100644 --- a/src/irmd/registry.c +++ b/src/irmd/registry.c @@ -20,15 +20,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "registry.h" -#include "utils.h" - #define OUROBOROS_PREFIX "registry" +#include #include #include #include +#include "registry.h" +#include "utils.h" + #include #include #include @@ -405,44 +406,6 @@ void registry_del_api(struct list_head * registry, return; } -char * registry_get_dif_for_dst(struct list_head * registry, - char * dst_name) -{ - struct list_head * pos = NULL; - struct reg_entry * re = - registry_get_entry(registry, dst_name); - - if (re != NULL) { /* local AP */ - list_for_each(pos, &re->difs) { - struct reg_dif * rd = - list_entry(pos, struct reg_dif, next); - if (rd->type == IPCP_LOCAL) - return rd->dif_name; - } - - list_for_each(pos, &re->difs) { - struct reg_dif * rd = - list_entry(pos, struct reg_dif, next); - if (rd->type == IPCP_NORMAL) - return rd->dif_name; - } - - list_for_each(pos, &re->difs) { - struct reg_dif * rd = - list_entry(pos, struct reg_dif, next); - if (rd->type == IPCP_SHIM_UDP) - return rd->dif_name; - } - - LOG_DBG("Could not find DIF for %s.", dst_name); - - return NULL; - } else { - LOG_DBG("No local ap %s found.", dst_name); - return NULL; - } -} - int registry_add_name_to_dif(struct list_head * registry, char * name, char * dif_name, -- cgit v1.2.3