aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-30 20:35:10 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-30 20:35:10 +0000
commita0ba5b741b56036bd35bd9ba88164324b2ff7ada (patch)
tree3fd10a0fc15f9a9e7cf5415b2bec86d97d7fe825 /src/transport/gnunet-service-transport_neighbours.c
parent427dd6f998fb1fde515a3b5c800f9f6d308197b2 (diff)
downloadgnunet-a0ba5b741b56036bd35bd9ba88164324b2ff7ada.tar.gz
gnunet-a0ba5b741b56036bd35bd9ba88164324b2ff7ada.zip
-getting ATS and transport to compile again (part of #3047)
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 1a6a87853..90f45f126 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -739,7 +739,7 @@ struct BlackListCheckContext
739/** 739/**
740 * Hash map from peer identities to the respective 'struct NeighbourMapEntry'. 740 * Hash map from peer identities to the respective 'struct NeighbourMapEntry'.
741 */ 741 */
742static struct GNUNET_CONTAINER_MultiHashMap *neighbours; 742static struct GNUNET_CONTAINER_MultiPeerMap *neighbours;
743 743
744/** 744/**
745 * We keep blacklist checks in a DLL so that we can find 745 * We keep blacklist checks in a DLL so that we can find
@@ -795,7 +795,7 @@ lookup_neighbour (const struct GNUNET_PeerIdentity *pid)
795{ 795{
796 if (NULL == neighbours) 796 if (NULL == neighbours)
797 return NULL; 797 return NULL;
798 return GNUNET_CONTAINER_multihashmap_get (neighbours, &pid->hashPubKey); 798 return GNUNET_CONTAINER_multipeermap_get (neighbours, pid);
799} 799}
800 800
801static const char * 801static const char *
@@ -1077,8 +1077,8 @@ free_neighbour (struct NeighbourMapEntry *n, int keep_sessions)
1077 MEMDEBUG_free_non_null (backup_primary, __LINE__); 1077 MEMDEBUG_free_non_null (backup_primary, __LINE__);
1078 1078
1079 GNUNET_assert (GNUNET_YES == 1079 GNUNET_assert (GNUNET_YES ==
1080 GNUNET_CONTAINER_multihashmap_remove (neighbours, 1080 GNUNET_CONTAINER_multipeermap_remove (neighbours,
1081 &n->id.hashPubKey, n)); 1081 &n->id, n));
1082 1082
1083 // FIXME-ATS-API: we might want to be more specific about 1083 // FIXME-ATS-API: we might want to be more specific about
1084 // which states we do this from in the future (ATS should 1084 // which states we do this from in the future (ATS should
@@ -1201,7 +1201,7 @@ send_disconnect (struct NeighbourMapEntry *n)
1201 htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); 1201 htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT);
1202 disconnect_msg.timestamp = 1202 disconnect_msg.timestamp =
1203 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 1203 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
1204 disconnect_msg.public_key = GST_my_public_key; 1204 disconnect_msg.public_key = GST_my_identity.public_key;
1205 GNUNET_assert (GNUNET_OK == 1205 GNUNET_assert (GNUNET_OK ==
1206 GNUNET_CRYPTO_ecc_sign (GST_my_private_key, 1206 GNUNET_CRYPTO_ecc_sign (GST_my_private_key,
1207 &disconnect_msg.purpose, 1207 &disconnect_msg.purpose,
@@ -1799,8 +1799,8 @@ setup_neighbour (const struct GNUNET_PeerIdentity *peer)
1799 MAX_BANDWIDTH_CARRY_S); 1799 MAX_BANDWIDTH_CARRY_S);
1800 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 1800 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
1801 GNUNET_assert (GNUNET_OK == 1801 GNUNET_assert (GNUNET_OK ==
1802 GNUNET_CONTAINER_multihashmap_put (neighbours, 1802 GNUNET_CONTAINER_multipeermap_put (neighbours,
1803 &n->id.hashPubKey, n, 1803 &n->id, n,
1804 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 1804 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
1805 return n; 1805 return n;
1806} 1806}
@@ -3223,7 +3223,7 @@ struct IteratorContext
3223 * @return GNUNET_OK (continue to iterate) 3223 * @return GNUNET_OK (continue to iterate)
3224 */ 3224 */
3225static int 3225static int
3226neighbours_iterate (void *cls, const struct GNUNET_HashCode * key, void *value) 3226neighbours_iterate (void *cls, const struct GNUNET_PeerIdentity * key, void *value)
3227{ 3227{
3228 struct IteratorContext *ic = cls; 3228 struct IteratorContext *ic = cls;
3229 struct NeighbourMapEntry *n = value; 3229 struct NeighbourMapEntry *n = value;
@@ -3267,7 +3267,7 @@ GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls)
3267 return; /* can happen during shutdown */ 3267 return; /* can happen during shutdown */
3268 ic.cb = cb; 3268 ic.cb = cb;
3269 ic.cb_cls = cb_cls; 3269 ic.cb_cls = cb_cls;
3270 GNUNET_CONTAINER_multihashmap_iterate (neighbours, &neighbours_iterate, &ic); 3270 GNUNET_CONTAINER_multipeermap_iterate (neighbours, &neighbours_iterate, &ic);
3271} 3271}
3272 3272
3273 3273
@@ -3375,7 +3375,7 @@ GST_neighbours_start (void *cls,
3375 connect_notify_cb = connect_cb; 3375 connect_notify_cb = connect_cb;
3376 disconnect_notify_cb = disconnect_cb; 3376 disconnect_notify_cb = disconnect_cb;
3377 address_change_cb = peer_address_cb; 3377 address_change_cb = peer_address_cb;
3378 neighbours = GNUNET_CONTAINER_multihashmap_create (NEIGHBOUR_TABLE_SIZE, GNUNET_NO); 3378 neighbours = GNUNET_CONTAINER_multipeermap_create (NEIGHBOUR_TABLE_SIZE, GNUNET_NO);
3379} 3379}
3380 3380
3381 3381
@@ -3388,7 +3388,9 @@ GST_neighbours_start (void *cls,
3388 * @return GNUNET_OK (continue to iterate) 3388 * @return GNUNET_OK (continue to iterate)
3389 */ 3389 */
3390static int 3390static int
3391disconnect_all_neighbours (void *cls, const struct GNUNET_HashCode * key, void *value) 3391disconnect_all_neighbours (void *cls,
3392 const struct GNUNET_PeerIdentity *key,
3393 void *value)
3392{ 3394{
3393 struct NeighbourMapEntry *n = value; 3395 struct NeighbourMapEntry *n = value;
3394 3396
@@ -3409,10 +3411,10 @@ GST_neighbours_stop ()
3409{ 3411{
3410 if (NULL == neighbours) 3412 if (NULL == neighbours)
3411 return; 3413 return;
3412 GNUNET_CONTAINER_multihashmap_iterate (neighbours, 3414 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
3413 &disconnect_all_neighbours, 3415 &disconnect_all_neighbours,
3414 NULL); 3416 NULL);
3415 GNUNET_CONTAINER_multihashmap_destroy (neighbours); 3417 GNUNET_CONTAINER_multipeermap_destroy (neighbours);
3416 neighbours = NULL; 3418 neighbours = NULL;
3417 callback_cls = NULL; 3419 callback_cls = NULL;
3418 connect_notify_cb = NULL; 3420 connect_notify_cb = NULL;