summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-22 16:53:52 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-22 16:53:52 +0200
commitcf5d13dfd66afd68dd7fe93d009a4539c236b095 (patch)
treefbb6c556e833e5af3cead917c8ac547853f0382f /src/lib
parent34bcd67e4811be85e11253e4176ec9fec5c3bbef (diff)
downloadouroboros-cf5d13dfd66afd68dd7fe93d009a4539c236b095.tar.gz
ouroboros-cf5d13dfd66afd68dd7fe93d009a4539c236b095.zip
lib: Change DA header to NSM
Functionality that was previously thought to be part of the DIF Allocator is actually namespace management. Hence the file has been renamed and the API updated.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/CMakeLists.txt2
-rw-r--r--src/lib/ipcp.c13
-rw-r--r--src/lib/ipcpd_messages.proto2
-rw-r--r--src/lib/nsm.c (renamed from src/lib/da.c)25
4 files changed, 25 insertions, 17 deletions
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index ed7f2fc6..2a75ef17 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -25,13 +25,13 @@ set(SOURCE_FILES
# Add source files here
bitmap.c
cdap.c
- da.c
dev.c
du_buff.c
instance_name.c
ipcp.c
irm.c
list.c
+ nsm.c
shm_ap_rbuff.c
shm_du_map.c
sockets.c
diff --git a/src/lib/ipcp.c b/src/lib/ipcp.c
index a43afd21..730880f9 100644
--- a/src/lib/ipcp.c
+++ b/src/lib/ipcp.c
@@ -275,35 +275,32 @@ int ipcp_bootstrap(pid_t pid,
}
int ipcp_enroll(pid_t pid,
- char * member_name,
+ char * dif_name,
char * n_1_dif)
{
ipcp_msg_t msg = IPCP_MSG__INIT;
ipcp_msg_t * recv_msg = NULL;
int ret = -1;
- if (n_1_dif == NULL || member_name == NULL)
+ if (n_1_dif == NULL || dif_name == NULL)
return -EINVAL;
- msg.code = IPCP_MSG_CODE__IPCP_ENROLL;
- msg.member_name = member_name;
- msg.n_1_dif = n_1_dif;
+ msg.code = IPCP_MSG_CODE__IPCP_ENROLL;
+ msg.dif_name = dif_name;
+ msg.n_1_dif = n_1_dif;
recv_msg = send_recv_ipcp_msg(pid, &msg);
if (recv_msg == NULL) {
- free(msg.member_name);
return -1;
}
if (recv_msg->has_result == false) {
ipcp_msg__free_unpacked(recv_msg, NULL);
- free(msg.member_name);
return -1;
}
ret = recv_msg->result;
ipcp_msg__free_unpacked(recv_msg, NULL);
- free(msg.member_name);
return ret;
}
diff --git a/src/lib/ipcpd_messages.proto b/src/lib/ipcpd_messages.proto
index 63e41986..9eb5707c 100644
--- a/src/lib/ipcpd_messages.proto
+++ b/src/lib/ipcpd_messages.proto
@@ -15,7 +15,7 @@ enum ipcp_msg_code {
message ipcp_msg {
required ipcp_msg_code code = 1;
- optional string member_name = 2;
+ optional string dif_name = 2;
optional string n_1_dif = 3;
repeated string dif_names = 4;
optional int32 len = 5;
diff --git a/src/lib/da.c b/src/lib/nsm.c
index 8e7756d1..069db139 100644
--- a/src/lib/da.c
+++ b/src/lib/nsm.c
@@ -1,7 +1,7 @@
/*
* Ouroboros - Copyright (C) 2016
*
- * The API to instruct the DIF Allocator
+ * The API to instruct the global Namespace Manager
*
* Sander Vrijders <sander.vrijders@intec.ugent.be>
*
@@ -20,15 +20,26 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <ouroboros/da.h>
+#include <ouroboros/nsm.h>
-char * da_resolve_daf(char * daf_name)
+int nsm_reg(char * name,
+ char ** dafs,
+ size_t dafs_size)
{
- return NULL;
+
+ return -1;
+}
+
+int nsm_unreg(char * name,
+ char ** dafs,
+ size_t dafs_size)
+{
+
+ return -1;
}
-ssize_t da_resolve_dap(char * name,
- char ** n_1_difs)
+ssize_t nsm_resolve(char * name,
+ char ** dafs)
{
- return 0;
+ return -1;
}