aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_tunnel.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-10 14:50:58 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-10 14:50:58 +0000
commitdd3a1c05284929dabcafab2a79c872b29d162e39 (patch)
tree4fb8593610f6eece7593eb096734c03cad54b576 /src/mesh/gnunet-service-mesh_tunnel.c
parentf511e6f93b40c050a0638d851e1f51069d96ca48 (diff)
downloadgnunet-dd3a1c05284929dabcafab2a79c872b29d162e39.tar.gz
gnunet-dd3a1c05284929dabcafab2a79c872b29d162e39.zip
- fixes
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.c')
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c
index b077d00b2..bd57956ad 100644
--- a/src/mesh/gnunet-service-mesh_tunnel.c
+++ b/src/mesh/gnunet-service-mesh_tunnel.c
@@ -164,19 +164,19 @@ struct MeshTunnelQueue
164extern struct GNUNET_STATISTICS_Handle *stats; 164extern struct GNUNET_STATISTICS_Handle *stats;
165 165
166/** 166/**
167 * Default TTL for payload packets. 167 * Local peer own ID (memory efficient handle).
168 */ 168 */
169static unsigned long long default_ttl; 169extern GNUNET_PEER_Id myid;
170 170
171/** 171/**
172 * Local peer own ID (memory efficient handle). 172 * Local peer own ID (full value).
173 */ 173 */
174static GNUNET_PEER_Id my_short_id; 174extern struct GNUNET_PeerIdentity my_full_id;
175 175
176/** 176/**
177 * Local peer own ID (full value). 177 * Default TTL for payload packets.
178 */ 178 */
179const static struct GNUNET_PeerIdentity *my_full_id; 179static unsigned long long default_ttl;
180 180
181/** 181/**
182 * Own private key. 182 * Own private key.
@@ -547,7 +547,6 @@ GMT_send_queued_data (struct MeshTunnel3 *t, int fwd)
547 */ 547 */
548void 548void
549GMT_init (const struct GNUNET_CONFIGURATION_Handle *c, 549GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
550 const struct GNUNET_PeerIdentity *id,
551 const struct GNUNET_CRYPTO_EddsaPrivateKey *key) 550 const struct GNUNET_CRYPTO_EddsaPrivateKey *key)
552{ 551{
553 if (GNUNET_OK != 552 if (GNUNET_OK !=
@@ -558,9 +557,7 @@ GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
558 "MESH", "DEFAULT_TTL", "USING DEFAULT"); 557 "MESH", "DEFAULT_TTL", "USING DEFAULT");
559 default_ttl = 64; 558 default_ttl = 64;
560 } 559 }
561 my_full_id = id;
562 my_private_key = key; 560 my_private_key = key;
563 my_short_id = GNUNET_PEER_intern (my_full_id);
564} 561}
565 562
566 563
@@ -570,7 +567,7 @@ GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
570void 567void
571GMT_shutdown (void) 568GMT_shutdown (void)
572{ 569{
573 GNUNET_PEER_change_rc (my_short_id, -1); 570 GNUNET_PEER_change_rc (myid, -1);
574} 571}
575 572
576 573
@@ -894,7 +891,7 @@ GMT_use_path (struct MeshTunnel3 *t, struct MeshPeerPath *p)
894 891
895 for (own_pos = 0; own_pos < p->length; own_pos++) 892 for (own_pos = 0; own_pos < p->length; own_pos++)
896 { 893 {
897 if (p->peers[own_pos] == my_short_id) 894 if (p->peers[own_pos] == myid)
898 break; 895 break;
899 } 896 }
900 if (own_pos > p->length - 1) 897 if (own_pos > p->length - 1)
@@ -1164,7 +1161,7 @@ GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
1164int 1161int
1165GMT_is_loopback (const struct MeshTunnel3 *t) 1162GMT_is_loopback (const struct MeshTunnel3 *t)
1166{ 1163{
1167 return (my_short_id == GMP_get_short_id(t->peer)); 1164 return (myid == GMP_get_short_id(t->peer));
1168} 1165}
1169 1166
1170 1167