aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-02-07 21:15:59 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-02-09 20:38:11 +0100
commite8ea1f3e34e2a07cbe2fd4725e7362027d0c51c3 (patch)
tree5b11a525700872147d92d8195615e4352d6d18b1 /src/include
parent5f9f9cae1714eb33e0ee9c824f3d88e6aab8cf63 (diff)
downloadgnunet-e8ea1f3e34e2a07cbe2fd4725e7362027d0c51c3.tar.gz
gnunet-e8ea1f3e34e2a07cbe2fd4725e7362027d0c51c3.zip
add expiration
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_reclaim_lib.h15
-rw-r--r--src/include/gnunet_reclaim_plugin.h39
-rw-r--r--src/include/gnunet_reclaim_service.h3
3 files changed, 48 insertions, 9 deletions
diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h
index 6d3503950..54d284f3c 100644
--- a/src/include/gnunet_reclaim_lib.h
+++ b/src/include/gnunet_reclaim_lib.h
@@ -262,7 +262,8 @@ struct GNUNET_RECLAIM_AttestationListEntry
262 */ 262 */
263struct GNUNET_RECLAIM_Attribute * 263struct GNUNET_RECLAIM_Attribute *
264GNUNET_RECLAIM_attribute_new (const char *attr_name, 264GNUNET_RECLAIM_attribute_new (const char *attr_name,
265 const struct GNUNET_RECLAIM_Identifier *attestation, 265 const struct
266 GNUNET_RECLAIM_Identifier *attestation,
266 uint32_t type, 267 uint32_t type,
267 const void *data, 268 const void *data,
268 size_t data_size); 269 size_t data_size);
@@ -489,7 +490,6 @@ GNUNET_RECLAIM_attestation_list_deserialize (const char *data,
489 size_t data_size); 490 size_t data_size);
490 491
491 492
492
493/** 493/**
494 * @param attestation the attestation to serialize 494 * @param attestation the attestation to serialize
495 * @return the required buffer size 495 * @return the required buffer size
@@ -593,8 +593,17 @@ GNUNET_RECLAIM_attestation_typename_to_number (const char *typename);
593 * @return corresponding number, UINT32_MAX on error 593 * @return corresponding number, UINT32_MAX on error
594 */ 594 */
595struct GNUNET_RECLAIM_AttributeList* 595struct GNUNET_RECLAIM_AttributeList*
596GNUNET_RECLAIM_attestation_get_attributes (const struct GNUNET_RECLAIM_Attestation *attest); 596GNUNET_RECLAIM_attestation_get_attributes (const struct
597 GNUNET_RECLAIM_Attestation *attest);
598
599char*
600GNUNET_RECLAIM_attestation_get_issuer (const struct
601 GNUNET_RECLAIM_Attestation *attest);
597 602
603int
604GNUNET_RECLAIM_attestation_get_expiration (const struct
605 GNUNET_RECLAIM_Attestation *attest,
606 struct GNUNET_TIME_Absolute *exp);
598 607
599#if 0 /* keep Emacsens' auto-indent happy */ 608#if 0 /* keep Emacsens' auto-indent happy */
600{ 609{
diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h
index d42ac9502..992ad0cc3 100644
--- a/src/include/gnunet_reclaim_plugin.h
+++ b/src/include/gnunet_reclaim_plugin.h
@@ -166,17 +166,40 @@ typedef const char *(*GNUNET_RECLAIM_AttestationNumberToTypenameFunction) (
166 uint32_t type); 166 uint32_t type);
167 167
168/** 168/**
169 * Function called to convert a type number (i.e. 1) to the 169 * Function called to extract attributes from an attestation
170 * corresponding type string
171 * 170 *
172 * @param cls closure 171 * @param cls closure
173 * @param type number of a type to convert 172 * @param attest the attestation object
174 * @return corresponding typestring, NULL on error 173 * @return an attribute list
175 */ 174 */
176typedef struct GNUNET_RECLAIM_AttributeList *(*GNUNET_RECLAIM_AttestationGetAttributesFunction) ( 175typedef struct GNUNET_RECLAIM_AttributeList *(*GNUNET_RECLAIM_AttestationGetAttributesFunction) (
177 void *cls, 176 void *cls,
178 const struct GNUNET_RECLAIM_Attestation *attest); 177 const struct GNUNET_RECLAIM_Attestation *attest);
179 178
179/**
180 * Function called to get the issuer of the attestation (as string)
181 *
182 * @param cls closure
183 * @param attest the attestation object
184 * @return corresponding issuer string
185 */
186typedef char *(*GNUNET_RECLAIM_AttestationGetIssuerFunction) (
187 void *cls,
188 const struct GNUNET_RECLAIM_Attestation *attest);
189
190/**
191 * Function called to get the expiration of the attestation
192 *
193 * @param cls closure
194 * @param attest the attestation object
195 * @param where to write the value
196 * @return GNUNET_OK if successful
197 */
198typedef int (*GNUNET_RECLAIM_AttestationGetExpirationFunction) (
199 void *cls,
200 const struct GNUNET_RECLAIM_Attestation *attest,
201 struct GNUNET_TIME_Absolute *expiration);
202
180 203
181 204
182/** 205/**
@@ -248,7 +271,15 @@ struct GNUNET_RECLAIM_AttestationPluginFunctions
248 */ 271 */
249 GNUNET_RECLAIM_AttestationGetAttributesFunction get_attributes; 272 GNUNET_RECLAIM_AttestationGetAttributesFunction get_attributes;
250 273
274 /**
275 * Attesation issuer.
276 */
277 GNUNET_RECLAIM_AttestationGetIssuerFunction get_issuer;
251 278
279 /**
280 * Expiration.
281 */
282 GNUNET_RECLAIM_AttestationGetExpirationFunction get_expiration;
252}; 283};
253 284
254 285
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h
index c63ed0100..813bc1a59 100644
--- a/src/include/gnunet_reclaim_service.h
+++ b/src/include/gnunet_reclaim_service.h
@@ -143,8 +143,7 @@ typedef void (*GNUNET_RECLAIM_AttributeTicketResult) (
143 */ 143 */
144typedef void (*GNUNET_RECLAIM_AttestationResult) ( 144typedef void (*GNUNET_RECLAIM_AttestationResult) (
145 void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 145 void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
146 const struct GNUNET_RECLAIM_Attestation *attestation, 146 const struct GNUNET_RECLAIM_Attestation *attestation);
147 const struct GNUNET_RECLAIM_AttributeList *attributes);
148 147
149 148
150/** 149/**