summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-03-29 23:32:04 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-03-30 00:00:20 +0200
commit2ed8914deed73a558c6fbac7f107f47dc22f22d2 (patch)
tree7343797577910a35fc90f707e1618054ae90b839 /include
parent1d4442e472d20f261986089ea468daa93631d1f4 (diff)
downloadouroboros-2ed8914deed73a558c6fbac7f107f47dc22f22d2.tar.gz
ouroboros-2ed8914deed73a558c6fbac7f107f47dc22f22d2.zip
lib: renamed rina_name_t to instance_name_t
all functions taking a char * ap_name and uint id now take either a instance_name_t or instance_name_t *
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/CMakeLists.txt2
-rw-r--r--include/ouroboros/da.h2
-rw-r--r--include/ouroboros/instance_name.h (renamed from include/ouroboros/rina_name.h)51
-rw-r--r--include/ouroboros/ipcp.h10
-rw-r--r--include/ouroboros/irm.h35
-rw-r--r--include/ouroboros/sockets.h1
6 files changed, 44 insertions, 57 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt
index cc6b9103..324a85ad 100644
--- a/include/ouroboros/CMakeLists.txt
+++ b/include/ouroboros/CMakeLists.txt
@@ -9,11 +9,11 @@ set(HEADER_FILES
da.h
dev.h
du_buff.h
+ instance_name.h
ipcp.h
irm.h
list.h
logs.h
- rina_name.h
shm_du_map.h
sockets.h
utils.h
diff --git a/include/ouroboros/da.h b/include/ouroboros/da.h
index f678007d..9ecd4bd8 100644
--- a/include/ouroboros/da.h
+++ b/include/ouroboros/da.h
@@ -24,7 +24,7 @@
#define OUROBOROS_DA_H
#include "common.h"
-#include "rina_name.h"
+#include "instance_name.h"
char * da_resolve_daf(char * daf_name);
/*
diff --git a/include/ouroboros/rina_name.h b/include/ouroboros/instance_name.h
index f8af00c2..b3e528c0 100644
--- a/include/ouroboros/rina_name.h
+++ b/include/ouroboros/instance_name.h
@@ -19,21 +19,21 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef RINA_NAME_H
-#define RINA_NAME_H
+#ifndef INSTANCE_NAME_H
+#define INSTANCE_NAME_H
#include "common.h"
typedef struct {
- char * ap_name;
- unsigned int api_id;
-} rina_name_t;
+ char * name;
+ uint16_t id;
+} instance_name_t;
/*
* Allocates a new name, returning the allocated object.
* In case of an error, a NULL is returned.
*/
-rina_name_t * name_create();
+instance_name_t * instance_name_create();
/*
* Initializes a previously dynamically allocated name (i.e. name_create())
@@ -46,49 +46,44 @@ rina_name_t * name_create();
*
* It is allowed to call name_init() over an already initialized object
*/
-rina_name_t * name_init_from(rina_name_t * dst,
- const char * ap_name,
- unsigned int api_id);
+instance_name_t * instance_name_init_from(instance_name_t * dst,
+ const char * name,
+ uint16_t api_id);
/* Takes ownership of the passed parameters */
-rina_name_t * name_init_with(rina_name_t * dst,
- char * ap_name,
- unsigned int api_id);
+instance_name_t * instance_name_init_with(instance_name_t * dst,
+ char * name,
+ uint16_t id);
/*
* Finalize a name object, releasing all the embedded resources (without
* releasing the object itself). After name_fini() execution the passed
* object will be in the same states as at the end of name_init().
*/
-void name_fini(rina_name_t * dst);
+void instance_name_fini(instance_name_t * dst);
/* Releases all the associated resources bound to a name object */
-void name_destroy(rina_name_t * ptr);
+void instance_name_destroy(instance_name_t * ptr);
/* Duplicates a name object, returning the pointer to the new object */
-rina_name_t * name_dup(const rina_name_t * src);
+instance_name_t * instance_name_dup(const instance_name_t * src);
/*
* Copies the source object contents into the destination object, both must
* be previously allocated
*/
-int name_cpy(const rina_name_t * src, rina_name_t * dst);
+int instance_name_cpy(const instance_name_t * src,
+ instance_name_t * dst);
-bool name_is_equal(const rina_name_t * a, const rina_name_t * b);
-bool name_is_ok(const rina_name_t * n);
+int instance_name_cmp(const instance_name_t * a,
+ const instance_name_t * b);
-#define NAME_CMP_APN 0x01
-#define NAME_CMP_API 0x02
-#define NAME_CMP_ALL (NAME_CMP_APN | NAME_CMP_API)
-
-bool name_cmp(uint8_t flags,
- const rina_name_t * a,
- const rina_name_t * b);
+bool instance_name_is_valid(const instance_name_t * n);
/* Returns a name as a (newly allocated) string */
-char * name_to_string(const rina_name_t * n);
+char * instance_name_to_string(const instance_name_t * n);
/* Inverse of name_tostring() */
-rina_name_t * string_to_name(const char * s);
+instance_name_t * string_to_instance_name(const char * s);
-#endif
+#endif /* INSTANCE_NAME_H */
diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h
index cd4a3f51..49b04908 100644
--- a/include/ouroboros/ipcp.h
+++ b/include/ouroboros/ipcp.h
@@ -26,14 +26,14 @@
#include <sys/types.h>
#include "common.h"
-#include "rina_name.h"
+#include "instance_name.h"
struct ipcp;
/* Returns the process id */
-pid_t ipcp_create(rina_name_t name,
- char * ipcp_type);
-int ipcp_destroy(pid_t pid);
+pid_t ipcp_create(instance_name_t * api,
+ char * ipcp_type);
+int ipcp_destroy(pid_t pid);
int ipcp_reg(pid_t pid,
char ** difs,
@@ -50,4 +50,4 @@ int ipcp_enroll(pid_t pid,
char ** n_1_difs,
ssize_t n_1_difs_size);
-#endif
+#endif /* OUROBOROS_IPCP_H */
diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h
index fe72aefe..780bf77b 100644
--- a/include/ouroboros/irm.h
+++ b/include/ouroboros/irm.h
@@ -24,28 +24,21 @@
#define OUROBOROS_IRM_H
#include "common.h"
-#include "rina_name.h"
+#include "instance_name.h"
-int irm_create_ipcp(char * ap_name,
- int api_id,
- char * ipcp_type);
-int irm_destroy_ipcp(char * ap_name,
- int api_id);
+int irm_create_ipcp(instance_name_t * api,
+ char * ipcp_type);
+int irm_destroy_ipcp(instance_name_t * api);
-int irm_bootstrap_ipcp(char * ap_name,
- int api_id,
+int irm_bootstrap_ipcp(instance_name_t * api,
struct dif_config * conf);
-int irm_enroll_ipcp(char * ap_name,
- int api_id,
- char * dif_name);
+int irm_enroll_ipcp(instance_name_t * api,
+ char * dif_name);
-int irm_reg_ipcp(char * ap_name,
- int api_id,
- char ** difs,
- size_t difs_size);
-int irm_unreg_ipcp(char * ap_name,
- int api_id,
- char ** difs,
- size_t difs_size);
-
-#endif
+int irm_reg_ipcp(instance_name_t * api,
+ char ** difs,
+ size_t difs_size);
+int irm_unreg_ipcp(const instance_name_t * api,
+ char ** difs,
+ size_t difs_size);
+#endif /* OUROBOROS_IRM_H */
diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h
index bb8e6d84..4c736de2 100644
--- a/include/ouroboros/sockets.h
+++ b/include/ouroboros/sockets.h
@@ -24,7 +24,6 @@
#define OUROBOROS_SOCKETS_H
#include <ouroboros/common.h>
-#include <ouroboros/rina_name.h>
#include <sys/types.h>