diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-12 20:30:37 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-19 12:39:55 +0100 |
commit | af252f5c3d4e62f4db39bbc65f3eea4f853d04bc (patch) | |
tree | 616629ee96494f49469162563ee6c90424c871e9 /src/include | |
parent | 3e3081cfd22f5dacbeaba2843131c4aec530b562 (diff) | |
download | gnunet-af252f5c3d4e62f4db39bbc65f3eea4f853d04bc.tar.gz gnunet-af252f5c3d4e62f4db39bbc65f3eea4f853d04bc.zip |
-conclude hello-uri implementation and test
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_hello_uri_lib.h | 13 | ||||
-rw-r--r-- | src/include/gnunet_strings_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_time_lib.h | 13 |
3 files changed, 22 insertions, 6 deletions
diff --git a/src/include/gnunet_hello_uri_lib.h b/src/include/gnunet_hello_uri_lib.h index dbf4dc35e..ec9cdfa5e 100644 --- a/src/include/gnunet_hello_uri_lib.h +++ b/src/include/gnunet_hello_uri_lib.h | |||
@@ -103,26 +103,30 @@ GNUNET_HELLO_builder_from_url (const char *url); | |||
103 | * Generate HELLO message from a @a builder | 103 | * Generate HELLO message from a @a builder |
104 | * | 104 | * |
105 | * @param builder builder to serialize | 105 | * @param builder builder to serialize |
106 | * @param priv private key to use to sign the result | ||
106 | * @return HELLO message matching @a builder | 107 | * @return HELLO message matching @a builder |
107 | */ | 108 | */ |
108 | struct GNUNET_MQ_Envelope * | 109 | struct GNUNET_MQ_Envelope * |
109 | GNUNET_HELLO_builder_to_env (struct GNUNET_HELLO_Builder *builder); | 110 | GNUNET_HELLO_builder_to_env (const struct GNUNET_HELLO_Builder *builder, |
111 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv); | ||
110 | 112 | ||
111 | 113 | ||
112 | /** | 114 | /** |
113 | * Generate GNUnet HELLO URI from a @a builder | 115 | * Generate GNUnet HELLO URI from a @a builder |
114 | * | 116 | * |
115 | * @param builder builder to serialize | 117 | * @param builder builder to serialize |
118 | * @param priv private key to use to sign the result | ||
116 | * @return hello URI | 119 | * @return hello URI |
117 | */ | 120 | */ |
118 | char * | 121 | char * |
119 | GNUNET_HELLO_builder_to_url (struct GNUNET_HELLO_Builder *builder); | 122 | GNUNET_HELLO_builder_to_url (const struct GNUNET_HELLO_Builder *builder, |
120 | 123 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv); | |
121 | 124 | ||
122 | /** | 125 | /** |
123 | * Generate DHT block from a @a builder | 126 | * Generate DHT block from a @a builder |
124 | * | 127 | * |
125 | * @param builder the builder to serialize | 128 | * @param builder the builder to serialize |
129 | * @param priv private key to use to sign the result | ||
126 | * @param[out] block where to write the block, NULL to only calculate @a block_size | 130 | * @param[out] block where to write the block, NULL to only calculate @a block_size |
127 | * @param[in,out] block_size input is number of bytes available in @a block, | 131 | * @param[in,out] block_size input is number of bytes available in @a block, |
128 | * output is number of bytes needed in @a block | 132 | * output is number of bytes needed in @a block |
@@ -130,7 +134,8 @@ GNUNET_HELLO_builder_to_url (struct GNUNET_HELLO_Builder *builder); | |||
130 | * or if @a block was NULL | 134 | * or if @a block was NULL |
131 | */ | 135 | */ |
132 | enum GNUNET_GenericReturnValue | 136 | enum GNUNET_GenericReturnValue |
133 | GNUNET_HELLO_builder_to_block (struct GNUNET_HELLO_Builder *builder, | 137 | GNUNET_HELLO_builder_to_block (const struct GNUNET_HELLO_Builder *builder, |
138 | const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, | ||
134 | void *block, | 139 | void *block, |
135 | size_t *block_size); | 140 | size_t *block_size); |
136 | 141 | ||
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index 09c547b09..bb8577b7a 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -458,7 +458,7 @@ GNUNET_STRINGS_base64url_decode (const char *data, | |||
458 | * | 458 | * |
459 | * @param data the data to encode | 459 | * @param data the data to encode |
460 | * @param len the length of the input | 460 | * @param len the length of the input |
461 | * @param output where to write the output (*output should be NULL, | 461 | * @param[out] out where to write the output (*output should be NULL, |
462 | * is allocated) | 462 | * is allocated) |
463 | * @return the size of the output | 463 | * @return the size of the output |
464 | */ | 464 | */ |
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index b14439462..96413c3cc 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -762,11 +762,22 @@ GNUNET_TIME_absolute_from_s (uint64_t s_after_epoch); | |||
762 | * | 762 | * |
763 | * @param s_after_epoch seconds after epoch to convert | 763 | * @param s_after_epoch seconds after epoch to convert |
764 | * @return converted time value | 764 | * @return converted time value |
765 | */struct GNUNET_TIME_Timestamp | 765 | */ |
766 | struct GNUNET_TIME_Timestamp | ||
766 | GNUNET_TIME_timestamp_from_s (uint64_t s_after_epoch); | 767 | GNUNET_TIME_timestamp_from_s (uint64_t s_after_epoch); |
767 | 768 | ||
768 | 769 | ||
769 | /** | 770 | /** |
771 | * Convert timestamp to number of seconds after the UNIX epoch. | ||
772 | * | ||
773 | * @param ts timestamp to convert | ||
774 | * @return converted time value | ||
775 | */ | ||
776 | uint64_t | ||
777 | GNUNET_TIME_timestamp_to_s (struct GNUNET_TIME_Timestamp ts); | ||
778 | |||
779 | |||
780 | /** | ||
770 | * Convert absolute time from network byte order. | 781 | * Convert absolute time from network byte order. |
771 | * | 782 | * |
772 | * @param a time to convert | 783 | * @param a time to convert |