diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-04-30 14:50:06 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-04-30 14:50:06 +0000 |
commit | 5f9efe3ff20656b7900fc0b503f3e0cbe75eb20a (patch) | |
tree | a6f379dfd9dafc1db1fa95260ab7029f15a9b283 /src/dv/dv.h | |
parent | e6b08db0728b172da76392967661c09e7bfdbb55 (diff) |
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.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/dv/dv.h b/src/dv/dv.h index f18819a3ae..f80ecd4ed9 100644 --- a/src/dv/dv.h +++ b/src/dv/dv.h @@ -29,8 +29,9 @@ #include "gnunet_common.h" #define DEBUG_DV_GOSSIP GNUNET_NO +#define DEBUG_DV_GOSSIP_SEND GNUNET_YES #define DEBUG_DV_GOSSIP_RECEIPT GNUNET_YES -#define DEBUG_DV GNUNET_NO +#define DEBUG_DV GNUNET_YES #define DEBUG_DV_API GNUNET_YES typedef void (*GNUNET_DV_MessageReceivedHandler) (void *cls, @@ -112,6 +113,27 @@ struct GNUNET_DV_ConnectMessage }; +/** + * Message to return result from a send attempt + */ +struct GNUNET_DV_SendResultMessage +{ + /** + * Type: GNUNET_MESSAGE_TYPE_DV_SEND_RESULT + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for attempted sent message. + */ + uint32_t uid; + + /** + * Result of attempted send, 0 for send okay, + * 1 for failure of any reason. + */ + uint32_t result; +}; /** * Message to send a message over DV via a specific peer @@ -139,6 +161,11 @@ struct GNUNET_DV_SendMessage uint32_t priority; /** + * Unique ID for this message, for confirm callback. + */ + uint32_t uid; + + /** * How long can we delay sending? */ struct GNUNET_TIME_Relative timeout; @@ -213,6 +240,21 @@ typedef struct } p2p_dv_MESSAGE_Data; +/** + * Message that gets sent between nodes indicating a peer + * was disconnected. + */ +typedef struct +{ + struct GNUNET_MessageHeader header; + + /** + * Identity of neighbor that was disconnected. + */ + uint32_t peer_id GNUNET_PACKED; + +} p2p_dv_MESSAGE_Disconnect; + struct GNUNET_DV_Handle * GNUNET_DV_connect (struct GNUNET_SCHEDULER_Handle *sched, |