summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-02-27 22:59:52 +0100
committerdimitri staessens <[email protected]>2017-02-28 14:48:16 +0100
commite6f5d45855b4a8091b52b3fc91451d2d132a5a6d (patch)
treec69603a29712665f3c7e8ee4e90d7209d61d3d85 /src/lib
parentd06cb62e111be1ac3f09398ae559f99e4833b4bf (diff)
downloadouroboros-e6f5d45855b4a8091b52b3fc91451d2d132a5a6d.tar.gz
ouroboros-e6f5d45855b4a8091b52b3fc91451d2d132a5a6d.zip
lib: Split CACEP into request/response protocol
Diffstat (limited to 'src/lib')
-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;
}