summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-udp/main.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-16 12:04:59 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-16 13:40:12 +0200
commit97ef24340da7d3f55a39ba16b400d13f9bbe9e60 (patch)
treee13656c267343db47a4f79d2098222909222736d /src/ipcpd/shim-udp/main.c
parentc884fb9d6b3d3ea59f5fc7c5d709bfff4fcf1849 (diff)
downloadouroboros-97ef24340da7d3f55a39ba16b400d13f9bbe9e60.tar.gz
ouroboros-97ef24340da7d3f55a39ba16b400d13f9bbe9e60.zip
ipcpd: Allow specifying the hash algorithm to use
Currently CRC32, MD5, and SHA3 (224, 256, 384 and 512 bit) are supported.
Diffstat (limited to 'src/ipcpd/shim-udp/main.c')
-rw-r--r--src/ipcpd/shim-udp/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c
index e1fe5c7c..20e9b272 100644
--- a/src/ipcpd/shim-udp/main.c
+++ b/src/ipcpd/shim-udp/main.c
@@ -206,7 +206,7 @@ static int ipcp_udp_port_alloc(uint32_t dst_ip_addr,
msg.code = SHIM_UDP_MSG_CODE__FLOW_REQ;
msg.src_udp_port = src_udp_port;
msg.has_hash = true;
- msg.hash.len = ipcpi.dir_hash_len;
+ msg.hash.len = ipcp_dir_hash_len();
msg.hash.data = (uint8_t *) dst;
msg.has_qoscube = true;
msg.qoscube = cube;
@@ -286,7 +286,7 @@ static int ipcp_udp_port_req(struct sockaddr_in * c_saddr,
}
/* reply to IRM */
- fd = ipcp_flow_req_arr(getpid(), dst, ipcpi.dir_hash_len, cube);
+ fd = ipcp_flow_req_arr(getpid(), dst, ipcp_dir_hash_len(), cube);
if (fd < 0) {
pthread_mutex_unlock(&ipcpi.alloc_lock);
log_err("Could not get new flow from IRMd.");
@@ -534,7 +534,7 @@ static int ipcp_udp_bootstrap(const struct ipcp_config * conf)
assert(conf);
assert(conf->type == THIS_TYPE);
- ipcpi.dir_hash_len = conf->dir_hash_len;
+ ipcpi.dir_hash_algo = conf->dir_hash_algo;
if (inet_ntop(AF_INET,
&conf->ip_addr,
@@ -749,7 +749,7 @@ static int ipcp_udp_reg(const uint8_t * hash)
uint32_t dns_addr;
uint32_t ip_addr;
#endif
- char hashstr[DIR_HASH_STRLEN + 1];
+ char hashstr[ipcp_dir_hash_strlen() + 1];
uint8_t * hash_dup;
assert(hash);
@@ -809,7 +809,7 @@ static int ipcp_udp_unreg(const uint8_t * hash)
char cmd[100];
uint32_t dns_addr;
#endif
- char hashstr[DIR_HASH_STRLEN + 1];
+ char hashstr[ipcp_dir_hash_strlen() + 1];
assert(hash);
@@ -846,7 +846,7 @@ static int ipcp_udp_query(const uint8_t * hash)
#ifdef CONFIG_OUROBOROS_ENABLE_DNS
uint32_t dns_addr = 0;
#endif
- char hashstr[DIR_HASH_STRLEN + 1];
+ char hashstr[ipcp_dir_hash_strlen() + 1];
assert(hash);