summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2016-03-15 15:48:52 +0100
committerDimitri Staessens <[email protected]>2016-03-15 15:48:52 +0100
commit04bf4380b30b58252d1d2aab75a9dcc5c084c831 (patch)
treea33ce52d5b71f49c75bc7de3f9549d6257b259e1 /include
parentceaea65296a9cb6e2235b0dd429ab3d590b634d3 (diff)
parent7ca8145790db15d7da3c2f1b260ad3421993b67c (diff)
downloadouroboros-04bf4380b30b58252d1d2aab75a9dcc5c084c831.tar.gz
ouroboros-04bf4380b30b58252d1d2aab75a9dcc5c084c831.zip
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into b-du_buff
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/CMakeLists.txt7
-rw-r--r--include/ouroboros/config.h.in31
-rw-r--r--include/ouroboros/ipcp.h16
-rw-r--r--include/ouroboros/utils.h27
4 files changed, 73 insertions, 8 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt
index e862de8c..167cf0e2 100644
--- a/include/ouroboros/CMakeLists.txt
+++ b/include/ouroboros/CMakeLists.txt
@@ -1,3 +1,7 @@
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/config.h")
+
set(HEADER_FILES
bitmap.h
cdap.h
@@ -11,7 +15,8 @@ set(HEADER_FILES
logs.h
rina_name.h
sockets.h
+ utils.h
)
-install(FILES ${HEADER_FILES}
+install(FILES ${HEADER_FILES} "${CMAKE_CURRENT_BINARY_DIR}/config.h"
DESTINATION include/ouroboros)
diff --git a/include/ouroboros/config.h.in b/include/ouroboros/config.h.in
new file mode 100644
index 00000000..0f5c2131
--- /dev/null
+++ b/include/ouroboros/config.h.in
@@ -0,0 +1,31 @@
+/*
+ * Ouroboros - Copyright (C) 2016
+ *
+ * Configuration information
+ *
+ * Sander Vrijders <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef OUROBOROS_CONFIG
+#define OUROBOROS_CONFIG
+
+#define PROJECT_NAME "@CMAKE_PROJECT_NAME@"
+#define PROJECT_VERSION "@PACKAGE_VERSION@"
+#define INSTALL_DIR "@CMAKE_INSTALL_PREFIX@"
+#define BUILD_TYPE "@CMAKE_BUILD_TYPE@"
+
+#endif
diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h
index 39e9c909..5e3e7f8c 100644
--- a/include/ouroboros/ipcp.h
+++ b/include/ouroboros/ipcp.h
@@ -23,26 +23,28 @@
#ifndef OUROBOROS_IPCP_H
#define OUROBOROS_IPCP_H
+#include <sys/types.h>
+
#include "common.h"
#include "rina_name.h"
struct ipcp;
/* Returns the process id */
-int ipcp_create(rina_name_t name,
- char * ipcp_type);
-int ipcp_destroy(int pid);
+pid_t ipcp_create(rina_name_t name,
+ char * ipcp_type);
+int ipcp_destroy(pid_t pid);
-int ipcp_reg(int pid,
+int ipcp_reg(pid_t pid,
char ** difs,
size_t difs_size);
-int ipcp_unreg(int pid,
+int ipcp_unreg(pid_t pid,
char ** difs,
size_t difs_size);
-int ipcp_bootstrap(int pid,
+int ipcp_bootstrap(pid_t pid,
struct dif_config conf);
-int ipcp_enroll(int pid,
+int ipcp_enroll(pid_t pid,
char * dif_name,
rina_name_t member,
char ** n_1_difs,
diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h
new file mode 100644
index 00000000..0e50c039
--- /dev/null
+++ b/include/ouroboros/utils.h
@@ -0,0 +1,27 @@
+/*
+ * Ouroboros - Copyright (C) 2016
+ *
+ * Handy utilities
+ *
+ * Sander Vrijders <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * Returns the number of characters a uint would
+ * need when represented as a string
+ */
+int n_digits(unsigned i);