diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-13 21:19:05 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-13 21:19:05 +0000 |
commit | c01972f2300865e9750092d566da5b08a05c7b4f (patch) | |
tree | ee90331959f5694a1de7743740ade58a5c65c4fb /src | |
parent | e1d767d557cb8241f69e50b9e8d55e5a08e0adcb (diff) | |
download | gnunet-c01972f2300865e9750092d566da5b08a05c7b4f.tar.gz gnunet-c01972f2300865e9750092d566da5b08a05c7b4f.zip |
HELLOs
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport-new.c | 32 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_hello.c | 8 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_hello.h | 8 |
3 files changed, 35 insertions, 13 deletions
diff --git a/src/transport/gnunet-service-transport-new.c b/src/transport/gnunet-service-transport-new.c index f34450319..d0ad2fbad 100644 --- a/src/transport/gnunet-service-transport-new.c +++ b/src/transport/gnunet-service-transport-new.c | |||
@@ -77,6 +77,30 @@ struct GNUNET_ATS_Handle *GST_ats; | |||
77 | 77 | ||
78 | 78 | ||
79 | /** | 79 | /** |
80 | * Transmit our HELLO message to the given (connected) neighbour. | ||
81 | * | ||
82 | * @param cls the 'HELLO' message | ||
83 | * @param target a connected neighbour | ||
84 | * @param ats performance information (unused) | ||
85 | * @param ats_count number of records in ats (unused) | ||
86 | */ | ||
87 | static void | ||
88 | transmit_our_hello (void *cls, | ||
89 | const struct GNUNET_PeerIdentity *target, | ||
90 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | ||
91 | uint32_t ats_count) | ||
92 | { | ||
93 | const struct GNUNET_MessageHeader *hello = cls; | ||
94 | |||
95 | GST_neighbours_send (target, | ||
96 | (const char*) hello, | ||
97 | ntohs (hello->size), | ||
98 | GST_HELLO_ADDRESS_EXPIRATION, | ||
99 | NULL, NULL); | ||
100 | } | ||
101 | |||
102 | |||
103 | /** | ||
80 | * My HELLO has changed. Tell everyone who should know. | 104 | * My HELLO has changed. Tell everyone who should know. |
81 | * | 105 | * |
82 | * @param cls unused | 106 | * @param cls unused |
@@ -87,12 +111,8 @@ process_hello_update (void *cls, | |||
87 | const struct GNUNET_MessageHeader *hello) | 111 | const struct GNUNET_MessageHeader *hello) |
88 | { | 112 | { |
89 | GST_clients_broadcast (hello, GNUNET_NO); | 113 | GST_clients_broadcast (hello, GNUNET_NO); |
90 | GNUNET_break (0); // FIXME | 114 | GST_neighbours_iterate (&transmit_our_hello, |
91 | #if 0 | 115 | (void*) hello); |
92 | GNUNET_CONTAINER_multihashmap_iterate (neighbours, | ||
93 | &transmit_our_hello_if_pong, | ||
94 | NULL); | ||
95 | #endif | ||
96 | } | 116 | } |
97 | 117 | ||
98 | 118 | ||
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c index cf7459769..f05c0836a 100644 --- a/src/transport/gnunet-service-transport_hello.c +++ b/src/transport/gnunet-service-transport_hello.c | |||
@@ -31,12 +31,6 @@ | |||
31 | #include "gnunet-service-transport.h" | 31 | #include "gnunet-service-transport.h" |
32 | #include "gnunet-service-transport_plugins.h" | 32 | #include "gnunet-service-transport_plugins.h" |
33 | 33 | ||
34 | /** | ||
35 | * After how long do we expire an address in a HELLO that we just | ||
36 | * validated? This value is also used for our own addresses when we | ||
37 | * create a HELLO. | ||
38 | */ | ||
39 | #define HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 12) | ||
40 | 34 | ||
41 | /** | 35 | /** |
42 | * How often do we refresh our HELLO (due to expiration concerns)? | 36 | * How often do we refresh our HELLO (due to expiration concerns)? |
@@ -172,7 +166,7 @@ refresh_hello_task (void *cls, | |||
172 | 166 | ||
173 | hello_task = GNUNET_SCHEDULER_NO_TASK; | 167 | hello_task = GNUNET_SCHEDULER_NO_TASK; |
174 | gc.addr_pos = oal_head; | 168 | gc.addr_pos = oal_head; |
175 | gc.expiration = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); | 169 | gc.expiration = GNUNET_TIME_relative_to_absolute (GST_HELLO_ADDRESS_EXPIRATION); |
176 | GNUNET_free (our_hello); | 170 | GNUNET_free (our_hello); |
177 | our_hello = GNUNET_HELLO_create (&GST_my_public_key, | 171 | our_hello = GNUNET_HELLO_create (&GST_my_public_key, |
178 | &address_generator, | 172 | &address_generator, |
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h index d34162841..7b86d62d0 100644 --- a/src/transport/gnunet-service-transport_hello.h +++ b/src/transport/gnunet-service-transport_hello.h | |||
@@ -32,6 +32,14 @@ | |||
32 | 32 | ||
33 | 33 | ||
34 | /** | 34 | /** |
35 | * After how long do we expire an address in a HELLO that we just | ||
36 | * validated? This value is also used for our own addresses when we | ||
37 | * create a HELLO. | ||
38 | */ | ||
39 | #define GST_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 12) | ||
40 | |||
41 | |||
42 | /** | ||
35 | * Signature of a function to call whenever our hello changes. | 43 | * Signature of a function to call whenever our hello changes. |
36 | * | 44 | * |
37 | * @param cls closure | 45 | * @param cls closure |