summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-09-13 09:41:41 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-13 09:41:41 +0000
commit888d3dbe7c3844d2efe9d6bc9823630db5d47a3b (patch)
treeed79946a5ff22267857cd6d5a864d15339c942a1 /include
parent2e4cdc1f680d5ee9086adac76acebdec3bd1da3f (diff)
parent45c6615484ffe347654c34decb72ff1ef9bde0f3 (diff)
downloadouroboros-888d3dbe7c3844d2efe9d6bc9823630db5d47a3b.tar.gz
ouroboros-888d3dbe7c3844d2efe9d6bc9823630db5d47a3b.zip
Merged in dstaesse/ouroboros/be-rib-removal (pull request #589)
ipcpd: Revise internals of normal IPCP
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/CMakeLists.txt2
-rw-r--r--include/ouroboros/cdap.h89
-rw-r--r--include/ouroboros/notifier.h (renamed from include/ouroboros/nsm.h)34
-rw-r--r--include/ouroboros/rib.h77
-rw-r--r--include/ouroboros/rqueue.h71
-rw-r--r--include/ouroboros/wrap/ouroboros.i4
6 files changed, 12 insertions, 265 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt
index b6edac53..e94d5c6c 100644
--- a/include/ouroboros/CMakeLists.txt
+++ b/include/ouroboros/CMakeLists.txt
@@ -1,6 +1,5 @@
set(HEADER_FILES
cacep.h
- cdap.h
cdefs.h
dev.h
errno.h
@@ -8,7 +7,6 @@ set(HEADER_FILES
fqueue.h
ipcp.h
irm.h
- nsm.h
proto.h
qos.h)
diff --git a/include/ouroboros/cdap.h b/include/ouroboros/cdap.h
deleted file mode 100644
index 46ebca4b..00000000
--- a/include/ouroboros/cdap.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Ouroboros - Copyright (C) 2016 - 2017
- *
- * The Common Distributed Application Protocol
- *
- * Dimitri Staessens <dimitri.staessens@ugent.be>
- * Sander Vrijders <sander.vrijders@ugent.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., http://www.fsf.org/about/contact/.
- */
-
-#ifndef OUROBOROS_CDAP_H
-#define OUROBOROS_CDAP_H
-
-#include <ouroboros/cdefs.h>
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <unistd.h>
-
-#define F_SYNC 0x0001
-
-#define INVALID_CDAP_KEY -1
-#define CDAP_PROTO "CDAP"
-
-enum cdap_opcode {
- CDAP_READ = 0,
- CDAP_WRITE,
- CDAP_START,
- CDAP_STOP,
- CDAP_CREATE,
- CDAP_DELETE
-};
-
-struct cdap;
-
-typedef int32_t cdap_key_t;
-
-__BEGIN_DECLS
-
-struct cdap * cdap_create(void);
-
-int cdap_destroy(struct cdap * instance);
-
-int cdap_add_flow(struct cdap * instance,
- int fd);
-
-int cdap_del_flow(struct cdap * instance,
- int fd);
-
-cdap_key_t * cdap_request_send(struct cdap * instance,
- enum cdap_opcode code,
- const char * name,
- const void * data,
- size_t len,
- uint32_t flags);
-
-int cdap_reply_wait(struct cdap * instance,
- cdap_key_t key,
- uint8_t ** data,
- size_t * len);
-
-cdap_key_t cdap_request_wait(struct cdap * instance,
- enum cdap_opcode * opcode,
- char ** name,
- uint8_t ** data,
- size_t * len,
- uint32_t * flags);
-
-int cdap_reply_send(struct cdap * instance,
- cdap_key_t key,
- int result,
- const void * data,
- size_t len);
-
-__END_DECLS
-
-#endif /* OUROBOROS_CDAP_H */
diff --git a/include/ouroboros/nsm.h b/include/ouroboros/notifier.h
index d89a2ee4..7a70f95f 100644
--- a/include/ouroboros/nsm.h
+++ b/include/ouroboros/notifier.h
@@ -1,7 +1,7 @@
/*
* Ouroboros - Copyright (C) 2016 - 2017
*
- * The API to instruct the global Namespace Manager
+ * Notifier event system using callbacks
*
* Dimitri Staessens <dimitri.staessens@ugent.be>
* Sander Vrijders <sander.vrijders@ugent.be>
@@ -20,31 +20,21 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
-#ifndef OUROBOROS_NSM_H
-#define OUROBOROS_NSM_H
+#ifndef OUROBOROS_LIB_NOTIFIER_H
+#define OUROBOROS_LIB_NOTIFIER_H
-#include <ouroboros/cdefs.h>
+typedef void (* notifier_fn_t)(int event,
+ const void * o);
-#include <stdint.h>
-#include <unistd.h>
+int notifier_init(void);
-__BEGIN_DECLS
+void notifier_fini(void);
-int nsm_reg(char * name,
- char ** dafs,
- size_t dafs_size);
+void notifier_event(int event,
+ const void * o);
-int nsm_unreg(char * name,
- char ** dafs,
- size_t dafs_size);
+int notifier_reg(notifier_fn_t callback);
-/*
- * dafs is an out parameter
- * The amount of DAFs is returned
- */
-ssize_t nsm_resolve(char * name,
- char ** dafs);
-
-__END_DECLS
+void notifier_unreg(notifier_fn_t callback);
-#endif
+#endif /* OUROBOROS_LIB_NOTIFIER_H */
diff --git a/include/ouroboros/rib.h b/include/ouroboros/rib.h
deleted file mode 100644
index 281a4f20..00000000
--- a/include/ouroboros/rib.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Ouroboros - Copyright (C) 2016 - 2017
- *
- * Resource Information Base
- *
- * Dimitri Staessens <dimitri.staessens@ugent.be>
- * Sander Vrijders <sander.vrijders@ugent.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., http://www.fsf.org/about/contact/.
- */
-
-#ifndef OUROBOROS_LIB_RIB_H
-#define OUROBOROS_LIB_RIB_H
-
-#include <sys/types.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-#define RIB_ROOT ""
-
-#define PACK_HASH_ROOT 0x0001
-#define PACK_HASH_ALL 0x0002
-
-#define UNPACK_CREATE 0x0001
-
-int rib_init(void);
-
-void rib_fini(void);
-
-int rib_add(const char * parent,
- const char * name);
-
-int rib_del(char * path);
-
-ssize_t rib_read(const char * path,
- void * data,
- size_t len);
-
-int rib_write(const char * path,
- const void * data,
- size_t len);
-
-int rib_put(const char * path,
- void * data,
- size_t len);
-
-bool rib_has(const char * path);
-
-ssize_t rib_children(const char * path,
- char *** children);
-
-char * rib_path_append(char * path,
- const char * name);
-
-char * rib_name_gen(void * data,
- size_t len);
-
-ssize_t rib_pack(const char * path,
- uint8_t ** buf,
- uint32_t flags);
-
-int rib_unpack(uint8_t * packed,
- size_t len,
- uint32_t flags);
-
-#endif /* OUROBOROS_LIB_RIB_H */
diff --git a/include/ouroboros/rqueue.h b/include/ouroboros/rqueue.h
deleted file mode 100644
index 601a4ab6..00000000
--- a/include/ouroboros/rqueue.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Ouroboros - Copyright (C) 2016 - 2017
- *
- * RIB event queues
- *
- * Dimitri Staessens <dimitri.staessens@ugent.be>
- * Sander Vrijders <sander.vrijders@ugent.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., http://www.fsf.org/about/contact/.
- */
-
-#ifndef OUROBOROS_RQUEUE_H
-#define OUROBOROS_RQUEUE_H
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <time.h>
-
-#define RO_READ 0x00000001
-#define RO_MODIFY 0x00000002
-#define RO_CREATE 0x00000004
-#define RO_DELETE 0x00000008
-#define RO_START 0x00000010
-#define RO_STOP 0x00000020
-
-#define RO_NO_OPS 0x00000000
-#define RO_ALL_OPS 0xFFFFFFFF
-
-struct ro_set;
-
-struct rqueue;
-
-typedef struct ro_set ro_set_t;
-typedef struct rqueue rqueue_t;
-
-ro_set_t * ro_set_create(void);
-
-void ro_set_destroy(ro_set_t * set);
-
-rqueue_t * rqueue_create(void);
-
-int rqueue_destroy(struct rqueue * rq);
-
-int ro_set_zero(ro_set_t * set);
-
-int ro_set_add(ro_set_t * set,
- const char * path,
- int32_t flags);
-
-int ro_set_del(ro_set_t * set,
- const char * path);
-
-int32_t rqueue_next(rqueue_t * rq,
- char * path);
-
-int rib_event_wait(ro_set_t * set,
- rqueue_t * rq,
- const struct timespec * timeout);
-
-#endif /* OUROBOROS_RQUEUE_H */
diff --git a/include/ouroboros/wrap/ouroboros.i b/include/ouroboros/wrap/ouroboros.i
index ebda2453..db5e09f2 100644
--- a/include/ouroboros/wrap/ouroboros.i
+++ b/include/ouroboros/wrap/ouroboros.i
@@ -23,14 +23,12 @@
%{
#include "ouroboros/cdefs.h"
#include "ouroboros/cacep.h"
-#include "ouroboros/cdap.h"
#include "ouroboros/dev.h"
#include "ouroboros/errno.h"
#include "ouroboros/fccntl.h"
#include "ouroboros/fqueue.h"
#include "ouroboros/irm.h"
#include "ouroboros/ipcp.h"
-#include "ouroboros/nsm.h"
#include "ouroboros/qos.h"
%}
@@ -38,12 +36,10 @@ typedef int pid_t;
%include "ouroboros/cdefs.h"
%include "ouroboros/cacep.h"
-%include "ouroboros/cdap.h"
%include "ouroboros/dev.h"
%include "ouroboros/errno.h"
%include "ouroboros/fccntl.h"
%include "ouroboros/fqueue.h"
%include "ouroboros/irm.h"
%include "ouroboros/ipcp.h"
-%include "ouroboros/nsm.h"
%include "ouroboros/qos.h"