summaryrefslogtreecommitdiff
path: root/src/lib/cacep.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2017-02-28 13:56:57 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2017-02-28 13:56:57 +0000
commita5796c7f02570a2878f9c6a5d28dca80beabed12 (patch)
treec69603a29712665f3c7e8ee4e90d7209d61d3d85 /src/lib/cacep.c
parent6450c9d385ff9ec5234a489130a45378cafb8a6e (diff)
parente6f5d45855b4a8091b52b3fc91451d2d132a5a6d (diff)
downloadouroboros-a5796c7f02570a2878f9c6a5d28dca80beabed12.tar.gz
ouroboros-a5796c7f02570a2878f9c6a5d28dca80beabed12.zip
Merged in dstaesse/ouroboros/be-cacep (pull request #394)
lib: Split CACEP into request/response protocol
Diffstat (limited to 'src/lib/cacep.c')
-rw-r--r--src/lib/cacep.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/lib/cacep.c b/src/lib/cacep.c
index badeccc0..abff0aaa 100644
--- a/src/lib/cacep.c
+++ b/src/lib/cacep.c
@@ -93,46 +93,26 @@ static int send_msg(int fd,
return 0;
}
-int cacep_connect(int fd,
- const struct conn_info * in,
- struct conn_info * out)
+int cacep_snd(int fd,
+ const struct conn_info * in)
{
- if (in == NULL || out == NULL)
+ if (in == NULL)
return -EINVAL;
if (send_msg(fd, in))
return -1;
- if (read_msg(fd, out))
- return -1;
-
- if (strcmp(in->ae_name, out->ae_name) ||
- strcmp(in->protocol, out->protocol) ||
- in->pref_version != out->pref_version ||
- in->pref_syntax != out->pref_syntax)
- return -EPROTO;
-
return 0;
}
-int cacep_listen(int fd,
- const struct conn_info * in,
- struct conn_info * out)
+int cacep_rcv(int fd,
+ struct conn_info * out)
{
- if (in == NULL || out == NULL)
+ if (out == NULL)
return -EINVAL;
- if (send_msg(fd, in))
- return -1;
-
if (read_msg(fd, out))
return -1;
- if (strcmp(in->ae_name, out->ae_name) ||
- strcmp(in->protocol, out->protocol) ||
- in->pref_version != out->pref_version ||
- in->pref_syntax != out->pref_syntax)
- return -EPROTO;
-
return 0;
}