summaryrefslogtreecommitdiff
path: root/include/ouroboros/irm.h
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-03-22 11:02:15 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-22 12:36:58 +0100
commit751fb58bcf5fdb31c0627a5153684e96126cffb6 (patch)
tree5c4e8d8b2b2b323738703644c422a7e6c7095d5e /include/ouroboros/irm.h
parentfd5508b8daec47e9f646c086d4cc310583154b97 (diff)
downloadouroboros-751fb58bcf5fdb31c0627a5153684e96126cffb6.tar.gz
ouroboros-751fb58bcf5fdb31c0627a5153684e96126cffb6.zip
lib: Simplify reg/unreg API
The reg/unreg API is simplified to registering and unregistering a single name with a single IPCP. The functionality associated with registering names was moved from the IRMd to the irm tool. The function to list IPCPs was simplified to return all IPCPs in the system with their basic properties needed for management. The above changes led to some needed changes in the irm tool and the management functions that were depending on the previous behaviour of list_ipcps. Command line functionality to list IPCPs in the system is also added to the irm tool. Some older code was refactored. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'include/ouroboros/irm.h')
-rw-r--r--include/ouroboros/irm.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h
index ed0b2f71..fe6d2e9f 100644
--- a/include/ouroboros/irm.h
+++ b/include/ouroboros/irm.h
@@ -35,19 +35,27 @@
/* Name binding options. */
#define BIND_AUTO 0x01
+#define NAME_SIZE 256
+#define LAYER_SIZE LAYER_NAME_SIZE
+
+struct ipcp_info {
+ pid_t pid;
+ enum ipcp_type type;
+ char name[NAME_SIZE];
+ char layer[LAYER_SIZE];;
+};
+
__BEGIN_DECLS
pid_t irm_create_ipcp(const char * name,
- enum ipcp_type ipcp_type);
+ enum ipcp_type type);
int irm_destroy_ipcp(pid_t pid);
-/* pids is an out-parameter */
-ssize_t irm_list_ipcps(const char * name,
- pid_t ** pids);
+ssize_t irm_list_ipcps(struct ipcp_info ** ipcps);
int irm_enroll_ipcp(pid_t pid,
- const char * layer_name);
+ const char * dst);
int irm_bootstrap_ipcp(pid_t pid,
const struct ipcp_config * conf);
@@ -75,13 +83,11 @@ int irm_bind_process(pid_t pid,
int irm_unbind_process(pid_t pid,
const char * name);
-int irm_reg(const char * name,
- char ** layers,
- size_t len);
+int irm_reg(pid_t pid,
+ const char * name);
-int irm_unreg(const char * name,
- char ** layers,
- size_t len);
+int irm_unreg(pid_t pid,
+ const char * name);
__END_DECLS