summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorOmar Tarabai <tarabai@devegypt.com>2014-06-04 16:03:17 +0000
committerOmar Tarabai <tarabai@devegypt.com>2014-06-04 16:03:17 +0000
commitf286cd0b87731774b9448a0cdc82f7c8682c4efe (patch)
treed84ace0bf67dd4f8a99888548f6ab635206eab4f /src/include
parent7d18e9d89d2c920f9139bec7f55f01b00b5fd81a (diff)
downloadgnunet-f286cd0b87731774b9448a0cdc82f7c8682c4efe.tar.gz
gnunet-f286cd0b87731774b9448a0cdc82f7c8682c4efe.zip
peerstore: added 'replace' option and other fixes
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_peerstore_plugin.h3
-rw-r--r--src/include/gnunet_peerstore_service.h23
2 files changed, 24 insertions, 2 deletions
diff --git a/src/include/gnunet_peerstore_plugin.h b/src/include/gnunet_peerstore_plugin.h
index 18b3f690d..8eea796bb 100644
--- a/src/include/gnunet_peerstore_plugin.h
+++ b/src/include/gnunet_peerstore_plugin.h
@@ -68,7 +68,8 @@ struct GNUNET_PEERSTORE_PluginFunctions
68 const char *key, 68 const char *key,
69 const void *value, 69 const void *value,
70 size_t size, 70 size_t size,
71 struct GNUNET_TIME_Absolute expiry); 71 struct GNUNET_TIME_Absolute expiry,
72 enum GNUNET_PEERSTORE_StoreOption options);
72 73
73 /** 74 /**
74 * Iterate over the records given an optional peer id 75 * Iterate over the records given an optional peer id
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h
index acb7e0492..7a79a8b56 100644
--- a/src/include/gnunet_peerstore_service.h
+++ b/src/include/gnunet_peerstore_service.h
@@ -38,6 +38,25 @@ extern "C"
38#endif 38#endif
39 39
40/** 40/**
41 * Options for storing values in PEERSTORE
42 */
43enum GNUNET_PEERSTORE_StoreOption
44{
45
46 /**
47 * Possibly store multiple values under given key.
48 */
49 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE,
50
51 /**
52 * Delete any previous values for the given key before
53 * storing the given value.
54 */
55 GNUNET_PEERSTORE_STOREOPTION_REPLACE,
56
57};
58
59/**
41 * Handle to the peerstore service. 60 * Handle to the peerstore service.
42 */ 61 */
43struct GNUNET_PEERSTORE_Handle; 62struct GNUNET_PEERSTORE_Handle;
@@ -130,7 +149,8 @@ GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h);
130 * @param key entry key 149 * @param key entry key
131 * @param value entry value BLOB 150 * @param value entry value BLOB
132 * @param size size of 'value' 151 * @param size size of 'value'
133 * @param lifetime relative time after which the entry is (possibly) deleted 152 * @param expiry absolute time after which the entry is (possibly) deleted
153 * @param options store operation option
134 * @param cont Continuation function after the store request is processed 154 * @param cont Continuation function after the store request is processed
135 * @param cont_cls Closure for 'cont' 155 * @param cont_cls Closure for 'cont'
136 */ 156 */
@@ -142,6 +162,7 @@ GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
142 const void *value, 162 const void *value,
143 size_t size, 163 size_t size,
144 struct GNUNET_TIME_Absolute expiry, 164 struct GNUNET_TIME_Absolute expiry,
165 enum GNUNET_PEERSTORE_StoreOption options,
145 GNUNET_PEERSTORE_Continuation cont, 166 GNUNET_PEERSTORE_Continuation cont,
146 void *cont_cls); 167 void *cont_cls);
147 168