aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_hello_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_hello_lib.h')
-rw-r--r--src/include/gnunet_hello_lib.h85
1 files changed, 41 insertions, 44 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index 3c44b5048..556b41d3c 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -60,11 +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 */
63size_t GNUNET_HELLO_add_address (const char *tname, 63size_t
64 struct GNUNET_TIME_Absolute 64GNUNET_HELLO_add_address (const char *tname,
65 expiration, const void *addr, 65 struct GNUNET_TIME_Absolute expiration,
66 uint16_t addr_len, char *target, 66 const void *addr, uint16_t addr_len, char *target,
67 size_t max); 67 size_t max);
68 68
69 69
70/** 70/**
@@ -90,11 +90,11 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls,
90 * 90 *
91 * @return the hello message 91 * @return the hello message
92 */ 92 */
93struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct 93struct GNUNET_HELLO_Message *
94 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 94GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
95 *publicKey, 95 *publicKey,
96 GNUNET_HELLO_GenerateAddressListCallback 96 GNUNET_HELLO_GenerateAddressListCallback addrgen,
97 addrgen, void *addrgen_cls); 97 void *addrgen_cls);
98 98
99 99
100/** 100/**
@@ -102,7 +102,8 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct
102 * @param hello to inspect 102 * @param hello to inspect
103 * @return the size, 0 if HELLO is invalid 103 * @return the size, 0 if HELLO is invalid
104 */ 104 */
105uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); 105uint16_t
106GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello);
106 107
107 108
108/** 109/**
@@ -114,10 +115,9 @@ uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello);
114 * @param h2 the second HELLO message 115 * @param h2 the second HELLO message
115 * @return the combined hello message 116 * @return the combined hello message
116 */ 117 */
117struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct 118struct GNUNET_HELLO_Message *
118 GNUNET_HELLO_Message *h1, 119GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1,
119 const struct 120 const struct GNUNET_HELLO_Message *h2);
120 GNUNET_HELLO_Message *h2);
121 121
122 122
123/** 123/**
@@ -136,12 +136,10 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct
136 * zero if the some addresses with expirations >= now 136 * zero if the some addresses with expirations >= now
137 * do not match at all 137 * do not match at all
138 */ 138 */
139struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct 139struct GNUNET_TIME_Absolute
140 GNUNET_HELLO_Message *h1, 140GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
141 const struct 141 const struct GNUNET_HELLO_Message *h2,
142 GNUNET_HELLO_Message *h2, 142 struct GNUNET_TIME_Absolute now);
143 struct GNUNET_TIME_Absolute
144 now);
145 143
146 144
147/** 145/**
@@ -174,13 +172,10 @@ typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, const char *tname,
174 * @param it_cls closure for it 172 * @param it_cls closure for it
175 * @return the modified HELLO or NULL 173 * @return the modified HELLO or NULL
176 */ 174 */
177struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct 175struct GNUNET_HELLO_Message *
178 GNUNET_HELLO_Message 176GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
179 *msg, 177 int return_modified,
180 int 178 GNUNET_HELLO_AddressIterator it, void *it_cls);
181 return_modified,
182 GNUNET_HELLO_AddressIterator
183 it, void *it_cls);
184 179
185 180
186/** 181/**
@@ -194,14 +189,15 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct
194 * @param it iterator to call on each address 189 * @param it iterator to call on each address
195 * @param it_cls closure for it 190 * @param it_cls closure for it
196 */ 191 */
197void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message 192void
198 *new_hello, 193GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message
199 const struct GNUNET_HELLO_Message 194 *new_hello,
200 *old_hello, 195 const struct GNUNET_HELLO_Message
201 struct GNUNET_TIME_Absolute 196 *old_hello,
202 expiration_limit, 197 struct GNUNET_TIME_Absolute
203 GNUNET_HELLO_AddressIterator it, 198 expiration_limit,
204 void *it_cls); 199 GNUNET_HELLO_AddressIterator it,
200 void *it_cls);
205 201
206 202
207/** 203/**
@@ -211,9 +207,10 @@ void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message
211 * @param publicKey where to copy the public key information, can be NULL 207 * @param publicKey where to copy the public key information, can be NULL
212 * @return GNUNET_SYSERR if the HELLO was malformed 208 * @return GNUNET_SYSERR if the HELLO was malformed
213 */ 209 */
214int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, 210int
215 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 211GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
216 *publicKey); 212 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
213 *publicKey);
217 214
218 215
219/** 216/**
@@ -223,8 +220,9 @@ int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
223 * @param peer where to store the peer's identity 220 * @param peer where to store the peer's identity
224 * @return GNUNET_SYSERR if the HELLO was malformed 221 * @return GNUNET_SYSERR if the HELLO was malformed
225 */ 222 */
226int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, 223int
227 struct GNUNET_PeerIdentity *peer); 224GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
225 struct GNUNET_PeerIdentity *peer);
228 226
229 227
230/** 228/**
@@ -235,9 +233,8 @@ int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
235 * 233 *
236 * @return header or NULL if the HELLO was malformed 234 * @return header or NULL if the HELLO was malformed
237 */ 235 */
238struct GNUNET_MessageHeader *GNUNET_HELLO_get_header (struct 236struct GNUNET_MessageHeader *
239 GNUNET_HELLO_Message 237GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello);
240 *hello);
241 238
242/* ifndef GNUNET_HELLO_LIB_H */ 239/* ifndef GNUNET_HELLO_LIB_H */
243#endif 240#endif