From 27b36b690a4b048721f0a568ef0aff03bf8e9855 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 7 Jul 2016 19:01:00 +0200 Subject: irmd: Prioritize local ipcp for local flows For locally registered processes, the IRMd will first look for the local, then the normal, then the shim-udp. It will look for a normal, a shim-eth-llc and ultimately a shim-udp for non-local destinations. It does not yet check if a remote destination is actually known in a DIF. Fixes #18. --- src/irmd/registry.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/irmd/registry.h') diff --git a/src/irmd/registry.h b/src/irmd/registry.h index 83b9d393..927b2364 100644 --- a/src/irmd/registry.h +++ b/src/irmd/registry.h @@ -23,10 +23,13 @@ #ifndef OUROBOROS_IRMD_REGISTRY_H #define OUROBOROS_IRMD_REGISTRY_H +#include #include #include +#include #include +#include #include #define reg_entry_has_api(e, id) (reg_entry_get_reg_instance(e, id) != NULL) @@ -78,6 +81,9 @@ struct reg_entry { /* known instances */ struct list_head ap_instances; + /* difs in which this name is registered */ + struct list_head difs; + char * req_ae_name; int response; @@ -96,6 +102,11 @@ struct reg_ap_name { char * ap_name; }; +struct reg_dif_name { + struct list_head next; + char * dif_name; +}; + struct reg_instance * reg_instance_create(pid_t api); void reg_instance_destroy(struct reg_instance * i); @@ -118,7 +129,12 @@ struct reg_auto * reg_entry_get_reg_auto(struct reg_entry * e, char * ap_name); pid_t reg_entry_resolve_api(struct reg_entry * e); char ** reg_entry_resolve_auto(struct reg_entry * e); - +bool reg_entry_is_local_in_dif(struct reg_entry * e, + char * dif_name); +int reg_entry_add_local_in_dif(struct reg_entry * e, + char * dif_name); +void reg_entry_del_local_from_dif(struct reg_entry * e, + char * dif_name); int registry_add_entry(struct list_head * registry, char * name, char * ap_name, -- cgit v1.2.3