summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-data.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/shim-data.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/shim-data.h')
-rw-r--r--src/ipcpd/shim-data.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/ipcpd/shim-data.h b/src/ipcpd/shim-data.h
index ac670b43..d53373df 100644
--- a/src/ipcpd/shim-data.h
+++ b/src/ipcpd/shim-data.h
@@ -30,7 +30,6 @@
#include <pthread.h>
#include <stdint.h>
-
enum dir_query_state {
QUERY_INIT = 0,
QUERY_PENDING,
@@ -41,7 +40,7 @@ enum dir_query_state {
struct dir_query {
struct list_head next;
- char * name;
+ uint8_t * hash;
enum dir_query_state state;
pthread_mutex_t lock;
@@ -49,14 +48,14 @@ struct dir_query {
};
struct shim_data {
- struct list_head registry;
- pthread_rwlock_t reg_lock;
+ struct list_head registry;
+ pthread_rwlock_t reg_lock;
- struct list_head directory;
- pthread_rwlock_t dir_lock;
+ struct list_head directory;
+ pthread_rwlock_t dir_lock;
- struct list_head dir_queries;
- pthread_mutex_t dir_queries_lock;
+ struct list_head dir_queries;
+ pthread_mutex_t dir_queries_lock;
};
struct shim_data * shim_data_create(void);
@@ -64,29 +63,29 @@ struct shim_data * shim_data_create(void);
void shim_data_destroy(struct shim_data * data);
int shim_data_reg_add_entry(struct shim_data * data,
- char * name);
+ uint8_t * hash);
int shim_data_reg_del_entry(struct shim_data * data,
- const char * name);
+ const uint8_t * hash);
bool shim_data_reg_has(struct shim_data * data,
- const char * name);
+ const uint8_t * hash);
int shim_data_dir_add_entry(struct shim_data * data,
- char * name,
+ const uint8_t * hash,
uint64_t addr);
int shim_data_dir_del_entry(struct shim_data * data,
- const char * name,
+ const uint8_t * hash,
uint64_t addr);
bool shim_data_dir_has(struct shim_data * data,
- const char * name);
+ const uint8_t * hash);
uint64_t shim_data_dir_get_addr(struct shim_data * data,
- const char * name);
+ const uint8_t * hash);
-struct dir_query * shim_data_dir_query_create(char * name);
+struct dir_query * shim_data_dir_query_create(const uint8_t * hash);
void shim_data_dir_query_respond(struct dir_query * query);