diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-11-13 20:37:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-11-13 20:37:37 +0000 |
commit | db6c313c75a36bc4a27971d7bd8da3e938c7c02a (patch) | |
tree | ea4dac1648edb33ccafb1b12652236261f538abd /src/dv | |
parent | 56f7c4934c0d9c18370fdcff5e5a3cd29363d474 (diff) | |
download | gnunet-db6c313c75a36bc4a27971d7bd8da3e938c7c02a.tar.gz gnunet-db6c313c75a36bc4a27971d7bd8da3e938c7c02a.zip |
the big core API/protocol change, breaks all testcases using core, since the code is still buggy
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/Makefile.am | 2 | ||||
-rw-r--r-- | src/dv/gnunet-service-dv.c | 76 |
2 files changed, 39 insertions, 39 deletions
diff --git a/src/dv/Makefile.am b/src/dv/Makefile.am index af3102239..de72438d7 100644 --- a/src/dv/Makefile.am +++ b/src/dv/Makefile.am | |||
@@ -28,7 +28,7 @@ libgnunetdv_la_LDFLAGS = \ | |||
28 | 28 | ||
29 | bin_PROGRAMS = \ | 29 | bin_PROGRAMS = \ |
30 | gnunet-service-dv | 30 | gnunet-service-dv |
31 | 31 | ||
32 | gnunet_service_dv_SOURCES = \ | 32 | gnunet_service_dv_SOURCES = \ |
33 | gnunet-service-dv.c | 33 | gnunet-service-dv.c |
34 | gnunet_service_dv_LDADD = \ | 34 | gnunet_service_dv_LDADD = \ |
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 6001e33f4..d3897f23d 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -1311,11 +1311,11 @@ void send_message_delayed (void *cls, | |||
1311 | * @param latency the latency of the connection we received the message from | 1311 | * @param latency the latency of the connection we received the message from |
1312 | * @param distance the distance to the immediate peer | 1312 | * @param distance the distance to the immediate peer |
1313 | */ | 1313 | */ |
1314 | static int handle_dv_data_message (void *cls, | 1314 | static int |
1315 | const struct GNUNET_PeerIdentity * peer, | 1315 | handle_dv_data_message (void *cls, |
1316 | const struct GNUNET_MessageHeader * message, | 1316 | const struct GNUNET_PeerIdentity * peer, |
1317 | struct GNUNET_TIME_Relative latency, | 1317 | const struct GNUNET_MessageHeader * message, |
1318 | uint32_t distance) | 1318 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
1319 | { | 1319 | { |
1320 | const p2p_dv_MESSAGE_Data *incoming = (const p2p_dv_MESSAGE_Data *) message; | 1320 | const p2p_dv_MESSAGE_Data *incoming = (const p2p_dv_MESSAGE_Data *) message; |
1321 | const struct GNUNET_MessageHeader *packed_message; | 1321 | const struct GNUNET_MessageHeader *packed_message; |
@@ -1919,14 +1919,12 @@ void handle_dv_send_message (void *cls, | |||
1919 | static int handle_dv_gossip_message (void *cls, | 1919 | static int handle_dv_gossip_message (void *cls, |
1920 | const struct GNUNET_PeerIdentity *peer, | 1920 | const struct GNUNET_PeerIdentity *peer, |
1921 | const struct GNUNET_MessageHeader *message, | 1921 | const struct GNUNET_MessageHeader *message, |
1922 | struct GNUNET_TIME_Relative latency, | 1922 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
1923 | uint32_t distance); | ||
1924 | 1923 | ||
1925 | static int handle_dv_disconnect_message (void *cls, | 1924 | static int handle_dv_disconnect_message (void *cls, |
1926 | const struct GNUNET_PeerIdentity *peer, | 1925 | const struct GNUNET_PeerIdentity *peer, |
1927 | const struct GNUNET_MessageHeader *message, | 1926 | const struct GNUNET_MessageHeader *message, |
1928 | struct GNUNET_TIME_Relative latency, | 1927 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
1929 | uint32_t distance); | ||
1930 | /** End forward declarations **/ | 1928 | /** End forward declarations **/ |
1931 | 1929 | ||
1932 | 1930 | ||
@@ -2327,7 +2325,8 @@ generate_hello_address (void *cls, size_t max, void *buf) | |||
2327 | * not added) | 2325 | * not added) |
2328 | */ | 2326 | */ |
2329 | static struct DistantNeighbor * | 2327 | static struct DistantNeighbor * |
2330 | addUpdateNeighbor (const struct GNUNET_PeerIdentity * peer, struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pkey, | 2328 | addUpdateNeighbor (const struct GNUNET_PeerIdentity * peer, |
2329 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pkey, | ||
2331 | unsigned int referrer_peer_id, | 2330 | unsigned int referrer_peer_id, |
2332 | struct DirectNeighbor *referrer, unsigned int cost) | 2331 | struct DirectNeighbor *referrer, unsigned int cost) |
2333 | { | 2332 | { |
@@ -2466,7 +2465,10 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity * peer, struct GNUNET_CRYPTO | |||
2466 | #if DEBUG_DV_MESSAGES | 2465 | #if DEBUG_DV_MESSAGES |
2467 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: learned about peer %llu from which we have a previous unknown message, processing!\n", my_short_id, referrer_peer_id); | 2466 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: learned about peer %llu from which we have a previous unknown message, processing!\n", my_short_id, referrer_peer_id); |
2468 | #endif | 2467 | #endif |
2469 | handle_dv_data_message(NULL, &referrer->pending_messages[i].sender, referrer->pending_messages[i].message, referrer->pending_messages[i].latency, referrer->pending_messages[i].distance); | 2468 | handle_dv_data_message(NULL, &referrer->pending_messages[i].sender, |
2469 | referrer->pending_messages[i].message, | ||
2470 | referrer->pending_messages[i].latency, | ||
2471 | referrer->pending_messages[i].distance); | ||
2470 | GNUNET_free(referrer->pending_messages[i].message); | 2472 | GNUNET_free(referrer->pending_messages[i].message); |
2471 | referrer->pending_messages[i].sender_id = 0; | 2473 | referrer->pending_messages[i].sender_id = 0; |
2472 | } | 2474 | } |
@@ -2521,14 +2523,12 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity * peer, struct GNUNET_CRYPTO | |||
2521 | * @param cls closure | 2523 | * @param cls closure |
2522 | * @param peer peer which sent the message (immediate sender) | 2524 | * @param peer peer which sent the message (immediate sender) |
2523 | * @param message the message | 2525 | * @param message the message |
2524 | * @param latency the latency of the connection we received the message from | 2526 | * @param atsi performance data |
2525 | * @param distance the distance to the immediate peer | ||
2526 | */ | 2527 | */ |
2527 | static int handle_dv_disconnect_message (void *cls, | 2528 | static int handle_dv_disconnect_message (void *cls, |
2528 | const struct GNUNET_PeerIdentity *peer, | 2529 | const struct GNUNET_PeerIdentity *peer, |
2529 | const struct GNUNET_MessageHeader *message, | 2530 | const struct GNUNET_MessageHeader *message, |
2530 | struct GNUNET_TIME_Relative latency, | 2531 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
2531 | uint32_t distance) | ||
2532 | { | 2532 | { |
2533 | struct DirectNeighbor *referrer; | 2533 | struct DirectNeighbor *referrer; |
2534 | struct DistantNeighbor *distant; | 2534 | struct DistantNeighbor *distant; |
@@ -2570,14 +2570,13 @@ static int handle_dv_disconnect_message (void *cls, | |||
2570 | * @param cls closure | 2570 | * @param cls closure |
2571 | * @param peer peer which sent the message (immediate sender) | 2571 | * @param peer peer which sent the message (immediate sender) |
2572 | * @param message the message | 2572 | * @param message the message |
2573 | * @param latency the latency of the connection we received the message from | 2573 | * @param atsi performance data |
2574 | * @param distance the distance to the immediate peer | ||
2575 | */ | 2574 | */ |
2576 | static int handle_dv_gossip_message (void *cls, | 2575 | static int |
2577 | const struct GNUNET_PeerIdentity *peer, | 2576 | handle_dv_gossip_message (void *cls, |
2578 | const struct GNUNET_MessageHeader *message, | 2577 | const struct GNUNET_PeerIdentity *peer, |
2579 | struct GNUNET_TIME_Relative latency, | 2578 | const struct GNUNET_MessageHeader *message, |
2580 | uint32_t distance) | 2579 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
2581 | { | 2580 | { |
2582 | struct DirectNeighbor *referrer; | 2581 | struct DirectNeighbor *referrer; |
2583 | p2p_dv_MESSAGE_NeighborInfo *enc_message = (p2p_dv_MESSAGE_NeighborInfo *)message; | 2582 | p2p_dv_MESSAGE_NeighborInfo *enc_message = (p2p_dv_MESSAGE_NeighborInfo *)message; |
@@ -2623,9 +2622,10 @@ static int handle_dv_gossip_message (void *cls, | |||
2623 | * | 2622 | * |
2624 | * @return GNUNET_YES to continue iteration, GNUNET_NO otherwise | 2623 | * @return GNUNET_YES to continue iteration, GNUNET_NO otherwise |
2625 | */ | 2624 | */ |
2626 | static int add_all_extended_peers (void *cls, | 2625 | static int |
2627 | const GNUNET_HashCode * key, | 2626 | add_all_extended_peers (void *cls, |
2628 | void *value) | 2627 | const GNUNET_HashCode * key, |
2628 | void *value) | ||
2629 | { | 2629 | { |
2630 | struct NeighborSendContext *send_context = (struct NeighborSendContext *)cls; | 2630 | struct NeighborSendContext *send_context = (struct NeighborSendContext *)cls; |
2631 | struct DistantNeighbor *distant = (struct DistantNeighbor *)value; | 2631 | struct DistantNeighbor *distant = (struct DistantNeighbor *)value; |
@@ -2660,9 +2660,10 @@ static int add_all_extended_peers (void *cls, | |||
2660 | * iterate, | 2660 | * iterate, |
2661 | * GNUNET_NO if not. | 2661 | * GNUNET_NO if not. |
2662 | */ | 2662 | */ |
2663 | static int gossip_all_to_all_iterator (void *cls, | 2663 | static int |
2664 | const GNUNET_HashCode * key, | 2664 | gossip_all_to_all_iterator (void *cls, |
2665 | void *abs_value) | 2665 | const GNUNET_HashCode * key, |
2666 | void *abs_value) | ||
2666 | { | 2667 | { |
2667 | struct DirectNeighbor *direct = abs_value; | 2668 | struct DirectNeighbor *direct = abs_value; |
2668 | 2669 | ||
@@ -2704,9 +2705,10 @@ gossip_all_to_all (void *cls, | |||
2704 | * | 2705 | * |
2705 | * @return GNUNET_YES to continue iteration, GNUNET_NO otherwise | 2706 | * @return GNUNET_YES to continue iteration, GNUNET_NO otherwise |
2706 | */ | 2707 | */ |
2707 | static int add_all_direct_neighbors (void *cls, | 2708 | static int |
2708 | const GNUNET_HashCode * key, | 2709 | add_all_direct_neighbors (void *cls, |
2709 | void *value) | 2710 | const GNUNET_HashCode * key, |
2711 | void *value) | ||
2710 | { | 2712 | { |
2711 | struct DirectNeighbor *direct = (struct DirectNeighbor *)value; | 2713 | struct DirectNeighbor *direct = (struct DirectNeighbor *)value; |
2712 | struct DirectNeighbor *to = (struct DirectNeighbor *)cls; | 2714 | struct DirectNeighbor *to = (struct DirectNeighbor *)cls; |
@@ -2832,13 +2834,12 @@ process_peerinfo (void *cls, | |||
2832 | * | 2834 | * |
2833 | * @param cls closure | 2835 | * @param cls closure |
2834 | * @param peer peer identity this notification is about | 2836 | * @param peer peer identity this notification is about |
2835 | * @param latency reported latency of the connection with peer | 2837 | * @param atsi performance data |
2836 | * @param distance reported distance (DV) to peer | ||
2837 | */ | 2838 | */ |
2838 | void handle_core_connect (void *cls, | 2839 | static void |
2839 | const struct GNUNET_PeerIdentity * peer, | 2840 | handle_core_connect (void *cls, |
2840 | struct GNUNET_TIME_Relative latency, | 2841 | const struct GNUNET_PeerIdentity * peer, |
2841 | uint32_t distance) | 2842 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
2842 | { | 2843 | { |
2843 | struct DirectNeighbor *neighbor; | 2844 | struct DirectNeighbor *neighbor; |
2844 | struct DistantNeighbor *about; | 2845 | struct DistantNeighbor *about; |
@@ -2994,7 +2995,6 @@ run (void *cls, | |||
2994 | coreAPI = | 2995 | coreAPI = |
2995 | GNUNET_CORE_connect (cfg, | 2996 | GNUNET_CORE_connect (cfg, |
2996 | 1, | 2997 | 1, |
2997 | GNUNET_TIME_relative_get_forever(), | ||
2998 | NULL, /* FIXME: anything we want to pass around? */ | 2998 | NULL, /* FIXME: anything we want to pass around? */ |
2999 | &core_init, | 2999 | &core_init, |
3000 | &handle_core_connect, | 3000 | &handle_core_connect, |