summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-03-03 15:41:11 +0100
committerdimitri staessens <[email protected]>2017-03-03 15:54:44 +0100
commita688b8a38d7eb9f42406eeb611717db737b0d257 (patch)
tree68a2bf098171299d2c30f9537c89b862edb0f996 /include
parentd753cab1897e323b59923e2b0b11f550b087351c (diff)
downloadouroboros-a688b8a38d7eb9f42406eeb611717db737b0d257.tar.gz
ouroboros-a688b8a38d7eb9f42406eeb611717db737b0d257.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/cdap.h11
1 files changed, 8 insertions, 3 deletions
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,