aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_escrow_lib.h
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-09-01 19:20:07 +0200
committerjospaeth <spaethj@in.tum.de>2020-09-01 19:20:07 +0200
commitdb199dd2280071adafc14ff66cfa1c21399f06c2 (patch)
tree4304101abda07cab1635936a7c7549b483411e2c /src/include/gnunet_escrow_lib.h
parentb3d2c4c9fe8837ad962ed33189b0807c7d634923 (diff)
downloadgnunet-db199dd2280071adafc14ff66cfa1c21399f06c2.tar.gz
gnunet-db199dd2280071adafc14ff66cfa1c21399f06c2.zip
change structure of struct GNUNET_ESCROW_Anchor
encode method name and ego name in anchor string implement anchor_string_to_data and anchor_data_to_string in escrow_api.c (not plugin-specific)
Diffstat (limited to 'src/include/gnunet_escrow_lib.h')
-rw-r--r--src/include/gnunet_escrow_lib.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/include/gnunet_escrow_lib.h b/src/include/gnunet_escrow_lib.h
index dddf5e030..f9135c28e 100644
--- a/src/include/gnunet_escrow_lib.h
+++ b/src/include/gnunet_escrow_lib.h
@@ -77,7 +77,7 @@ struct GNUNET_ESCROW_Anchor
77 /** 77 /**
78 * The name of the ego that was put in escrow. 78 * The name of the ego that was put in escrow.
79 */ 79 */
80 char *egoName; 80 const char *egoName;
81 81
82 /** 82 /**
83 * The size of the anchor data. 83 * The size of the anchor data.
@@ -370,33 +370,48 @@ GNUNET_ESCROW_get_status (
370 * Deserialize an escrow anchor string (e.g. from command line) into a 370 * Deserialize an escrow anchor string (e.g. from command line) into a
371 * GNUNET_ESCROW_Anchor struct 371 * GNUNET_ESCROW_Anchor struct
372 * 372 *
373 * @param h the handle for the escrow component
374 * @param anchorString the encoded escrow anchor string 373 * @param anchorString the encoded escrow anchor string
375 * @param method the escrow method to use
376 * 374 *
377 * @return the deserialized data packed into a GNUNET_ESCROW_Anchor struct, 375 * @return the deserialized data packed into a GNUNET_ESCROW_Anchor struct,
378 * NULL if we failed to parse the string 376 * NULL if we failed to parse the string
379 */ 377 */
380struct GNUNET_ESCROW_Anchor * 378struct GNUNET_ESCROW_Anchor *
381GNUNET_ESCROW_anchor_string_to_data ( 379GNUNET_ESCROW_anchor_string_to_data (
382 struct GNUNET_ESCROW_Handle *h, 380 const char *anchorString);
383 char *anchorString,
384 enum GNUNET_ESCROW_Key_Escrow_Method method);
385 381
386 382
387/** 383/**
388 * Serialize an escrow anchor (struct GNUNET_ESCROW_Anchor) into a string 384 * Serialize an escrow anchor (struct GNUNET_ESCROW_Anchor) into a string
389 * 385 *
390 * @param h the handle for the escrow component
391 * @param escrowAnchor the escrow anchor struct 386 * @param escrowAnchor the escrow anchor struct
392 * @param method the escrow method to use
393 * 387 *
394 * @return the encoded escrow anchor string 388 * @return the encoded escrow anchor string
395 */ 389 */
396char * 390char *
397GNUNET_ESCROW_anchor_data_to_string (struct GNUNET_ESCROW_Handle *h, 391GNUNET_ESCROW_anchor_data_to_string (
398 struct GNUNET_ESCROW_Anchor *escrowAnchor, 392 const struct GNUNET_ESCROW_Anchor *escrowAnchor);
399 enum GNUNET_ESCROW_Key_Escrow_Method method); 393
394
395/**
396 * Convert a method name string to the respective enum number
397 *
398 * @param methodString the method name string
399 *
400 * @return the enum number
401 */
402enum GNUNET_ESCROW_Key_Escrow_Method
403GNUNET_ESCROW_method_string_to_number (const char *methodString);
404
405
406/**
407 * Convert a method enum number to the respective method string
408 *
409 * @param method the method enum number
410 *
411 * @return the method string
412 */
413const char *
414GNUNET_ESCROW_method_number_to_string (enum GNUNET_ESCROW_Key_Escrow_Method method);
400 415
401 416
402/** 417/**