summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-08-20 10:42:36 +0200
committerdimitri staessens <[email protected]>2016-08-21 18:32:12 +0200
commit0efb1ff527ce3fb50d4c72c02904fa1cdd1e3a66 (patch)
tree9c0adf0b6ef3b9350c13939f6d40c79eca7546fd /include
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 'include')
-rw-r--r--include/ouroboros/dev.h3
-rw-r--r--include/ouroboros/irm.h23
-rw-r--r--include/ouroboros/irm_config.h3
-rw-r--r--include/ouroboros/list.h10
4 files changed, 25 insertions, 14 deletions
diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h
index a0885b70..d5fb744b 100644
--- a/include/ouroboros/dev.h
+++ b/include/ouroboros/dev.h
@@ -36,9 +36,6 @@
int ap_init(char * ap_name);
void ap_fini(void);
-/* This call binds an instance to a specific subset of applications */
-int api_bind(char * ap_subset);
-
/* Returns file descriptor (> 0) and client AE name. */
int flow_accept(char ** ae_name);
int flow_alloc_resp(int fd, int result);
diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h
index 9f27db05..cfad1295 100644
--- a/include/ouroboros/irm.h
+++ b/include/ouroboros/irm.h
@@ -31,7 +31,7 @@ pid_t irm_create_ipcp(char * name,
int irm_destroy_ipcp(pid_t api);
-/* APIs is an out-parameter */
+/* apis is an out-parameter */
ssize_t irm_list_ipcps(char * name,
pid_t ** apis);
@@ -41,15 +41,20 @@ int irm_enroll_ipcp(pid_t api,
int irm_bootstrap_ipcp(pid_t api,
struct dif_config * conf);
-int irm_bind(char * name,
- char * ap_name,
- uint16_t opts,
- int argc,
- char ** argv);
+int irm_bind_ap(char * ap,
+ char * name,
+ uint16_t opts,
+ int argc,
+ char ** argv);
-int irm_unbind(char * name,
- char * ap_name,
- uint16_t opts);
+int irm_unbind_ap(char * ap,
+ char * name);
+
+int irm_bind_api(pid_t api,
+ char * name);
+
+int irm_unbind_api(pid_t api,
+ char * name);
int irm_reg(char * name,
char ** difs,
diff --git a/include/ouroboros/irm_config.h b/include/ouroboros/irm_config.h
index dd68e4ec..f90ad927 100644
--- a/include/ouroboros/irm_config.h
+++ b/include/ouroboros/irm_config.h
@@ -30,8 +30,7 @@
#define BIND_AP_AUTO 0x01
#define BIND_AP_UNIQUE 0x02
-
-#define UNBIND_AP_HARD 0x01
+#define BIND_AP_LOC 0x04
enum ipcp_type {
IPCP_NORMAL = 0,
diff --git a/include/ouroboros/list.h b/include/ouroboros/list.h
index 49163efd..80fcb28c 100644
--- a/include/ouroboros/list.h
+++ b/include/ouroboros/list.h
@@ -135,6 +135,16 @@ void list_splice_init(struct list_head * list,
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
/**
+ * list_first_entry - get the struct for the first entry
+ * expects the list to be non-empty
+ * @ptr: the &struct list_head pointer.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_first_entry(ptr, type, member) \
+ list_entry((ptr)->next, type, member)
+
+/**
* list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop counter.
* @head: the head for your list.