aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api_cmd_start_peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport_api_cmd_start_peer.c')
-rw-r--r--src/transport/transport_api_cmd_start_peer.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c
index 60f416f85..da833f1b1 100644
--- a/src/transport/transport_api_cmd_start_peer.c
+++ b/src/transport/transport_api_cmd_start_peer.c
@@ -126,12 +126,13 @@ notify_connect (void *cls,
126 126
127 void *ret = NULL; 127 void *ret = NULL;
128 128
129
130 LOG (GNUNET_ERROR_TYPE_DEBUG, 129 LOG (GNUNET_ERROR_TYPE_DEBUG,
131 "Peer %s connected to peer %u (`%s')\n", 130 "This Peer %s \n",
132 GNUNET_i2s (peer),
133 sps->no,
134 GNUNET_i2s (&sps->id)); 131 GNUNET_i2s (&sps->id));
132 LOG (GNUNET_ERROR_TYPE_DEBUG,
133 "Peer %s connected to peer number %u\n",
134 GNUNET_i2s (peer),
135 sps->no);
135 136
136 GNUNET_CRYPTO_hash (&public_key, sizeof(public_key), &hc); 137 GNUNET_CRYPTO_hash (&public_key, sizeof(public_key), &hc);
137 138
@@ -216,6 +217,11 @@ start_peer_run (void *cls,
216 "node_ip %s\n", 217 "node_ip %s\n",
217 bindto); 218 bindto);
218 219
220 LOG (GNUNET_ERROR_TYPE_ERROR,
221 "bind_udp %s\n",
222 GNUNET_YES == sps->broadcast ?
223 bindto_udp : bindto);
224
219 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "PATHS", "GNUNET_TEST_HOME", 225 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "PATHS", "GNUNET_TEST_HOME",
220 home); 226 home);
221 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "transport", "UNIXPATH", 227 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "transport", "UNIXPATH",
@@ -225,7 +231,8 @@ start_peer_run (void *cls,
225 bindto); 231 bindto);
226 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-udp", 232 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-udp",
227 "BINDTO", 233 "BINDTO",
228 bindto); 234 GNUNET_YES == sps->broadcast ?
235 bindto_udp : bindto);
229 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-tcp", 236 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-tcp",
230 "UNIXPATH", 237 "UNIXPATH",
231 tcp_communicator_unix_path); 238 tcp_communicator_unix_path);
@@ -571,6 +578,8 @@ GNUNET_TRANSPORT_get_trait_peer_id (const struct
571 * @param local_m Number of local nodes in each namespace. 578 * @param local_m Number of local nodes in each namespace.
572 * @param handlers Handler for messages received by this peer. 579 * @param handlers Handler for messages received by this peer.
573 * @param cfgname Configuration file name for this peer. 580 * @param cfgname Configuration file name for this peer.
581 * @param notify_connect Method which will be called, when a peer connects.
582 * @param broadcast Flag indicating, if broadcast should be switched on.
574 * @return command. 583 * @return command.
575 */ 584 */
576struct GNUNET_TESTING_Command 585struct GNUNET_TESTING_Command
@@ -580,7 +589,8 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
580 char *node_ip, 589 char *node_ip,
581 struct GNUNET_MQ_MessageHandler *handlers, 590 struct GNUNET_MQ_MessageHandler *handlers,
582 const char *cfgname, 591 const char *cfgname,
583 GNUNET_TRANSPORT_NotifyConnect notify_connect) 592 GNUNET_TRANSPORT_NotifyConnect notify_connect,
593 unsigned int broadcast)
584{ 594{
585 struct StartPeerState *sps; 595 struct StartPeerState *sps;
586 struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map = 596 struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map =
@@ -594,6 +604,7 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
594 sps->cfgname = cfgname; 604 sps->cfgname = cfgname;
595 sps->node_ip = node_ip; 605 sps->node_ip = node_ip;
596 sps->notify_connect = notify_connect; 606 sps->notify_connect = notify_connect;
607 sps->broadcast = broadcast;
597 608
598 if (NULL != handlers) 609 if (NULL != handlers)
599 { 610 {