aboutsummaryrefslogtreecommitdiff
path: root/src/dv/dv.h
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-04-30 14:50:06 +0000
committerNathan S. Evans <evans@in.tum.de>2010-04-30 14:50:06 +0000
commit5f9efe3ff20656b7900fc0b503f3e0cbe75eb20a (patch)
treea6f379dfd9dafc1db1fa95260ab7029f15a9b283 /src/dv/dv.h
parente6b08db0728b172da76392967661c09e7bfdbb55 (diff)
downloadgnunet-5f9efe3ff20656b7900fc0b503f3e0cbe75eb20a.tar.gz
gnunet-5f9efe3ff20656b7900fc0b503f3e0cbe75eb20a.zip
dv changes. add propagation of disconnect messages, dv updates on peer direct connections. Result of those two changes should be a much better learned topology for all peers. This was periodic gossip is really only to stop timeouts from removing peers. Also changed dv_api to wait for message queuing by dv service before calling transport transmit continuation, so that addresses that are no longer available can be caught by transport service. Perhaps some other stuff I have forgotten about. Should be kinda sorta working, need to make better testcases and do more debugging as errors inevitably pop up
Diffstat (limited to 'src/dv/dv.h')
-rw-r--r--src/dv/dv.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/dv/dv.h b/src/dv/dv.h
index f18819a3a..f80ecd4ed 100644
--- a/src/dv/dv.h
+++ b/src/dv/dv.h
@@ -29,8 +29,9 @@
29#include "gnunet_common.h" 29#include "gnunet_common.h"
30 30
31#define DEBUG_DV_GOSSIP GNUNET_NO 31#define DEBUG_DV_GOSSIP GNUNET_NO
32#define DEBUG_DV_GOSSIP_SEND GNUNET_YES
32#define DEBUG_DV_GOSSIP_RECEIPT GNUNET_YES 33#define DEBUG_DV_GOSSIP_RECEIPT GNUNET_YES
33#define DEBUG_DV GNUNET_NO 34#define DEBUG_DV GNUNET_YES
34#define DEBUG_DV_API GNUNET_YES 35#define DEBUG_DV_API GNUNET_YES
35 36
36typedef void (*GNUNET_DV_MessageReceivedHandler) (void *cls, 37typedef void (*GNUNET_DV_MessageReceivedHandler) (void *cls,
@@ -112,6 +113,27 @@ struct GNUNET_DV_ConnectMessage
112 113
113}; 114};
114 115
116/**
117 * Message to return result from a send attempt
118 */
119struct GNUNET_DV_SendResultMessage
120{
121 /**
122 * Type: GNUNET_MESSAGE_TYPE_DV_SEND_RESULT
123 */
124 struct GNUNET_MessageHeader header;
125
126 /**
127 * Unique ID for attempted sent message.
128 */
129 uint32_t uid;
130
131 /**
132 * Result of attempted send, 0 for send okay,
133 * 1 for failure of any reason.
134 */
135 uint32_t result;
136};
115 137
116/** 138/**
117 * Message to send a message over DV via a specific peer 139 * Message to send a message over DV via a specific peer
@@ -139,6 +161,11 @@ struct GNUNET_DV_SendMessage
139 uint32_t priority; 161 uint32_t priority;
140 162
141 /** 163 /**
164 * Unique ID for this message, for confirm callback.
165 */
166 uint32_t uid;
167
168 /**
142 * How long can we delay sending? 169 * How long can we delay sending?
143 */ 170 */
144 struct GNUNET_TIME_Relative timeout; 171 struct GNUNET_TIME_Relative timeout;
@@ -213,6 +240,21 @@ typedef struct
213 240
214} p2p_dv_MESSAGE_Data; 241} p2p_dv_MESSAGE_Data;
215 242
243/**
244 * Message that gets sent between nodes indicating a peer
245 * was disconnected.
246 */
247typedef struct
248{
249 struct GNUNET_MessageHeader header;
250
251 /**
252 * Identity of neighbor that was disconnected.
253 */
254 uint32_t peer_id GNUNET_PACKED;
255
256} p2p_dv_MESSAGE_Disconnect;
257
216 258
217struct GNUNET_DV_Handle * 259struct GNUNET_DV_Handle *
218GNUNET_DV_connect (struct GNUNET_SCHEDULER_Handle *sched, 260GNUNET_DV_connect (struct GNUNET_SCHEDULER_Handle *sched,