summaryrefslogtreecommitdiff
path: root/src/irmd/registry.h
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-21 21:12:03 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-21 21:12:03 +0200
commitf0d4305c067044e74c44032c32ce6c4db3c6fffa (patch)
treed895b25fb5a8f7af106c6c2d3228b62ade81b3b4 /src/irmd/registry.h
parentba27593e3e8406e109393ae383f17c7416675c1e (diff)
parentcee5ae97ee14438b2dabc06bfad9b02e42e4d816 (diff)
downloadouroboros-f0d4305c067044e74c44032c32ce6c4db3c6fffa.tar.gz
ouroboros-f0d4305c067044e74c44032c32ce6c4db3c6fffa.zip
Merged in dstaesse/ouroboros/be-irmd-refactor (pull request #213)
irmd, lib: Rebuild the IRMd data model
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 */