aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorch3 <buenger@mytum.de>2024-04-26 19:25:00 +0200
committerch3 <buenger@mytum.de>2024-04-26 19:25:00 +0200
commitfc4e5fe604e18fe25233ff649ae5702c2875a748 (patch)
tree4e0baa78cbc6377667c461d477fdc3f77498d205
parent767bc21e193f21ca33f0cf08e13e3bf6c6e6353f (diff)
downloadgnunet-dev/julius-buenger/cong-recover.tar.gz
gnunet-dev/julius-buenger/cong-recover.zip
pils: add hashcode to correlate address and peer iddev/julius-buenger/cong-recover
and some stylistic changes
-rw-r--r--src/include/gnunet_pils_service.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/include/gnunet_pils_service.h b/src/include/gnunet_pils_service.h
index 58633b854..530f0c479 100644
--- a/src/include/gnunet_pils_service.h
+++ b/src/include/gnunet_pils_service.h
@@ -47,10 +47,14 @@ extern "C" {
47 * TODO this might contain a reference (checksum, ...) to the addresses it was 47 * TODO this might contain a reference (checksum, ...) to the addresses it was
48 * based on in the future 48 * based on in the future
49 * 49 *
50 * @param cls The closure given to #GNUNET_PILS_connect
50 * @param peer_id The new peer id. 51 * @param peer_id The new peer id.
52 * @param hash The hash of addresses the peer id is based on. This hash is also returned by #GNUNET_PILS_feed_address.
51 */ 53 */
52typedef void (*GNUNET_PILS_PidChangeHandler) ( 54typedef void (*GNUNET_PILS_PidChangeCallback) (
53 const struct GNUNET_PeerIdentity *peer_id); 55 struct void *cls,
56 const struct GNUNET_PeerIdentity *peer_id,
57 const struct GNUNET_HashCode *hash);
54 58
55 59
56/** 60/**
@@ -71,7 +75,7 @@ struct GNUNET_PILS_Handle;
71struct GNUNET_PILS_Handle * 75struct GNUNET_PILS_Handle *
72GNUNET_PILS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 76GNUNET_PILS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
73 void *cls, 77 void *cls,
74 GNUNET_PILS_PidChangeHandler change_handler); 78 GNUNET_PILS_PidChangeCallback change_handler);
75 79
76 80
77 81
@@ -118,15 +122,15 @@ GNUNET_PILS_sign_by_peer_identity (const struct GNUNET_PILS_Handle *handle,
118 * 122 *
119 * TODO potentially return a checksum or such, so that the caller can link the 123 * TODO potentially return a checksum or such, so that the caller can link the
120 * 'job' to the 'outcome' (freshly generated peer id) 124 * 'job' to the 'outcome' (freshly generated peer id)
125 * TODO pay attention to high frequency calling - kill previous requests
121 * 126 *
122 * @param handle the handle to the PILS service 127 * @param handle the handle to the PILS service
123 * @param num_addresses The number of addresses. 128 * @param num_addresses The number of addresses.
124 * @param address Array of string representation of addresses. 129 * @param address Array of string representation of addresses.
125 * 130 * @return hash over the given addresses - used to identify the corresponding
126 * @return #GNUNET_OK if a new peer id was generated, GNUNET_SYSERR otherwise 131 * peer id
127 * TODO will we need a more specific return value?
128 */ 132 */
129enum GNUNET_GenericReturnValue 133struct GNUNET_HashCode *
130GNUNET_PILS_feed_address (const struct GNUNET_PILS_Handle *handle, 134GNUNET_PILS_feed_address (const struct GNUNET_PILS_Handle *handle,
131 uint32_t num_addresses, 135 uint32_t num_addresses,
132 const char *address[static num_addresses]); 136 const char *address[static num_addresses]);