diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2020-03-08 13:29:21 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2020-03-15 14:20:38 +0100 |
commit | c80c93f11dbfb1b0c07f9a6f8b8d91024e5db507 (patch) | |
tree | c6ac06aa8841bcb4a403507deda4401594d5cdbe /include/ouroboros/irm.h | |
parent | 8796a612f0600fc973aa908b84ded837f3470512 (diff) | |
download | ouroboros-c80c93f11dbfb1b0c07f9a6f8b8d91024e5db507.tar.gz ouroboros-c80c93f11dbfb1b0c07f9a6f8b8d91024e5db507.zip |
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 <operation> <name> ...
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include/ouroboros/irm.h')
-rw-r--r-- | include/ouroboros/irm.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h index 69a23c47..2bb284b0 100644 --- a/include/ouroboros/irm.h +++ b/include/ouroboros/irm.h @@ -39,11 +39,22 @@ #define NAME_SIZE 256 #define LAYER_SIZE LAYER_NAME_SIZE +/* Load balancing policy for incoming flows. */ +enum pol_balance { + LB_RR = 0, + LB_SPILL +}; + struct ipcp_info { pid_t pid; enum ipcp_type type; char name[NAME_SIZE]; - char layer[LAYER_SIZE];; + char layer[LAYER_SIZE]; +}; + +struct name_info { + char name[NAME_SIZE]; + enum pol_balance pol_lb; }; __BEGIN_DECLS @@ -85,11 +96,18 @@ int irm_bind_process(pid_t pid, int irm_unbind_process(pid_t pid, const char * name); -int irm_reg(pid_t pid, - const char * name); +int irm_create_name(const char * name, + enum pol_balance pol); + +int irm_destroy_name(const char * name); + +ssize_t irm_list_names(struct name_info ** names); + +int irm_reg_name(const char * name, + pid_t pid); -int irm_unreg(pid_t pid, - const char * name); +int irm_unreg_name(const char * name, + pid_t pid); __END_DECLS |