summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/ro.h
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-11-29 14:59:42 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-11-29 14:59:42 +0100
commit959882e45f430e59d089bf34ed455afafa08cf29 (patch)
treeadc5383864952de115bf84cf993ffef5e71d9fdf /src/ipcpd/normal/ro.h
parent60a6970f4d004a3bdaedc5af4e1581890ab9b462 (diff)
downloadouroboros-959882e45f430e59d089bf34ed455afafa08cf29.tar.gz
ouroboros-959882e45f430e59d089bf34ed455afafa08cf29.zip
ipcpd: normal: Change ro_attr initialization
This changes the way RIB object attributes are set. Previously the struct was called ro_props and it had to be allocated on the heap. Now it follows the model of pthreads closely. This commit also changes the callbacks of the RO subscribers to return void instead of int.
Diffstat (limited to 'src/ipcpd/normal/ro.h')
-rw-r--r--src/ipcpd/normal/ro.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/ipcpd/normal/ro.h b/src/ipcpd/normal/ro.h
index 6fa1db2a..278c9213 100644
--- a/src/ipcpd/normal/ro.h
+++ b/src/ipcpd/normal/ro.h
@@ -29,18 +29,20 @@ enum ro_recv_set {
ALL_MEMBERS
};
-struct ro_props {
+struct ro_attr {
bool enrol_sync;
enum ro_recv_set recv_set;
struct timespec expiry;
};
/* All RIB-objects have a pathname, separated by a slash. */
-/* Takes ownership of the data and props */
-int ro_create(const char * name,
- struct ro_props * props,
- uint8_t * data,
- size_t len);
+/* Takes ownership of the data */
+int ro_create(const char * name,
+ struct ro_attr * attr,
+ uint8_t * data,
+ size_t len);
+
+int ro_attr_init(struct ro_attr * attr);
int ro_delete(const char * name);
@@ -54,13 +56,13 @@ ssize_t ro_read(const char * name,
/* Callback passes ownership of the data */
struct ro_sub_ops {
- int (* ro_created)(const char * name,
- uint8_t * data,
- size_t len);
- int (* ro_updated)(const char * name,
- uint8_t * data,
- size_t len);
- int (* ro_deleted)(const char * name);
+ void (* ro_created)(const char * name,
+ uint8_t * data,
+ size_t len);
+ void (* ro_updated)(const char * name,
+ uint8_t * data,
+ size_t len);
+ void (* ro_deleted)(const char * name);
};
/* Returns subscriber-id */