From c80c93f11dbfb1b0c07f9a6f8b8d91024e5db507 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 8 Mar 2020 13:29:21 +0100 Subject: irm: Revise naming API This revises the naming API to treat names (or reg_name in the source) as first-class citizens of the architecture. This is more in line with the way they are described in the article. Operations have been added to create/destroy names independently of registering. This was previously done only as part of register, and there was no way to delete a name from the IRMd. The create call now allows specifying a policy for load-balancing incoming flows for a name. The default is the new round-robin load-balancer, the previous behaviour is still available as a spillover load-balancer. The register calls will still create a name if it doesn't exist, with the default round-robin load-balancer. The tools now have a "name" section, so the format is now irm name ... Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/irmd/registry.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/irmd/registry.h') diff --git a/src/irmd/registry.h b/src/irmd/registry.h index 31c1b668..bc9aa23b 100644 --- a/src/irmd/registry.h +++ b/src/irmd/registry.h @@ -26,6 +26,7 @@ #include #include #include +#include #include "proc_table.h" #include "prog_table.h" @@ -54,9 +55,11 @@ struct reg_entry { struct list_head next; char * name; - /* Programs that can be instantiated by the irmd */ + /* Policies for this name. */ + enum pol_balance pol_lb; /* Load balance incoming flows. */ + /* Programs that can be instantiated by the irmd. */ struct list_head reg_progs; - /* Processes that are listening for this name */ + /* Processes that are listening for this name. */ struct list_head reg_pids; enum reg_name_state state; @@ -72,7 +75,6 @@ void reg_entry_del_prog(struct reg_entry * e, char * reg_entry_get_prog(struct reg_entry * e); - int reg_entry_add_pid(struct reg_entry * e, pid_t pid); @@ -84,6 +86,9 @@ void reg_entry_del_pid_el(struct reg_entry * e, pid_t reg_entry_get_pid(struct reg_entry * e); +void reg_entry_set_policy(struct reg_entry * e, + enum pol_balance p); + enum reg_name_state reg_entry_get_state(struct reg_entry * e); int reg_entry_set_state(struct reg_entry * e, -- cgit v1.2.3