aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_peerstore_service.h29
-rw-r--r--src/include/gnunet_protocols.h17
2 files changed, 43 insertions, 3 deletions
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h
index 4ede69d93..acb7e0492 100644
--- a/src/include/gnunet_peerstore_service.h
+++ b/src/include/gnunet_peerstore_service.h
@@ -166,7 +166,7 @@ GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc);
166 */ 166 */
167struct GNUNET_PEERSTORE_IterateContext * 167struct GNUNET_PEERSTORE_IterateContext *
168GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h, 168GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
169 char *sub_system, 169 const char *sub_system,
170 const struct GNUNET_PeerIdentity *peer, 170 const struct GNUNET_PeerIdentity *peer,
171 const char *key, 171 const char *key,
172 struct GNUNET_TIME_Relative timeout, 172 struct GNUNET_TIME_Relative timeout,
@@ -181,6 +181,33 @@ GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
181void 181void
182GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic); 182GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic);
183 183
184/**
185 * Request watching a given key
186 * User will be notified with any new values added to key
187 *
188 * @param h handle to the PEERSTORE service
189 * @param sub_system name of sub system
190 * @param peer Peer identity
191 * @param key entry key string
192 * @param callback function called with each new value
193 * @param callback_cls closure for @a callback
194 * @return Handle to watch request
195 */
196struct GNUNET_PEERSTORE_WatchContext *
197GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
198 const char *sub_system,
199 const struct GNUNET_PeerIdentity *peer,
200 const char *key,
201 GNUNET_PEERSTORE_Processor callback, void *callback_cls);
202
203/**
204 * Cancel a watch request
205 *
206 * @wc handle to the watch request
207 */
208void
209GNUNET_PEERSTORE_watch_cancel(struct GNUNET_PEERSTORE_WatchContext *wc);
210
184#if 0 /* keep Emacsens' auto-indent happy */ 211#if 0 /* keep Emacsens' auto-indent happy */
185{ 212{
186#endif 213#endif
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index b03efe3f4..5b64dfeaa 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2477,10 +2477,9 @@ extern "C"
2477#define GNUNET_MESSAGE_TYPE_PEERSTORE_STORE 820 2477#define GNUNET_MESSAGE_TYPE_PEERSTORE_STORE 820
2478 2478
2479/** 2479/**
2480 * Store result messages 2480 * Store result message
2481 */ 2481 */
2482#define GNUNET_MESSAGE_TYPE_PEERSTORE_STORE_RESULT_OK 821 2482#define GNUNET_MESSAGE_TYPE_PEERSTORE_STORE_RESULT_OK 821
2483#define GNUNET_MESSAGE_TYPE_PEERSTORE_STORE_RESULT_FAIL 822
2484 2483
2485/** 2484/**
2486 * Iteration request 2485 * Iteration request
@@ -2493,6 +2492,20 @@ extern "C"
2493#define GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD 824 2492#define GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD 824
2494#define GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END 825 2493#define GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END 825
2495 2494
2495/**
2496 * Watch request
2497 */
2498#define GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH 826
2499
2500/**
2501 * Watch response
2502 */
2503#define GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH_RECORD 827
2504
2505/**
2506 * Watch cancel request
2507 */
2508#define GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH_CANCEL 828
2496 2509
2497/******************************************************************************* 2510/*******************************************************************************
2498 * SOCIAL message types 2511 * SOCIAL message types