summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.h
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-12 16:57:48 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-13 11:30:20 +0200
commitfc10a7587b1a642748ae0fd69f08d92b4a902248 (patch)
treee0b570cf30753a564855242c94d242f597b5c499 /src/ipcpd/ipcp.h
parenta3d550ff972121641562d375f75bcf188fc7fe59 (diff)
downloadouroboros-fc10a7587b1a642748ae0fd69f08d92b4a902248.tar.gz
ouroboros-fc10a7587b1a642748ae0fd69f08d92b4a902248.zip
lib, ipcpd, irmd: Register hash instead of name
All information passed over the IRMd/IPCP boundary for using IPC services (flow allocation, registration) is now hashed. This effectively fixes the shared namespace between DIFs and the IRMDs. This PR also fixes some API issues (adding const identifiers), shuffles the include headers a bit and some small bugs.
Diffstat (limited to 'src/ipcpd/ipcp.h')
-rw-r--r--src/ipcpd/ipcp.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h
index e5c4b9af..d6e2aa7c 100644
--- a/src/ipcpd/ipcp.h
+++ b/src/ipcpd/ipcp.h
@@ -24,12 +24,13 @@
#define IPCPD_IPCP_H
#include <ouroboros/config.h>
-#include <ouroboros/irm_config.h>
+#include <ouroboros/ipcp.h>
#include "shim-data.h"
#include <pthread.h>
#include <time.h>
+#include <signal.h>
enum ipcp_state {
IPCP_NULL = 0,
@@ -39,19 +40,19 @@ enum ipcp_state {
};
struct ipcp_ops {
- int (* ipcp_bootstrap)(struct dif_config * conf);
+ int (* ipcp_bootstrap)(const struct ipcp_config * conf);
- int (* ipcp_enroll)(char * dif_name);
+ int (* ipcp_enroll)(const char * dst);
- int (* ipcp_name_reg)(char * name);
+ int (* ipcp_reg)(const uint8_t * hash);
- int (* ipcp_name_unreg)(char * name);
+ int (* ipcp_unreg)(const uint8_t * hash);
- int (* ipcp_name_query)(char * name);
+ int (* ipcp_query)(const uint8_t * hash);
- int (* ipcp_flow_alloc)(int fd,
- char * dst_ap_name,
- qoscube_t qos);
+ int (* ipcp_flow_alloc)(int fd,
+ const uint8_t * dst,
+ qoscube_t qos);
int (* ipcp_flow_alloc_resp)(int fd,
int response);
@@ -59,6 +60,8 @@ struct ipcp_ops {
int (* ipcp_flow_dealloc)(int fd);
};
+#define DIR_HASH_STRLEN (ipcpi.dir_hash_len * 2)
+
struct ipcp {
int irmd_api;
char * name;
@@ -67,6 +70,7 @@ struct ipcp {
char * dif_name;
uint64_t dt_addr;
+ uint16_t dir_hash_len;
struct ipcp_ops * ops;
int irmd_fd;
@@ -117,4 +121,15 @@ int ipcp_wait_state(enum ipcp_state state,
int ipcp_parse_arg(int argc,
char * argv[]);
+/* Handle shutdown of IPCP */
+void ipcp_sig_handler(int sig,
+ siginfo_t * info,
+ void * c);
+
+/* Helper functions for directory entries, could be moved */
+uint8_t * ipcp_hash_dup(const uint8_t * hash);
+
+void ipcp_hash_str(char buf[],
+ const uint8_t * hash);
+
#endif