aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_reclaim_attribute_lib.h
diff options
context:
space:
mode:
authorMarkus Voggenreiter <Markus.Voggenreiter@tum.de>2019-10-23 21:50:46 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-01-13 13:31:03 +0100
commitbb286cb253251e8210ed686dbde3dc8ecee16420 (patch)
tree4e7f625480adb0397df002f6e26bb6a3755ff3cc /src/include/gnunet_reclaim_attribute_lib.h
parentc136a16600cd4f72d7def1af7b4aa7592310c898 (diff)
downloadgnunet-bb286cb253251e8210ed686dbde3dc8ecee16420.tar.gz
gnunet-bb286cb253251e8210ed686dbde3dc8ecee16420.zip
Preparation for Reference Type
Diffstat (limited to 'src/include/gnunet_reclaim_attribute_lib.h')
-rw-r--r--src/include/gnunet_reclaim_attribute_lib.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/include/gnunet_reclaim_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h
index 8476e77fc..cfdecae79 100644
--- a/src/include/gnunet_reclaim_attribute_lib.h
+++ b/src/include/gnunet_reclaim_attribute_lib.h
@@ -138,6 +138,34 @@ struct GNUNET_RECLAIM_ATTESTATION_Claim
138}; 138};
139 139
140/** 140/**
141 * A reference to an Attestatiom.
142 */
143struct GNUNET_RECLAIM_ATTESTATION_REFERENCE
144{
145 /**
146 * ID
147 */
148 uint64_t id;
149
150 /**
151 * Referenced ID of Attestation
152 */
153 uint64_t id_attest;
154
155 /**
156 * The name of the attribute/attestation reference value. Note "name" must never be individually
157 * free'd
158 */
159 const char *name;
160
161 /**
162 * The name of the attribute/attestation reference value. Note "name" must never be individually
163 * free'd
164 */
165 const char *reference_value;
166};
167
168/**
141 * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures. 169 * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures.
142 */ 170 */
143struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList 171struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList
@@ -450,6 +478,51 @@ GNUNET_RECLAIM_ATTESTATION_number_to_typename (uint32_t type);
450uint32_t 478uint32_t
451GNUNET_RECLAIM_ATTESTATION_typename_to_number (const char *typename); 479GNUNET_RECLAIM_ATTESTATION_typename_to_number (const char *typename);
452 480
481/**
482 * Create a new attestation reference.
483 *
484 * @param attr_name the referenced claim name
485 * @param ref_value the claim name in the attestation
486 * @return the new reference
487 */
488struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *
489GNUNET_RECLAIM_ATTESTATION_reference_new (const char *attr_name,
490 const char *ref_value);
491
492
493/**
494 * Get required size for serialization buffer
495 *
496 * @param attr the reference to serialize
497 * @return the required buffer size
498 */
499size_t
500GNUNET_RECLAIM_ATTESTATION_REF_serialize_get_size (
501 const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr);
502
503/**
504 * Serialize a reference
505 *
506 * @param attr the reference to serialize
507 * @param result the serialized reference
508 * @return length of serialized data
509 */
510size_t
511GNUNET_RECLAIM_ATTESTATION_REF_serialize (
512 const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr,
513 char *result);
514
515/**
516 * Deserialize a reference
517 *
518 * @param data the serialized reference
519 * @param data_size the length of the serialized data
520 *
521 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller
522 */
523struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *
524GNUNET_RECLAIM_ATTESTATION_REF_deserialize (const char *data, size_t data_size);
525
453#if 0 /* keep Emacsens' auto-indent happy */ 526#if 0 /* keep Emacsens' auto-indent happy */
454{ 527{
455#endif 528#endif