diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-01-30 09:22:40 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-01-30 09:22:40 +0000 |
commit | 8cc87399cf760b9fa3cbdb40bf71d1eb333c8434 (patch) | |
tree | 2d31e83f5bf94df202f7e391b845ed37f9796e58 /src | |
parent | 38b1b6e994856e41b9631d4c06d6cc9126f4b411 (diff) | |
download | gnunet-8cc87399cf760b9fa3cbdb40bf71d1eb333c8434.tar.gz gnunet-8cc87399cf760b9fa3cbdb40bf71d1eb333c8434.zip |
forgot
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_transport_service.h | 13 | ||||
-rw-r--r-- | src/transport/transport_api.c | 11 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index bf14c11f8..76bf7210e 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -270,6 +270,19 @@ struct GNUNET_TRANSPORT_GetHelloHandle; | |||
270 | 270 | ||
271 | 271 | ||
272 | /** | 272 | /** |
273 | * Checks if a neighbour is connected | ||
274 | * | ||
275 | * @param handle connection to transport service | ||
276 | * @peer the peer to check | ||
277 | * @return GNUNET_YES or GNUNET_NO | ||
278 | * | ||
279 | */ | ||
280 | int | ||
281 | GNUNET_TRANSPORT_check_neighbour_connected (struct GNUNET_TRANSPORT_Handle *handle, | ||
282 | const struct GNUNET_PeerIdentity *peer); | ||
283 | |||
284 | |||
285 | /** | ||
273 | * Obtain updates on changes to the HELLO message for this peer. | 286 | * Obtain updates on changes to the HELLO message for this peer. |
274 | * | 287 | * |
275 | * @param handle connection to transport service | 288 | * @param handle connection to transport service |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index d546b6556..520d8fc49 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -1249,7 +1249,18 @@ GNUNET_TRANSPORT_offer_hello_cancel (struct GNUNET_TRANSPORT_OfferHelloHandle *o | |||
1249 | GNUNET_free (ohh); | 1249 | GNUNET_free (ohh); |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | int | ||
1253 | GNUNET_TRANSPORT_check_neighbour_connected (struct GNUNET_TRANSPORT_Handle *handle, | ||
1254 | const struct GNUNET_PeerIdentity *peer) | ||
1255 | { | ||
1256 | GNUNET_assert (NULL != handle); | ||
1257 | GNUNET_assert (NULL != peer); | ||
1252 | 1258 | ||
1259 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains(handle->neighbours, &peer->hashPubKey)) | ||
1260 | return GNUNET_YES; | ||
1261 | else | ||
1262 | return GNUNET_NO; | ||
1263 | } | ||
1253 | 1264 | ||
1254 | /** | 1265 | /** |
1255 | * Obtain the HELLO message for this peer. | 1266 | * Obtain the HELLO message for this peer. |