diff options
Diffstat (limited to 'src/include/gnunet_hello_lib.h')
-rw-r--r-- | src/include/gnunet_hello_lib.h | 72 |
1 files changed, 31 insertions, 41 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index a3e4ba0f0..3c44b5048 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -60,18 +60,11 @@ struct GNUNET_HELLO_Message; | |||
60 | * @return number of bytes copied, 0 if | 60 | * @return number of bytes copied, 0 if |
61 | * the target buffer was not big enough. | 61 | * the target buffer was not big enough. |
62 | */ | 62 | */ |
63 | size_t | 63 | size_t GNUNET_HELLO_add_address (const char *tname, |
64 | 64 | struct GNUNET_TIME_Absolute | |
65 | 65 | expiration, const void *addr, | |
66 | 66 | uint16_t addr_len, char *target, | |
67 | 67 | size_t max); | |
68 | |||
69 | |||
70 | |||
71 | GNUNET_HELLO_add_address (const char *tname, | ||
72 | struct GNUNET_TIME_Absolute expiration, | ||
73 | const void *addr, | ||
74 | uint16_t addr_len, char *target, size_t max); | ||
75 | 68 | ||
76 | 69 | ||
77 | /** | 70 | /** |
@@ -85,9 +78,9 @@ GNUNET_HELLO_add_address (const char *tname, | |||
85 | * @return number of bytes written, 0 to signal the | 78 | * @return number of bytes written, 0 to signal the |
86 | * end of the iteration. | 79 | * end of the iteration. |
87 | */ | 80 | */ |
88 | typedef size_t | 81 | typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, |
89 | (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | 82 | size_t max, |
90 | size_t max, void *buf); | 83 | void *buf); |
91 | 84 | ||
92 | 85 | ||
93 | /** | 86 | /** |
@@ -143,11 +136,12 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct | |||
143 | * zero if the some addresses with expirations >= now | 136 | * zero if the some addresses with expirations >= now |
144 | * do not match at all | 137 | * do not match at all |
145 | */ | 138 | */ |
146 | struct GNUNET_TIME_Absolute | 139 | struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct |
147 | GNUNET_HELLO_equals (const struct | 140 | GNUNET_HELLO_Message *h1, |
148 | GNUNET_HELLO_Message *h1, | 141 | const struct |
149 | const struct | 142 | GNUNET_HELLO_Message *h2, |
150 | GNUNET_HELLO_Message *h2, struct GNUNET_TIME_Absolute now); | 143 | struct GNUNET_TIME_Absolute |
144 | now); | ||
151 | 145 | ||
152 | 146 | ||
153 | /** | 147 | /** |
@@ -162,11 +156,10 @@ GNUNET_HELLO_equals (const struct | |||
162 | * GNUNET_NO to delete it from the HELLO | 156 | * GNUNET_NO to delete it from the HELLO |
163 | * GNUNET_SYSERR to stop iterating (but keep current address) | 157 | * GNUNET_SYSERR to stop iterating (but keep current address) |
164 | */ | 158 | */ |
165 | typedef int | 159 | typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, const char *tname, |
166 | (*GNUNET_HELLO_AddressIterator) (void *cls, | 160 | struct GNUNET_TIME_Absolute |
167 | const char *tname, | 161 | expiration, const void *addr, |
168 | struct GNUNET_TIME_Absolute expiration, | 162 | uint16_t addrlen); |
169 | const void *addr, uint16_t addrlen); | ||
170 | 163 | ||
171 | 164 | ||
172 | /** | 165 | /** |
@@ -201,15 +194,14 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct | |||
201 | * @param it iterator to call on each address | 194 | * @param it iterator to call on each address |
202 | * @param it_cls closure for it | 195 | * @param it_cls closure for it |
203 | */ | 196 | */ |
204 | void | 197 | void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message |
205 | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | 198 | *new_hello, |
206 | *new_hello, | 199 | const struct GNUNET_HELLO_Message |
207 | const struct GNUNET_HELLO_Message | 200 | *old_hello, |
208 | *old_hello, | 201 | struct GNUNET_TIME_Absolute |
209 | struct GNUNET_TIME_Absolute | 202 | expiration_limit, |
210 | expiration_limit, | 203 | GNUNET_HELLO_AddressIterator it, |
211 | GNUNET_HELLO_AddressIterator it, | 204 | void *it_cls); |
212 | void *it_cls); | ||
213 | 205 | ||
214 | 206 | ||
215 | /** | 207 | /** |
@@ -219,10 +211,9 @@ GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | |||
219 | * @param publicKey where to copy the public key information, can be NULL | 211 | * @param publicKey where to copy the public key information, can be NULL |
220 | * @return GNUNET_SYSERR if the HELLO was malformed | 212 | * @return GNUNET_SYSERR if the HELLO was malformed |
221 | */ | 213 | */ |
222 | int | 214 | int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
223 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 215 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
224 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 216 | *publicKey); |
225 | *publicKey); | ||
226 | 217 | ||
227 | 218 | ||
228 | /** | 219 | /** |
@@ -232,9 +223,8 @@ GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | |||
232 | * @param peer where to store the peer's identity | 223 | * @param peer where to store the peer's identity |
233 | * @return GNUNET_SYSERR if the HELLO was malformed | 224 | * @return GNUNET_SYSERR if the HELLO was malformed |
234 | */ | 225 | */ |
235 | int | 226 | int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, |
236 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | 227 | struct GNUNET_PeerIdentity *peer); |
237 | struct GNUNET_PeerIdentity *peer); | ||
238 | 228 | ||
239 | 229 | ||
240 | /** | 230 | /** |