aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_reclaim_service.h
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-29 18:06:26 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-29 18:06:26 +0900
commit0f2da4636e108c70697c589d9e38781f2bafefba (patch)
tree0e831befd71d4323596cdae55e8431df7720c531 /src/include/gnunet_reclaim_service.h
parent4e2259f14be320c8e2fe2a672a473e09677269c4 (diff)
downloadgnunet-0f2da4636e108c70697c589d9e38781f2bafefba.tar.gz
gnunet-0f2da4636e108c70697c589d9e38781f2bafefba.zip
IDENTITY
This commit is a major rework of the unclean GNUNET_IDENTITY_*Key structures and its use in serialized objects (e.g. RPC messages). The structures are now no longer to be used directly but instead through their serialization helper functions whenever needed.
Diffstat (limited to 'src/include/gnunet_reclaim_service.h')
-rw-r--r--src/include/gnunet_reclaim_service.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h
index e9e0f144d..a3f6c19b6 100644
--- a/src/include/gnunet_reclaim_service.h
+++ b/src/include/gnunet_reclaim_service.h
@@ -498,6 +498,43 @@ GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h);
498void 498void
499GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op); 499GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op);
500 500
501/**
502 * Get serialized ticket size
503 *
504 * @param tkt the ticket
505 * @return the buffer length requirement for a serialization
506 */
507size_t
508GNUNET_RECLAIM_ticket_serialize_get_size (const struct GNUNET_RECLAIM_Ticket *tkt);
509
510/**
511 * Deserializes a ticket
512 *
513 * @param buffer the buffer to read from
514 * @param len the length of the buffer
515 * @param tkt the ticket to write to (must be allocated)
516 * @param kb_read how many bytes were read from buffer
517 * @return GNUNET_SYSERR on error
518 */
519enum GNUNET_GenericReturnValue
520GNUNET_RECLAIM_read_ticket_from_buffer (const void *buffer,
521 size_t len,
522 struct GNUNET_RECLAIM_Ticket *tkt,
523 size_t *tb_read);
524
525/**
526 * Serializes a ticket
527 *
528 * @param tkt the ticket to serialize
529 * @param buffer the buffer to serialize to (must be allocated with sufficient size
530 * @param len the length of the buffer
531 * @return the number of written bytes or < 0 on error
532 */
533ssize_t
534GNUNET_RECLAIM_write_ticket_to_buffer (const struct
535 GNUNET_RECLAIM_Ticket *tkt,
536 void *buffer,
537 size_t len);
501 538
502#if 0 /* keep Emacsens' auto-indent happy */ 539#if 0 /* keep Emacsens' auto-indent happy */
503{ 540{