aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/gnunet-peerinfo-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/peerinfo/gnunet-peerinfo-gtk.c')
-rw-r--r--src/peerinfo/gnunet-peerinfo-gtk.c380
1 files changed, 296 insertions, 84 deletions
diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c b/src/peerinfo/gnunet-peerinfo-gtk.c
index 29d0c5ca..f07e2784 100644
--- a/src/peerinfo/gnunet-peerinfo-gtk.c
+++ b/src/peerinfo/gnunet-peerinfo-gtk.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2010, 2012, 2013 Christian Grothoff (and other contributing authors) 3 (C) 2010-2014 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -27,6 +27,7 @@
27#include <gnunet/gnunet_peerinfo_service.h> 27#include <gnunet/gnunet_peerinfo_service.h>
28#include <gnunet/gnunet_transport_service.h> 28#include <gnunet/gnunet_transport_service.h>
29#include <gnunet/gnunet_ats_service.h> 29#include <gnunet/gnunet_ats_service.h>
30#include <gnunet/gnunet_core_service.h>
30#include <gnunet/gnunet_friends_lib.h> 31#include <gnunet/gnunet_friends_lib.h>
31#include "gnunet-peerinfo-gtk-flags.h" 32#include "gnunet-peerinfo-gtk-flags.h"
32 33
@@ -46,54 +47,164 @@ enum PEERINFO_ModelColumns
46 PEERINFO_MC_PEER_IDENTITY_STRING = 0, 47 PEERINFO_MC_PEER_IDENTITY_STRING = 0,
47 48
48 /** 49 /**
50 * A gchararray
51 */
52 PEERINFO_MC_COUNTRY_NAME = 1,
53
54 /**
55 * A GdkPixbuf
56 */
57 PEERINFO_MC_COUNTRY_FLAG = 2,
58
59 /**
49 * A guint 60 * A guint
50 */ 61 */
51 PEERINFO_MC_NUMBER_OF_ADDRESSES = 1, 62 PEERINFO_MC_BANDWIDTH_IN = 3,
63
64 /**
65 * A guint
66 */
67 PEERINFO_MC_BANDWIDTH_OUT = 4,
68
69 /**
70 * A GdkPixbuf
71 */
72 PEERINFO_MC_ATS_CONNECTIVITY_LED = 5,
73
74 /**
75 * A gboolean
76 */
77 PEERINFO_MC_ATS_SELECTED_STATUS = 6,
78
79 /**
80 * A GdkPixbuf
81 */
82 PEERINFO_MC_CORE_CONNECTIVITY_LED = 7,
83
84 /**
85 * A gboolean
86 */
87 PEERINFO_MC_CORE_CONNECTED_STATUS = 8,
88
89 /**
90 * A gboolean
91 */
92 PEERINFO_MC_IS_FRIEND = 9,
93
94 /**
95 * A `struct PeerInfo *`
96 */
97 PEERINFO_MC_PEERINFO = 10,
52 98
53 /** 99 /**
54 * A gchararray 100 * A gchararray
55 */ 101 */
56 PEERINFO_MC_COUNTRY_NAME = 2, 102 PEERINFO_MC_PLUGIN_NAME = 11,
103
104 /**
105 * A gchararray
106 */
107 PEERINFO_MC_ADDRESS_AS_STRING = 12,
57 108
58 /** 109 /**
59 * A GdkPixbuf 110 * A GdkPixbuf
60 */ 111 */
61 PEERINFO_MC_COUNTRY_FLAG = 3, 112 PEERINFO_MC_NEIGHBOUR_CONNECTIVITY_LED = 13,
113
114 /**
115 * A gboolean
116 */
117 PEERINFO_MC_NEIGHBOUR_CONNECTED_STATUS = 14,
62 118
63 /** 119 /**
64 * A guint64 120 * A gchararray
65 */ 121 */
66 PEERINFO_MC_BANDWIDTH_IN = 4, 122 PEERINFO_MC_NEIGHBOUR_CONNECTIVITY_TIMEOUT_AS_STRING = 15,
67 123
68 /** 124 /**
69 * A guint64 125 * A gchararray
70 */ 126 */
71 PEERINFO_MC_BANDWIDTH_OUT = 5, 127 PEERINFO_MC_NEIGHBOUR_STATE_AS_STRING = 16,
72 128
73 /** 129 /**
74 * A gchararray 130 * A gchararray
75 */ 131 */
76 PEERINFO_MC_ADDRESS_AS_STRING = 6, 132 PEERINFO_MC_NEIGHBOUR_STATE_TIMEOUT_AS_STRING = 17,
77 133
78 /** 134 /**
79 * A GdkPixbuf 135 * A GdkPixbuf
80 */ 136 */
81 PEERINFO_MC_CONNECTIVITY_LED = 7, 137 PEERINFO_MC_VALIDATION_STATE_LED = 18,
82 138
83 /** 139 /**
84 * A gboolean 140 * A gboolean
85 */ 141 */
86 PEERINFO_MC_CONNECTED_STATUS = 8, 142 PEERINFO_MC_VALIDATION_IS_VALID = 19,
143
144 /**
145 * A gchararray
146 */
147 PEERINFO_MC_VALIDATION_TIMEOUT_AS_STRING = 20,
87 148
88 /** 149 /**
89 * A gboolean 150 * A gboolean
90 */ 151 */
91 PEERINFO_MC_IS_FRIEND = 9, 152 PEERINFO_MC_PLUGIN_CONNECTIVITY_LED = 21,
92 153
93 /** 154 /**
94 * A `struct PeerInfo *` 155 * A gboolean
156 */
157 PEERINFO_MC_PLUGIN_CONNECTIVITY_STATUS = 22,
158
159 /**
160 * A gchararray
161 */
162 PEERINFO_MC_PLUGIN_CONNECTIVITY_TIMEOUT_AS_STRING = 23,
163
164 /**
165 * A gboolean
166 */
167 PEERINFO_MC_SHOW_FRIEND = 24
168
169};
170
171
172/**
173 * Information about an address of the peer.
174 */
175struct PeerAddress
176{
177
178 /**
179 * DLL.
180 */
181 struct PeerAddress *next;
182
183 /**
184 * DLL.
185 */
186 struct PeerAddress *prev;
187
188 /**
189 * Reference to the peer in the view.
190 */
191 GtkTreeRowReference *rr;
192
193 /**
194 * Handle for address to string conversion.
195 */
196 struct GNUNET_TRANSPORT_AddressToStringContext *tos;
197
198 /**
199 * Binary address, allocated at the end of the struct.
200 */
201 const void *addr;
202
203 /**
204 * Number of bytes in @e addr.
95 */ 205 */
96 PEERINFO_MC_PEERINFO = 10 206 size_t addr_len;
207
97}; 208};
98 209
99 210
@@ -113,19 +224,20 @@ struct PeerInfo
113 struct GNUNET_TRANSPORT_PeerIterateContext *palc; 224 struct GNUNET_TRANSPORT_PeerIterateContext *palc;
114 225
115 /** 226 /**
116 * Handle for address to string conversion.
117 */
118 struct GNUNET_TRANSPORT_AddressToStringContext *tos;
119
120 /**
121 * Identity of the peer for this entry. 227 * Identity of the peer for this entry.
122 */ 228 */
123 struct GNUNET_PeerIdentity pid; 229 struct GNUNET_PeerIdentity pid;
124 230
125 /** 231 /**
126 * Did we get any address? 232 * Head of DLL with addresses of this peer.
127 */ 233 */
128 int got_address; 234 struct PeerAddress *pa_head;
235
236 /**
237 * Tail of DLL with addresses of this peer.
238 */
239 struct PeerAddress *pa_tail;
240
129}; 241};
130 242
131 243
@@ -150,6 +262,21 @@ static struct GNUNET_ATS_PerformanceHandle *ats;
150static struct GNUNET_CONTAINER_MultiPeerMap *peer2info; 262static struct GNUNET_CONTAINER_MultiPeerMap *peer2info;
151 263
152/** 264/**
265 * Monitoring transport neighbours
266 */
267static struct GNUNET_TRANSPORT_PeerMonitoringContext *pmc;
268
269/**
270 * Monitoring transport validation operations.
271 */
272static struct GNUNET_TRANSPORT_ValidationMonitoringContext *vmc;
273
274/**
275 * Monitoring core connectivity.
276 */
277static struct GNUNET_CORE_Handle *core;
278
279/**
153 * Should gnunet-peerinfo-gtk start in tray mode? 280 * Should gnunet-peerinfo-gtk start in tray mode?
154 */ 281 */
155static int tray_only; 282static int tray_only;
@@ -204,12 +331,12 @@ get_object (const char *name)
204 331
205 332
206/** 333/**
207 * Function called on each entry in the 'peer2info' map 334 * Function called on each entry in the #peer2info map
208 * to free the associated path. 335 * to free the associated path.
209 * 336 *
210 * @param cls unused 337 * @param cls unused
211 * @param key peer identity 338 * @param key peer identity
212 * @param value the 'struct PeerInfo' 339 * @param value the `struct PeerInfo`
213 * @return #GNUNET_OK (continue to iterate) 340 * @return #GNUNET_OK (continue to iterate)
214 */ 341 */
215static int 342static int
@@ -218,16 +345,25 @@ free_paths (void *cls,
218 void *value) 345 void *value)
219{ 346{
220 struct PeerInfo *info = value; 347 struct PeerInfo *info = value;
348 struct PeerAddress *pa;
221 349
222 if (NULL != info->palc) 350 if (NULL != info->palc)
223 { 351 {
224 GNUNET_TRANSPORT_peer_get_active_addresses_cancel (info->palc); 352 GNUNET_TRANSPORT_peer_get_active_addresses_cancel (info->palc);
225 info->palc = NULL; 353 info->palc = NULL;
226 } 354 }
227 if (NULL != info->tos) 355 while (NULL != (pa = info->pa_head))
228 { 356 {
229 GNUNET_TRANSPORT_address_to_string_cancel (info->tos); 357 GNUNET_CONTAINER_DLL_remove (info->pa_head,
230 info->tos = NULL; 358 info->pa_tail,
359 pa);
360 if (NULL != pa->tos)
361 {
362 GNUNET_TRANSPORT_address_to_string_cancel (pa->tos);
363 pa->tos = NULL;
364 }
365 gtk_tree_row_reference_free (pa->rr);
366 GNUNET_free (pa);
231 } 367 }
232 gtk_tree_row_reference_free (info->rr); 368 gtk_tree_row_reference_free (info->rr);
233 GNUNET_free (info); 369 GNUNET_free (info);
@@ -242,7 +378,8 @@ free_paths (void *cls,
242 * @param tc scheduler context, unused 378 * @param tc scheduler context, unused
243 */ 379 */
244static void 380static void
245shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 381shutdown_task (void *cls,
382 const struct GNUNET_SCHEDULER_TaskContext *tc)
246{ 383{
247 GNUNET_GTK_tray_icon_destroy (); 384 GNUNET_GTK_tray_icon_destroy ();
248 GNUNET_GTK_main_loop_quit (ml); 385 GNUNET_GTK_main_loop_quit (ml);
@@ -257,6 +394,21 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
257 GNUNET_ATS_performance_done (ats); 394 GNUNET_ATS_performance_done (ats);
258 ats = NULL; 395 ats = NULL;
259 } 396 }
397 if (NULL != pmc)
398 {
399 GNUNET_TRANSPORT_monitor_peers_cancel (pmc);
400 pmc = NULL;
401 }
402 if (NULL != vmc)
403 {
404 GNUNET_TRANSPORT_monitor_validation_entries_cancel (vmc);
405 vmc = NULL;
406 }
407 if (NULL != core)
408 {
409 GNUNET_CORE_disconnect (core);
410 core = NULL;
411 }
260 GNUNET_CONTAINER_multipeermap_iterate (peer2info, &free_paths, NULL); 412 GNUNET_CONTAINER_multipeermap_iterate (peer2info, &free_paths, NULL);
261 GNUNET_CONTAINER_multipeermap_destroy (peer2info); 413 GNUNET_CONTAINER_multipeermap_destroy (peer2info);
262 peer2info = NULL; 414 peer2info = NULL;
@@ -264,43 +416,32 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
264} 416}
265 417
266 418
267
268/** 419/**
269 * Function to call with the text format of an address 420 * Function to call with the text format of an address
270 * 421 *
271 * @param cls the 'struct PeerInfo' for which this is a valid address 422 * @param cls the `struct PeerAddress` for the address
272 * @param address address as a string, NULL on error 423 * @param address address as a string, NULL on error
273 */ 424 */
274static void 425static void
275peer_address_string_cb (void *cls, const char *address) 426peer_address_string_cb (void *cls,
427 const char *address)
276{ 428{
277 struct PeerInfo *info = cls; 429 struct PeerAddress *pa = cls;
278 GtkTreeIter iter; 430 GtkTreeIter iter;
279 GtkTreePath *path; 431 GtkTreePath *path;
280 char *country; 432 char *country;
281 const char *colon; 433 const char *colon;
282 const char *dot; 434 const char *dot;
283 435
284 path = gtk_tree_row_reference_get_path (info->rr);
285 GNUNET_assert (NULL != path);
286 GNUNET_assert (TRUE == gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), &iter, path));
287 gtk_tree_path_free (path);
288 if (NULL == address) 436 if (NULL == address)
289 { 437 {
290 /* error */
291 if (GNUNET_NO == info->got_address)
292 gtk_list_store_set (ls, &iter,
293 PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 1,
294 PEERINFO_MC_COUNTRY_NAME, NULL,
295 PEERINFO_MC_COUNTRY_FLAG, NULL,
296 PEERINFO_MC_ADDRESS_AS_STRING, "<no address>",
297 PEERINFO_MC_CONNECTIVITY_LED, led_green,
298 PEERINFO_MC_CONNECTED_STATUS, TRUE,
299 -1);
300 info->tos = NULL; 438 info->tos = NULL;
301 return; 439 return;
302 } 440 }
303 /* last address, store information in model */ 441 path = gtk_tree_row_reference_get_path (info->rr);
442 GNUNET_assert (NULL != path);
443 GNUNET_assert (gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), &iter, path));
444 gtk_tree_path_free (path);
304 country = NULL; 445 country = NULL;
305 colon = strstr (address, ":"); 446 colon = strstr (address, ":");
306 if (NULL != colon) 447 if (NULL != colon)
@@ -312,15 +453,11 @@ peer_address_string_cb (void *cls, const char *address)
312 country = GNUNET_strndup (&dot[1], (colon - dot) - 1); 453 country = GNUNET_strndup (&dot[1], (colon - dot) - 1);
313 } 454 }
314 gtk_list_store_set (ls, &iter, 455 gtk_list_store_set (ls, &iter,
315 PEERINFO_MC_NUMBER_OF_ADDRESSES, 1,
316 PEERINFO_MC_COUNTRY_NAME, country, 456 PEERINFO_MC_COUNTRY_NAME, country,
317 PEERINFO_MC_COUNTRY_FLAG, GNUNET_PEERINFO_GTK_get_flag (country), 457 PEERINFO_MC_COUNTRY_FLAG, GNUNET_PEERINFO_GTK_get_flag (country),
318 PEERINFO_MC_ADDRESS_AS_STRING, address, 458 PEERINFO_MC_ADDRESS_AS_STRING, address,
319 PEERINFO_MC_CONNECTIVITY_LED, led_green,
320 PEERINFO_MC_CONNECTED_STATUS, TRUE,
321 -1); 459 -1);
322 GNUNET_free_non_null (country); 460 GNUNET_free_non_null (country);
323 info->got_address = GNUNET_YES;
324} 461}
325 462
326 463
@@ -337,36 +474,36 @@ peer_address_cb (void *cls,
337 const struct GNUNET_HELLO_Address *address) 474 const struct GNUNET_HELLO_Address *address)
338{ 475{
339 struct PeerInfo *info = cls; 476 struct PeerInfo *info = cls;
477 struct PeerAddress *pa;
340 GtkTreeIter iter; 478 GtkTreeIter iter;
341 GtkTreePath *path; 479 GtkTreePath *path;
342 480
343 path = gtk_tree_row_reference_get_path (info->rr); 481 path = gtk_tree_row_reference_get_path (info->rr);
344 GNUNET_assert (NULL != path); 482 GNUNET_assert (NULL != path);
345 GNUNET_assert (TRUE == gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), &iter, path)); 483 GNUNET_assert (gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), &iter, path));
346 gtk_tree_path_free (path); 484 gtk_tree_path_free (path);
347 if (NULL == address) 485 if (NULL == address)
348 { 486 {
349 /* disconnect */ 487 /* disconnect */
350 gtk_list_store_set (ls, &iter, 488 gtk_list_store_set (ls, &iter,
351 PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 0, 489 // PEERINFO_MC_CONNECTIVITY_LED, led_red,
352 PEERINFO_MC_CONNECTIVITY_LED, led_red, 490 // PEERINFO_MC_CONNECTED_STATUS, FALSE,
353 PEERINFO_MC_CONNECTED_STATUS, FALSE,
354 -1); 491 -1);
355 return; 492 return;
356 } 493 }
357 gtk_list_store_set (ls, &iter, 494 gtk_list_store_set (ls, &iter,
358 PEERINFO_MC_NUMBER_OF_ADDRESSES, 1, 495 // PEERINFO_MC_CONNECTIVITY_LED, led_green,
359 PEERINFO_MC_CONNECTIVITY_LED, led_green, 496 // PEERINFO_MC_CONNECTED_STATUS, TRUE,
360 PEERINFO_MC_CONNECTED_STATUS, TRUE,
361 -1); 497 -1);
498#if 0
362 if (NULL != info->tos) 499 if (NULL != info->tos)
363 GNUNET_TRANSPORT_address_to_string_cancel (info->tos); 500 GNUNET_TRANSPORT_address_to_string_cancel (info->tos);
364 info->got_address = GNUNET_NO; 501 pa->tos =
365 info->tos = 502 GNUNET_TRANSPORT_address_to_string (get_configuration (), address,
366 GNUNET_TRANSPORT_address_to_string (get_configuration (), address, 503 GNUNET_NO,
367 GNUNET_NO, 504 GNUNET_TIME_UNIT_FOREVER_REL,
368 GNUNET_TIME_UNIT_FOREVER_REL, 505 &peer_address_string_cb, pa);
369 &peer_address_string_cb, info); 506#endif
370} 507}
371 508
372 509
@@ -396,14 +533,10 @@ peerinfo_processor (void *cls,
396 gtk_list_store_append (ls, &iter); 533 gtk_list_store_append (ls, &iter);
397 gtk_list_store_set (ls, &iter, 534 gtk_list_store_set (ls, &iter,
398 PEERINFO_MC_PEER_IDENTITY_STRING, GNUNET_i2s (peer), 535 PEERINFO_MC_PEER_IDENTITY_STRING, GNUNET_i2s (peer),
399 PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 0,
400 PEERINFO_MC_COUNTRY_NAME, "", 536 PEERINFO_MC_COUNTRY_NAME, "",
401 PEERINFO_MC_COUNTRY_FLAG, NULL, 537 PEERINFO_MC_COUNTRY_FLAG, NULL,
402 PEERINFO_MC_BANDWIDTH_IN, (guint64) 0, 538 PEERINFO_MC_BANDWIDTH_IN, (guint) 0,
403 PEERINFO_MC_BANDWIDTH_OUT, (guint64) 0, 539 PEERINFO_MC_BANDWIDTH_OUT, (guint) 0,
404 PEERINFO_MC_ADDRESS_AS_STRING, "",
405 PEERINFO_MC_CONNECTIVITY_LED, led_red,
406 PEERINFO_MC_CONNECTED_STATUS, FALSE,
407 PEERINFO_MC_IS_FRIEND, GNUNET_CONTAINER_multipeermap_contains (friends, 540 PEERINFO_MC_IS_FRIEND, GNUNET_CONTAINER_multipeermap_contains (friends,
408 peer), 541 peer),
409 PEERINFO_MC_PEERINFO, info, 542 PEERINFO_MC_PEERINFO, info,
@@ -542,8 +675,7 @@ GNUNET_PEERINFO_GTK_main_window_friends_cellrenderertoggle_toggled_cb (GtkCellRe
542 GNUNET_break (0); 675 GNUNET_break (0);
543 return; 676 return;
544 } 677 }
545 if (TRUE != 678 if (! gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ls), &old, path))
546 gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ls), &old, path))
547 { 679 {
548 GNUNET_break (0); 680 GNUNET_break (0);
549 return; 681 return;
@@ -629,6 +761,73 @@ add_friend (void *cls,
629 761
630 762
631/** 763/**
764 * Function to call with information about a peer
765 *
766 * @param cls closure
767 * @param peer peer this update is about,
768 * NULL if this is the final last callback for a iteration operation
769 * @param address address, NULL for disconnect notification in monitor mode
770 * @param state current state this peer is in
771 * @param state_timeout timeout for the current state of the peer
772 */
773static void
774transport_peer_cb (void *cls,
775 const struct GNUNET_PeerIdentity *peer,
776 const struct GNUNET_HELLO_Address *address,
777 enum GNUNET_TRANSPORT_PeerState state,
778 struct GNUNET_TIME_Absolute state_timeout)
779{
780}
781
782
783/**
784 * Function to call with validation information about a peer
785 *
786 * @param cls closure
787 * @param peer peer this update is about,
788 * NULL if this is the final last callback for a iteration operation
789 * @param address address, NULL for disconnect notification in monitor mode
790 * @param valid_until when does this address expire
791 * @param next_validation time of the next validation operation
792 *
793 */
794static void
795validation_monitor_cb (void *cls,
796 const struct GNUNET_PeerIdentity *peer,
797 const struct GNUNET_HELLO_Address *address,
798 struct GNUNET_TIME_Absolute valid_until,
799 struct GNUNET_TIME_Absolute next_validation)
800{
801}
802
803
804/**
805 * Method called whenever a given peer connects.
806 *
807 * @param cls closure
808 * @param peer peer identity this notification is about
809 */
810static void
811handle_core_connect (void *cls,
812 const struct GNUNET_PeerIdentity *peer)
813{
814}
815
816
817/**
818 * Method called whenever a peer disconnects.
819 *
820 * @param cls closure
821 * @param peer peer identity this notification is about
822 */
823static void
824handle_core_disconnect (void *cls,
825 const struct GNUNET_PeerIdentity *peer)
826{
827}
828
829
830/**
632 * Actual main function run right after GNUnet's scheduler 831 * Actual main function run right after GNUnet's scheduler
633 * is initialized. Initializes up GTK and Glade. 832 * is initialized. Initializes up GTK and Glade.
634 * 833 *
@@ -636,7 +835,8 @@ add_friend (void *cls,
636 * @param tc schedule context 835 * @param tc schedule context
637 */ 836 */
638static void 837static void
639run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 838run (void *cls,
839 const struct GNUNET_SCHEDULER_TaskContext *tc)
640{ 840{
641 GtkWidget *main_window; 841 GtkWidget *main_window;
642 842
@@ -656,17 +856,29 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
656 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 856 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
657 _("Failed to parse list of friends\n")); 857 _("Failed to parse list of friends\n"));
658 peer2info = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO); 858 peer2info = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO);
659 pnc = 859 core = GNUNET_CORE_connect (get_configuration (),
660 GNUNET_PEERINFO_notify (get_configuration (), 860 NULL,
661 GNUNET_NO, 861 NULL,
662 &peerinfo_processor, NULL); 862 &handle_core_connect,
663 if (NULL == pnc) 863 &handle_core_disconnect,
664 { 864 NULL, GNUNET_NO,
665 fprintf (stderr, 865 NULL, GNUNET_NO,
666 _("Failed to initialize communication with peerinfo service!\n")); 866 NULL);
667 GNUNET_SCHEDULER_shutdown (); 867 pnc = GNUNET_PEERINFO_notify (get_configuration (),
668 return; 868 GNUNET_NO,
669 } 869 &peerinfo_processor, NULL);
870 pmc = GNUNET_TRANSPORT_monitor_peers (get_configuration (),
871 NULL,
872 GNUNET_NO,
873 GNUNET_TIME_UNIT_FOREVER_REL,
874 &transport_peer_cb,
875 NULL);
876 vmc = GNUNET_TRANSPORT_monitor_validation_entries (get_configuration (),
877 NULL,
878 GNUNET_NO,
879 GNUNET_TIME_UNIT_FOREVER_REL,
880 &validation_monitor_cb,
881 NULL);
670 ats = GNUNET_ATS_performance_init (get_configuration (), &status_cb, NULL); 882 ats = GNUNET_ATS_performance_init (get_configuration (), &status_cb, NULL);
671 /* setup main window */ 883 /* setup main window */
672 main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window")); 884 main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window"));