From a688b8a38d7eb9f42406eeb611717db737b0d257 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Fri, 3 Mar 2017 15:41:11 +0100 Subject: lib: Manage multiple flows with a single CDAP instance You can now add multiple flows to a CDAP instance. This will simplify sending messages to different peers (e.g. for syncing the RIB). A request will now return an array of keys terminated by CDAP_KEY_INVALID. Removes the enum from the CDAP proto file to just take the opcode as an integer. --- include/ouroboros/cdap.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/ouroboros/cdap.h b/include/ouroboros/cdap.h index 19ab39a8..32edb51c 100644 --- a/include/ouroboros/cdap.h +++ b/include/ouroboros/cdap.h @@ -46,12 +46,17 @@ struct cdap; typedef int32_t cdap_key_t; -/* Assumes flow is blocking */ -struct cdap * cdap_create(int fd); +struct cdap * cdap_create(void); int cdap_destroy(struct cdap * instance); -cdap_key_t cdap_request_send(struct cdap * instance, +int cdap_add_flow(struct cdap * instance, + int fd); + +int cdap_del_flow(struct cdap * instance, + int fd); + +cdap_key_t * cdap_request_send(struct cdap * instance, enum cdap_opcode code, const char * name, const void * data, -- cgit v1.2.3