summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-10-24 10:06:23 +0200
committerSander Vrijders <[email protected]>2018-10-24 11:58:49 +0200
commitda60c56365ac13a262ffa6adaba7540c4d914843 (patch)
tree8b2f3ccd5f90f217de53f6b7c905adc11e75a261 /src/ipcpd/ipcp.c
parente161da9a580152e52a84c5ca31422355307bab42 (diff)
downloadouroboros-da60c56365ac13a262ffa6adaba7540c4d914843.tar.gz
ouroboros-da60c56365ac13a262ffa6adaba7540c4d914843.zip
ipcpd: Add broadcast IPCP
This adds a broadcast IPCP that allows us to easily create multicast applications. The broadcast IPCP accepts flows for "<layer_name>.mc". A tool, obc (Ouroboros broadcast), is added that sends and reads a message to a broadcast layer. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r--src/ipcpd/ipcp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 862b3463..6376bedb 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -256,8 +256,14 @@ static void * mainloop(void * o)
layer_info.dir_hash_algo = HASH_MD5;
}
- /* Only udp needs a fixed hash algorithm */
- if (conf_msg->ipcp_type != IPCP_UDP) {
+ if (conf_msg->ipcp_type == IPCP_BROADCAST) {
+ conf.layer_info.dir_hash_algo = HASH_SHA3_256;
+ layer_info.dir_hash_algo = HASH_SHA3_256;
+ }
+
+ /* UDP and broadcast have a fixed hash algorithm. */
+ if (conf_msg->ipcp_type != IPCP_UDP &&
+ conf_msg->ipcp_type != IPCP_BROADCAST) {
switch(conf_msg->layer_info->dir_hash_algo) {
case DIR_HASH_SHA3_224:
conf.layer_info.dir_hash_algo =