diff options
Diffstat (limited to 'src/include/gnunet_nat_lib.h')
-rw-r--r-- | src/include/gnunet_nat_lib.h | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 57eaac606..2ab3eccb6 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -186,19 +186,44 @@ void | |||
186 | GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | 186 | GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); |
187 | 187 | ||
188 | 188 | ||
189 | /** | ||
190 | * Signature of a callback that is given an IP address. | ||
191 | * | ||
192 | * @param cls closure | ||
193 | * @param addr the address, NULL on errors | ||
194 | */ | ||
195 | typedef void (*GNUNET_NAT_IPCallback)(void *cls, | ||
196 | const struct in_addr *addr); | ||
197 | |||
198 | |||
199 | |||
200 | /** | ||
201 | * Opaque handle to cancel "GNUNET_NAT_mini_get_external_ipv4" operation. | ||
202 | */ | ||
203 | struct GNUNET_NAT_ExternalHandle; | ||
204 | |||
189 | 205 | ||
190 | /** | 206 | /** |
191 | * Try to get the external IPv4 address of this peer. | 207 | * Try to get the external IPv4 address of this peer. |
192 | * Note: calling this function may block this process | ||
193 | * for a few seconds (!). | ||
194 | * | 208 | * |
195 | * @param addr address to set | 209 | * @param timeout when to fail |
196 | * @return GNUNET_OK on success, | 210 | * @param cb function to call with result |
197 | * GNUNET_NO if the result is questionable, | 211 | * @param cb_cls closure for 'cb' |
198 | * GNUNET_SYSERR on error | 212 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error |
199 | */ | 213 | */ |
200 | int | 214 | struct GNUNET_NAT_ExternalHandle * |
201 | GNUNET_NAT_mini_get_external_ipv4 (struct in_addr *addr); | 215 | GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, |
216 | GNUNET_NAT_IPCallback cb, | ||
217 | void *cb_cls); | ||
218 | |||
219 | |||
220 | /** | ||
221 | * Cancel operation. | ||
222 | * | ||
223 | * @param eh operation to cancel | ||
224 | */ | ||
225 | void | ||
226 | GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); | ||
202 | 227 | ||
203 | 228 | ||
204 | /** | 229 | /** |