summaryrefslogtreecommitdiff
path: root/src/irmd/registry.h
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-20 10:42:36 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-21 18:32:12 +0200
commit0efb1ff527ce3fb50d4c72c02904fa1cdd1e3a66 (patch)
tree9c0adf0b6ef3b9350c13939f6d40c79eca7546fd /src/irmd/registry.h
parentba27593e3e8406e109393ae383f17c7416675c1e (diff)
downloadouroboros-0efb1ff527ce3fb50d4c72c02904fa1cdd1e3a66.tar.gz
ouroboros-0efb1ff527ce3fb50d4c72c02904fa1cdd1e3a66.zip
irmd, lib: Rebuild the IRMd data model
The complete data model inside the IRMd has been restructured. The bind operation was revised to allow binding of AP and AP instances and register those names with different DIFs (see "irm bind" for details). Server applications require to call ap_init with a server name argument, client application that do not the be reachable over any DIF can call ap_init(NULL). Calling ap_init for a client with a specified name will not have adverse consequences for the application, but will consume unnecessary resources in the IRMd. Application servers can now be started at any point after the IRMd has been started. Starting servers, binding AP names and registering names in DIFs can be performed in any order that does not defy temporal logic. Supports naming instances by their pid. In case of IPCP Instances created with the IRM tool, the name assigned during "irm ipcp create" can be used. All the changes required updates in the tools.
Diffstat (limited to 'src/irmd/registry.h')
-rw-r--r--src/irmd/registry.h116
1 files changed, 52 insertions, 64 deletions
diff --git a/src/irmd/registry.h b/src/irmd/registry.h
index 19e27a21..35c4c10b 100644
--- a/src/irmd/registry.h
+++ b/src/irmd/registry.h
@@ -33,12 +33,11 @@
#include <string.h>
#include <sys/types.h>
-#include "reg_api.h"
+#include "api_table.h"
+#include "apn_table.h"
#define registry_has_name(r, name) \
- (registry_get_entry_by_name(r, name) != NULL)
-#define registry_name_has_api(r, name) \
- (registry_get_api_by_name(r, name) != NULL)
+ (registry_get_entry(r, name) != NULL)
enum reg_name_state {
REG_NAME_NULL = 0,
@@ -50,20 +49,18 @@ enum reg_name_state {
REG_NAME_DESTROY
};
-/* an entry in the registry */
+/* An entry in the registry */
struct reg_entry {
struct list_head next;
char * name;
/* DIFs in which this name is registered */
struct list_head difs;
-
- /* names of the APs that can listen to this name */
- struct list_head bindings;
- /* known instances */
+ /* APs that can be instantiated by the irmd */
+ struct list_head reg_apns;
+ /* Instances that are listening for this name */
struct list_head reg_apis;
- /* FIXME: flow handling information should not be here */
enum reg_name_state state;
char * req_ae_name;
int response;
@@ -71,58 +68,49 @@ struct reg_entry {
pthread_mutex_t state_lock;
};
-struct reg_binding * reg_entry_get_binding(struct reg_entry * e,
- char * apn);
-char ** reg_entry_get_auto_info(struct reg_entry * e);
-void reg_entry_del_binding(struct reg_entry * e,
- char * apn);
-struct reg_api * reg_entry_get_reg_api(struct reg_entry * e,
- pid_t api);
-
-pid_t reg_entry_resolve_api(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,
- enum ipcp_type type);
-void reg_entry_del_local_from_dif(struct reg_entry * e,
- char * dif_name);
-
-struct reg_entry * registry_assign(struct list_head * registry,
+int reg_entry_add_apn(struct reg_entry * e,
+ struct apn_entry * a);
+
+void reg_entry_del_apn(struct reg_entry * e,
+ char * apn);
+
+char * reg_entry_get_apn(struct reg_entry * e);
+
+
+int reg_entry_add_api(struct reg_entry * e,
+ pid_t api);
+
+void reg_entry_del_api(struct reg_entry * e,
+ pid_t api);
+
+pid_t reg_entry_get_api(struct reg_entry * e);
+
+struct reg_entry * registry_add_name(struct list_head * registry,
+ char * name);
+
+void registry_del_name(struct list_head * registry,
+ char * name);
+
+void registry_del_api(struct list_head * registry,
+ pid_t api);
+
+void registry_sanitize_apis(struct list_head * registry);
+
+struct reg_entry * registry_get_entry(struct list_head * registry,
char * name);
-void registry_deassign(struct list_head * registry,
- char * name);
-int registry_add_binding(struct list_head * registry,
- char * name,
- char * apn,
- uint32_t flags,
- char ** argv);
-void registry_del_binding(struct list_head * registry,
- char * name,
- char * apn);
-struct reg_api * registry_add_api_name(struct list_head * registry,
- pid_t api,
- char * name);
-void registry_del_api(struct list_head * registry,
- pid_t api);
-void registry_sanitize_apis(struct list_head * registry);
-struct reg_api * registry_get_api_by_name(struct list_head * registry,
- char * name);
-struct reg_entry * registry_get_entry_by_name(struct list_head * registry,
- char * name);
-struct reg_entry * registry_get_entry_by_apn(struct list_head * registry,
- char * apn);
-struct reg_entry * registry_get_entry_by_api(struct list_head * registry,
- pid_t api);
-char * registry_get_dif_for_dst(struct list_head * registry,
- char * dst_name);
-int registry_add_name_to_dif(struct list_head * registry,
- char * name,
- char * dif_name,
- enum ipcp_type type);
-void registry_del_name_from_dif(struct list_head * registry,
- char * name,
- char * dif_name);
-void registry_destroy(struct list_head * registry);
-
-#endif
+
+char * registry_get_dif_for_dst(struct list_head * registry,
+ char * dst_name);
+
+int registry_add_name_to_dif(struct list_head * registry,
+ char * name,
+ char * dif_name,
+ enum ipcp_type type);
+
+void registry_del_name_from_dif(struct list_head * registry,
+ char * name,
+ char * dif_name);
+
+void registry_destroy(struct list_head * registry);
+
+#endif /* OUROBOROS_IRMD_REGISTRY_H */