diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_protocols.h | 7 | ||||
-rw-r--r-- | src/include/gnunet_psyc_slicer.h | 73 | ||||
-rw-r--r-- | src/include/gnunet_social_service.h | 28 |
3 files changed, 92 insertions, 16 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 0251c57fe..7c63f60a3 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2646,8 +2646,11 @@ extern "C" | |||
2646 | /** S->C: notify about an existing place */ | 2646 | /** S->C: notify about an existing place */ |
2647 | #define GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE 854 | 2647 | #define GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE 854 |
2648 | 2648 | ||
2649 | /** S->C: */ | 2649 | /** C->S: set message processing flags */ |
2650 | #define GNUNET_MESSAGE_TYPE_SOCIAL_HOST_RELAY 855 | 2650 | #define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET 860 |
2651 | |||
2652 | /** C->S: clear message processing flags */ | ||
2653 | #define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_CLEAR 860 | ||
2651 | 2654 | ||
2652 | /******************************************************************************* | 2655 | /******************************************************************************* |
2653 | * X-VINE DHT messages | 2656 | * X-VINE DHT messages |
diff --git a/src/include/gnunet_psyc_slicer.h b/src/include/gnunet_psyc_slicer.h index 1851a6002..077c0c5bd 100644 --- a/src/include/gnunet_psyc_slicer.h +++ b/src/include/gnunet_psyc_slicer.h | |||
@@ -250,9 +250,9 @@ GNUNET_PSYC_slicer_method_remove (struct GNUNET_PSYC_Slicer *slicer, | |||
250 | */ | 250 | */ |
251 | void | 251 | void |
252 | GNUNET_PSYC_slicer_modifier_add (struct GNUNET_PSYC_Slicer *slicer, | 252 | GNUNET_PSYC_slicer_modifier_add (struct GNUNET_PSYC_Slicer *slicer, |
253 | const char *object_filter, | 253 | const char *object_filter, |
254 | GNUNET_PSYC_ModifierCallback modifier_cb, | 254 | GNUNET_PSYC_ModifierCallback modifier_cb, |
255 | void *cls); | 255 | void *cls); |
256 | 256 | ||
257 | 257 | ||
258 | /** | 258 | /** |
@@ -270,30 +270,75 @@ GNUNET_PSYC_slicer_modifier_add (struct GNUNET_PSYC_Slicer *slicer, | |||
270 | */ | 270 | */ |
271 | int | 271 | int |
272 | GNUNET_PSYC_slicer_modifier_remove (struct GNUNET_PSYC_Slicer *slicer, | 272 | GNUNET_PSYC_slicer_modifier_remove (struct GNUNET_PSYC_Slicer *slicer, |
273 | const char *object_filter, | 273 | const char *object_filter, |
274 | GNUNET_PSYC_ModifierCallback modifier_cb); | 274 | GNUNET_PSYC_ModifierCallback modifier_cb); |
275 | |||
276 | |||
277 | /** | ||
278 | * Process an incoming message and call matching handlers. | ||
279 | * | ||
280 | * @param slicer | ||
281 | * The slicer to use. | ||
282 | * @param msg | ||
283 | * The message as it arrived from the network. | ||
284 | */ | ||
285 | void | ||
286 | GNUNET_PSYC_slicer_message (struct GNUNET_PSYC_Slicer *slicer, | ||
287 | const struct GNUNET_PSYC_MessageHeader *msg); | ||
275 | 288 | ||
276 | 289 | ||
277 | /** | 290 | /** |
278 | * Process an incoming message part and call matching handlers. | 291 | * Process an incoming message part and call matching handlers. |
279 | * | 292 | * |
280 | * @param cls | 293 | * @param slicer |
281 | * Closure. | 294 | * The slicer to use. |
282 | * @param message_id | 295 | * @param message_id |
283 | * ID of the message. | 296 | * ID of the message. |
284 | * @param flags | 297 | * @param flags |
285 | * Flags for the message. | 298 | * Flags for the message. |
286 | * @see enum GNUNET_PSYC_MessageFlags | 299 | * @see enum GNUNET_PSYC_MessageFlags |
300 | * @param fragment offset | ||
301 | * Fragment offset of the message. | ||
287 | * @param msg | 302 | * @param msg |
288 | * The message part. as it arrived from the network. | 303 | * The message part as it arrived from the network. |
304 | */ | ||
305 | void | ||
306 | GNUNET_PSYC_slicer_message_part (struct GNUNET_PSYC_Slicer *slicer, | ||
307 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, | ||
308 | uint64_t message_id, | ||
309 | uint32_t flags, | ||
310 | uint64_t fragment_offset, | ||
311 | const struct GNUNET_MessageHeader *msg); | ||
312 | |||
313 | |||
314 | /** | ||
315 | * Remove all registered method handlers. | ||
316 | * | ||
317 | * @param slicer | ||
318 | * Slicer to clear. | ||
319 | */ | ||
320 | void | ||
321 | GNUNET_PSYC_slicer_method_clear (struct GNUNET_PSYC_Slicer *slicer); | ||
322 | |||
323 | |||
324 | /** | ||
325 | * Remove all registered modifier handlers. | ||
326 | * | ||
327 | * @param slicer | ||
328 | * Slicer to clear. | ||
329 | */ | ||
330 | void | ||
331 | GNUNET_PSYC_slicer_modifier_clear (struct GNUNET_PSYC_Slicer *slicer); | ||
332 | |||
333 | |||
334 | /** | ||
335 | * Remove all registered method & modifier handlers. | ||
336 | * | ||
337 | * @param slicer | ||
338 | * Slicer to clear. | ||
289 | */ | 339 | */ |
290 | void | 340 | void |
291 | GNUNET_PSYC_slicer_message (void *cls, | 341 | GNUNET_PSYC_slicer_clear (struct GNUNET_PSYC_Slicer *slicer); |
292 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, | ||
293 | uint64_t message_id, | ||
294 | uint32_t flags, | ||
295 | uint64_t fragment_offset, | ||
296 | const struct GNUNET_MessageHeader *msg); | ||
297 | 342 | ||
298 | 343 | ||
299 | /** | 344 | /** |
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h index 4ad6036a9..75038407b 100644 --- a/src/include/gnunet_social_service.h +++ b/src/include/gnunet_social_service.h | |||
@@ -232,6 +232,12 @@ extern "C" | |||
232 | */ | 232 | */ |
233 | #define GNUNET_SOCIAL_APP_MAX_ID_SIZE 256 | 233 | #define GNUNET_SOCIAL_APP_MAX_ID_SIZE 256 |
234 | 234 | ||
235 | enum GNUNET_SOCIAL_MsgProcFlags { | ||
236 | GNUNET_SOCIAL_MSG_PROC_NONE = 0, | ||
237 | GNUNET_SOCIAL_MSG_PROC_RELAY = 1, | ||
238 | GNUNET_SOCIAL_MSG_PROC_SAVE= 2, | ||
239 | }; | ||
240 | |||
235 | /** | 241 | /** |
236 | * Handle for an application. | 242 | * Handle for an application. |
237 | */ | 243 | */ |
@@ -1063,6 +1069,28 @@ struct GNUNET_SOCIAL_HistoryRequest; | |||
1063 | 1069 | ||
1064 | 1070 | ||
1065 | /** | 1071 | /** |
1072 | * Set message processing @a flags for a @a method_prefix. | ||
1073 | * | ||
1074 | * @param plc | ||
1075 | * Place. | ||
1076 | * @param method_prefix | ||
1077 | * Method prefix @a flags apply to. | ||
1078 | * @param flags | ||
1079 | * The flags that apply to a matching @a method_prefix. | ||
1080 | */ | ||
1081 | void | ||
1082 | GNUNET_SOCIAL_place_msg_proc_set (struct GNUNET_SOCIAL_Place *plc, | ||
1083 | const char *method_prefix, | ||
1084 | enum GNUNET_SOCIAL_MsgProcFlags flags); | ||
1085 | |||
1086 | /** | ||
1087 | * Clear all message processing flags previously set for this place. | ||
1088 | */ | ||
1089 | void | ||
1090 | GNUNET_SOCIAL_place_msg_proc_clear (struct GNUNET_SOCIAL_Place *plc); | ||
1091 | |||
1092 | |||
1093 | /** | ||
1066 | * Learn about the history of a place. | 1094 | * Learn about the history of a place. |
1067 | * | 1095 | * |
1068 | * Messages are returned through the @a slicer function | 1096 | * Messages are returned through the @a slicer function |