summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-data.h
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-13 09:55:31 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-04-13 09:55:31 +0000
commit72c28d6173ade511e9dc6969e0fc66db2dbba38a (patch)
tree12756b89d8f4ce421c70d5cf05850b4968e76412 /src/ipcpd/shim-data.h
parent2cc9c8d742e037c8a6ddc3eea4c05f4a905183d3 (diff)
parentfc10a7587b1a642748ae0fd69f08d92b4a902248 (diff)
downloadouroboros-72c28d6173ade511e9dc6969e0fc66db2dbba38a.tar.gz
ouroboros-72c28d6173ade511e9dc6969e0fc66db2dbba38a.zip
Merged in dstaesse/ouroboros/be-hashes (pull request #479)
lib, ipcpd, irmd: Register hash instead of name
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);