diff options
author | Gabor X Toth <*@tg-x.net> | 2014-07-10 17:49:53 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2014-07-10 17:49:53 +0000 |
commit | a8133f3ff80aaaccc904e4bbaf69bc53dee499cb (patch) | |
tree | c10edd7a8156280c61357ccf9e0f1f27c7a0d6db /src/include/gnunet_psyc_service.h | |
parent | 6c75526e936fcc74ee79b13831b2b6dda57f293d (diff) | |
download | gnunet-a8133f3ff80aaaccc904e4bbaf69bc53dee499cb.tar.gz gnunet-a8133f3ff80aaaccc904e4bbaf69bc53dee499cb.zip |
PSYC(store), Multicast: use ECDSA slave/member keys; PSYC: add GNUNET_PSYC_message_create()
Diffstat (limited to 'src/include/gnunet_psyc_service.h')
-rw-r--r-- | src/include/gnunet_psyc_service.h | 96 |
1 files changed, 84 insertions, 12 deletions
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 4806767fb..2ea282fa3 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h | |||
@@ -218,7 +218,7 @@ struct GNUNET_PSYC_MessageHeader | |||
218 | * Sending slave's public key. | 218 | * Sending slave's public key. |
219 | * Not set if the message is from the master. | 219 | * Not set if the message is from the master. |
220 | */ | 220 | */ |
221 | struct GNUNET_CRYPTO_EddsaPublicKey slave_key; | 221 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; |
222 | 222 | ||
223 | /* Followed by concatenated PSYC message parts: | 223 | /* Followed by concatenated PSYC message parts: |
224 | * messages with GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_* types | 224 | * messages with GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_* types |
@@ -279,6 +279,63 @@ struct GNUNET_PSYC_MessageModifier | |||
279 | /* Followed by NUL-terminated name, then the value. */ | 279 | /* Followed by NUL-terminated name, then the value. */ |
280 | }; | 280 | }; |
281 | 281 | ||
282 | |||
283 | struct GNUNET_PSYC_CountersResultMessage | ||
284 | { | ||
285 | /** | ||
286 | * Type: GNUNET_MESSAGE_TYPE_PSYC_RESULT_COUNTERS | ||
287 | */ | ||
288 | struct GNUNET_MessageHeader header; | ||
289 | |||
290 | /** | ||
291 | * Status code for the operation. | ||
292 | */ | ||
293 | int32_t result_code GNUNET_PACKED; | ||
294 | |||
295 | /** | ||
296 | * Last message ID sent to the channel. | ||
297 | */ | ||
298 | uint64_t max_message_id; | ||
299 | }; | ||
300 | |||
301 | |||
302 | struct GNUNET_PSYC_JoinRequestMessage | ||
303 | { | ||
304 | /** | ||
305 | * Type: GNUNET_MESSAGE_TYPE_PSYC_MASTER_JOIN_REQUEST | ||
306 | */ | ||
307 | struct GNUNET_MessageHeader header; | ||
308 | /** | ||
309 | * Public key of the joining slave. | ||
310 | */ | ||
311 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; | ||
312 | |||
313 | /* Followed by struct GNUNET_MessageHeader join_request */ | ||
314 | }; | ||
315 | |||
316 | |||
317 | struct GNUNET_PSYC_JoinDecisionMessage | ||
318 | { | ||
319 | /** | ||
320 | * Type: GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION | ||
321 | */ | ||
322 | struct GNUNET_MessageHeader header; | ||
323 | |||
324 | /** | ||
325 | * #GNUNET_YES if the slave was admitted. | ||
326 | */ | ||
327 | int32_t is_admitted; | ||
328 | |||
329 | /** | ||
330 | * Public key of the joining slave. | ||
331 | * Only set when the master is sending the decision, | ||
332 | * not set when a slave is receiving it. | ||
333 | */ | ||
334 | struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; | ||
335 | |||
336 | /* Followed by struct GNUNET_MessageHeader join_response */ | ||
337 | }; | ||
338 | |||
282 | GNUNET_NETWORK_STRUCT_END | 339 | GNUNET_NETWORK_STRUCT_END |
283 | 340 | ||
284 | 341 | ||
@@ -296,6 +353,23 @@ GNUNET_NETWORK_STRUCT_END | |||
296 | 353 | ||
297 | 354 | ||
298 | /** | 355 | /** |
356 | * PSYC message part processing states. | ||
357 | */ | ||
358 | enum GNUNET_PSYC_MessageState | ||
359 | { | ||
360 | GNUNET_PSYC_MESSAGE_STATE_START = 0, | ||
361 | GNUNET_PSYC_MESSAGE_STATE_HEADER = 1, | ||
362 | GNUNET_PSYC_MESSAGE_STATE_METHOD = 2, | ||
363 | GNUNET_PSYC_MESSAGE_STATE_MODIFIER = 3, | ||
364 | GNUNET_PSYC_MESSAGE_STATE_MOD_CONT = 4, | ||
365 | GNUNET_PSYC_MESSAGE_STATE_DATA = 5, | ||
366 | GNUNET_PSYC_MESSAGE_STATE_END = 6, | ||
367 | GNUNET_PSYC_MESSAGE_STATE_CANCEL = 7, | ||
368 | GNUNET_PSYC_MESSAGE_STATE_ERROR = 8, | ||
369 | }; | ||
370 | |||
371 | |||
372 | /** | ||
299 | * Handle that identifies a join request. | 373 | * Handle that identifies a join request. |
300 | * | 374 | * |
301 | * Used to match calls to #GNUNET_PSYC_JoinCallback to the | 375 | * Used to match calls to #GNUNET_PSYC_JoinCallback to the |
@@ -335,7 +409,7 @@ typedef void | |||
335 | typedef void | 409 | typedef void |
336 | (*GNUNET_PSYC_JoinRequestCallback) (void *cls, | 410 | (*GNUNET_PSYC_JoinRequestCallback) (void *cls, |
337 | const struct | 411 | const struct |
338 | GNUNET_CRYPTO_EddsaPublicKey *slave_key, | 412 | GNUNET_CRYPTO_EcdsaPublicKey *slave_key, |
339 | const struct | 413 | const struct |
340 | GNUNET_PSYC_MessageHeader *join_msg, | 414 | GNUNET_PSYC_MessageHeader *join_msg, |
341 | struct GNUNET_PSYC_JoinHandle *jh); | 415 | struct GNUNET_PSYC_JoinHandle *jh); |
@@ -348,9 +422,10 @@ typedef void | |||
348 | * #GNUNET_PSYC_JoinCallback. | 422 | * #GNUNET_PSYC_JoinCallback. |
349 | * | 423 | * |
350 | * @param jh Join request handle. | 424 | * @param jh Join request handle. |
351 | * @param is_admitted #GNUNET_YES if the join is approved, | 425 | * @param is_admitted |
352 | * #GNUNET_NO if it is disapproved, | 426 | * #GNUNET_YES if the join is approved, |
353 | * #GNUNET_SYSERR if we cannot answer the request. | 427 | * #GNUNET_NO if it is disapproved, |
428 | * #GNUNET_SYSERR if we cannot answer the request. | ||
354 | * @param relay_count Number of relays given. | 429 | * @param relay_count Number of relays given. |
355 | * @param relays Array of suggested peers that might be useful relays to use | 430 | * @param relays Array of suggested peers that might be useful relays to use |
356 | * when joining the multicast group (essentially a list of peers that | 431 | * when joining the multicast group (essentially a list of peers that |
@@ -646,7 +721,7 @@ typedef void | |||
646 | struct GNUNET_PSYC_Slave * | 721 | struct GNUNET_PSYC_Slave * |
647 | GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 722 | GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
648 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, | 723 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, |
649 | const struct GNUNET_CRYPTO_EddsaPrivateKey *slave_key, | 724 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key, |
650 | const struct GNUNET_PeerIdentity *origin, | 725 | const struct GNUNET_PeerIdentity *origin, |
651 | uint32_t relay_count, | 726 | uint32_t relay_count, |
652 | const struct GNUNET_PeerIdentity *relays, | 727 | const struct GNUNET_PeerIdentity *relays, |
@@ -654,10 +729,7 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
654 | GNUNET_PSYC_SlaveConnectCallback slave_connect_cb, | 729 | GNUNET_PSYC_SlaveConnectCallback slave_connect_cb, |
655 | GNUNET_PSYC_JoinDecisionCallback join_decision_cb, | 730 | GNUNET_PSYC_JoinDecisionCallback join_decision_cb, |
656 | void *cls, | 731 | void *cls, |
657 | const char *method_name, | 732 | const struct GNUNET_MessageHeader *join_msg); |
658 | const struct GNUNET_ENV_Environment *env, | ||
659 | const void *data, | ||
660 | uint16_t data_size); | ||
661 | 733 | ||
662 | 734 | ||
663 | /** | 735 | /** |
@@ -775,7 +847,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave); | |||
775 | */ | 847 | */ |
776 | void | 848 | void |
777 | GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, | 849 | GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, |
778 | const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key, | 850 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, |
779 | uint64_t announced_at, | 851 | uint64_t announced_at, |
780 | uint64_t effective_since); | 852 | uint64_t effective_since); |
781 | 853 | ||
@@ -803,7 +875,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, | |||
803 | */ | 875 | */ |
804 | void | 876 | void |
805 | GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, | 877 | GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, |
806 | const struct GNUNET_CRYPTO_EddsaPublicKey | 878 | const struct GNUNET_CRYPTO_EcdsaPublicKey |
807 | *slave_key, | 879 | *slave_key, |
808 | uint64_t announced_at); | 880 | uint64_t announced_at); |
809 | 881 | ||