aboutsummaryrefslogtreecommitdiff
path: root/src/multicast
diff options
context:
space:
mode:
Diffstat (limited to 'src/multicast')
-rw-r--r--src/multicast/gnunet-multicast.c18
-rw-r--r--src/multicast/gnunet-service-multicast.c34
-rw-r--r--src/multicast/multicast.conf.in2
-rw-r--r--src/multicast/multicast.h18
-rw-r--r--src/multicast/multicast_api.c18
-rw-r--r--src/multicast/test_multicast.c16
-rw-r--r--src/multicast/test_multicast.conf34
-rw-r--r--src/multicast/test_multicast_2peers.c21
-rw-r--r--src/multicast/test_multicast_line.conf34
-rw-r--r--src/multicast/test_multicast_multipeer.c108
-rw-r--r--src/multicast/test_multicast_star.conf34
11 files changed, 166 insertions, 171 deletions
diff --git a/src/multicast/gnunet-multicast.c b/src/multicast/gnunet-multicast.c
index b37625988..e0902f112 100644
--- a/src/multicast/gnunet-multicast.c
+++ b/src/multicast/gnunet-multicast.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2013 GNUnet e.V. 3 Copyright (C) 2013 GNUnet e.V.
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 it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index e66bacddb..f8441cc2b 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009 GNUnet e.V. 3 Copyright (C) 2009 GNUnet e.V.
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 it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
@@ -1450,12 +1448,16 @@ check_client_member_join (void *cls,
1450 uint16_t msg_size = ntohs (msg->header.size); 1448 uint16_t msg_size = ntohs (msg->header.size);
1451 struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; 1449 struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1];
1452 uint32_t relay_count = ntohl (msg->relay_count); 1450 uint32_t relay_count = ntohl (msg->relay_count);
1453 if (UINT32_MAX / relay_count < sizeof (*relays)){ 1451
1454 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1452 if (0 != relay_count)
1455 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", 1453 {
1456 (unsigned long)relay_count, 1454 if (UINT32_MAX / relay_count < sizeof (*relays)){
1457 sizeof (*relays)); 1455 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1458 return GNUNET_SYSERR; 1456 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n",
1457 (unsigned long)relay_count,
1458 sizeof (*relays));
1459 return GNUNET_SYSERR;
1460 }
1459 } 1461 }
1460 uint32_t relay_size = relay_count * sizeof (*relays); 1462 uint32_t relay_size = relay_count * sizeof (*relays);
1461 struct GNUNET_MessageHeader *join_msg = NULL; 1463 struct GNUNET_MessageHeader *join_msg = NULL;
diff --git a/src/multicast/multicast.conf.in b/src/multicast/multicast.conf.in
index f4a6daa1e..97a541336 100644
--- a/src/multicast/multicast.conf.in
+++ b/src/multicast/multicast.conf.in
@@ -1,5 +1,5 @@
1[multicast] 1[multicast]
2AUTOSTART = @AUTOSTART@ 2START_ON_DEMAND = @START_ON_DEMAND@
3BINARY = gnunet-service-multicast 3BINARY = gnunet-service-multicast
4 4
5UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock 5UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock
diff --git a/src/multicast/multicast.h b/src/multicast/multicast.h
index aeb3c0b41..e95299a5e 100644
--- a/src/multicast/multicast.h
+++ b/src/multicast/multicast.h
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012, 2013 GNUnet e.V. 3 Copyright (C) 2012, 2013 GNUnet e.V.
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 it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/multicast/multicast_api.c b/src/multicast/multicast_api.c
index 3c911f48a..9f8d49253 100644
--- a/src/multicast/multicast_api.c
+++ b/src/multicast/multicast_api.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012, 2013 GNUnet e.V. 3 Copyright (C) 2012, 2013 GNUnet e.V.
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 it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c
index 7e9b51e23..e00f07b51 100644
--- a/src/multicast/test_multicast.c
+++ b/src/multicast/test_multicast.c
@@ -2,20 +2,18 @@
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2013 GNUnet e.V. 3 * Copyright (C) 2013 GNUnet e.V.
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 it
6 * it under the terms of the GNU General Public License as published 6 * under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation; either version 3, or (at your 7 * by the Free Software Foundation, either version 3 of the License,
8 * option) any later version. 8 * or (at your option) any later version.
9 * 9 *
10 * GNUnet is distributed in the hope that it will be useful, but 10 * GNUnet is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details. 13 * Affero General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU Affero General Public License
16 * along with GNUnet; see the file COPYING. If not, write to the 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */ 17 */
20 18
21/** 19/**
diff --git a/src/multicast/test_multicast.conf b/src/multicast/test_multicast.conf
index 1b50e0893..b2f1a764b 100644
--- a/src/multicast/test_multicast.conf
+++ b/src/multicast/test_multicast.conf
@@ -10,7 +10,7 @@ GLOBAL_POSTFIX=-L ERROR
10UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock 10UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock
11 11
12[vpn] 12[vpn]
13AUTOSTART = NO 13START_ON_DEMAND = NO
14 14
15[peerinfo] 15[peerinfo]
16# Do not use shipped gnunet HELLOs 16# Do not use shipped gnunet HELLOs
@@ -21,36 +21,36 @@ USE_INCLUDED_HELLOS = NO
21NO_IO = YES 21NO_IO = YES
22 22
23[hostlist] 23[hostlist]
24FORCESTART = NO 24IMMEDIATE_START = NO
25AUTOSTART = NO 25START_ON_DEMAND = NO
26 26
27[nat] 27[nat]
28ENABLE_UPNP = NO 28ENABLE_UPNP = NO
29 29
30[fs] 30[fs]
31FORCESTART = NO 31IMMEDIATE_START = NO
32AUTOSTART = NO 32START_ON_DEMAND = NO
33 33
34[vpn] 34[vpn]
35FORCESTART = NO 35IMMEDIATE_START = NO
36AUTOSTART = NO 36START_ON_DEMAND = NO
37 37
38[revocation] 38[revocation]
39FORCESTART = NO 39IMMEDIATE_START = NO
40AUTOSTART = NO 40START_ON_DEMAND = NO
41 41
42[gns] 42[gns]
43FORCESTART = NO 43IMMEDIATE_START = NO
44AUTOSTART = NO 44START_ON_DEMAND = NO
45 45
46[namestore] 46[namestore]
47FORCESTART = NO 47IMMEDIATE_START = NO
48AUTOSTART = NO 48START_ON_DEMAND = NO
49 49
50[namecache] 50[namecache]
51FORCESTART = NO 51IMMEDIATE_START = NO
52AUTOSTART = NO 52START_ON_DEMAND = NO
53 53
54[topology] 54[topology]
55FORCESTART = NO 55IMMEDIATE_START = NO
56AUTOSTART = NO 56START_ON_DEMAND = NO
diff --git a/src/multicast/test_multicast_2peers.c b/src/multicast/test_multicast_2peers.c
index 8ce4d585f..325d81498 100644
--- a/src/multicast/test_multicast_2peers.c
+++ b/src/multicast/test_multicast_2peers.c
@@ -2,20 +2,18 @@
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2013 GNUnet e.V. 3 * Copyright (C) 2013 GNUnet e.V.
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 it
6 * it under the terms of the GNU General Public License as published 6 * under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation; either version 3, or (at your 7 * by the Free Software Foundation, either version 3 of the License,
8 * option) any later version. 8 * or (at your option) any later version.
9 * 9 *
10 * GNUnet is distributed in the hope that it will be useful, but 10 * GNUnet is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details. 13 * Affero General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU Affero General Public License
16 * along with GNUnet; see the file COPYING. If not, write to the 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */ 17 */
20 18
21/** 19/**
@@ -223,8 +221,11 @@ origin_notify (void *cls,
223 void *data) 221 void *data)
224{ 222{
225 char text[] = "pong"; 223 char text[] = "pong";
224
226 *data_size = strlen(text)+1; 225 *data_size = strlen(text)+1;
227 memcpy(data, text, *data_size); 226 GNUNET_memcpy (data,
227 text,
228 *data_size);
228 229
229 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends (to all): %s\n", text); 230 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends (to all): %s\n", text);
230 231
diff --git a/src/multicast/test_multicast_line.conf b/src/multicast/test_multicast_line.conf
index 1047205cb..c1ce7c63f 100644
--- a/src/multicast/test_multicast_line.conf
+++ b/src/multicast/test_multicast_line.conf
@@ -11,7 +11,7 @@ GLOBAL_POSTFIX=-L ERROR
11UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock 11UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock
12 12
13[vpn] 13[vpn]
14AUTOSTART = NO 14START_ON_DEMAND = NO
15 15
16[peerinfo] 16[peerinfo]
17# Do not use shipped gnunet HELLOs 17# Do not use shipped gnunet HELLOs
@@ -25,39 +25,39 @@ NO_IO = YES
25ID_ANNOUNCE_TIME = 5 s 25ID_ANNOUNCE_TIME = 5 s
26 26
27[hostlist] 27[hostlist]
28FORCESTART = NO 28IMMEDIATE_START = NO
29AUTOSTART = NO 29START_ON_DEMAND = NO
30 30
31[nat] 31[nat]
32ENABLE_UPNP = NO 32ENABLE_UPNP = NO
33 33
34[fs] 34[fs]
35FORCESTART = NO 35IMMEDIATE_START = NO
36AUTOSTART = NO 36START_ON_DEMAND = NO
37 37
38[vpn] 38[vpn]
39FORCESTART = NO 39IMMEDIATE_START = NO
40AUTOSTART = NO 40START_ON_DEMAND = NO
41 41
42[revocation] 42[revocation]
43FORCESTART = NO 43IMMEDIATE_START = NO
44AUTOSTART = NO 44START_ON_DEMAND = NO
45 45
46[gns] 46[gns]
47FORCESTART = NO 47IMMEDIATE_START = NO
48AUTOSTART = NO 48START_ON_DEMAND = NO
49 49
50[namestore] 50[namestore]
51FORCESTART = NO 51IMMEDIATE_START = NO
52AUTOSTART = NO 52START_ON_DEMAND = NO
53 53
54[namecache] 54[namecache]
55FORCESTART = NO 55IMMEDIATE_START = NO
56AUTOSTART = NO 56START_ON_DEMAND = NO
57 57
58[topology] 58[topology]
59FORCESTART = NO 59IMMEDIATE_START = NO
60AUTOSTART = NO 60START_ON_DEMAND = NO
61 61
62[nse] 62[nse]
63WORKBITS = 0 63WORKBITS = 0
diff --git a/src/multicast/test_multicast_multipeer.c b/src/multicast/test_multicast_multipeer.c
index d1ed1cb39..7766ff875 100644
--- a/src/multicast/test_multicast_multipeer.c
+++ b/src/multicast/test_multicast_multipeer.c
@@ -2,20 +2,18 @@
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2013 GNUnet e.V. 3 * Copyright (C) 2013 GNUnet e.V.
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 it
6 * it under the terms of the GNU General Public License as published 6 * under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation; either version 3, or (at your 7 * by the Free Software Foundation, either version 3 of the License,
8 * option) any later version. 8 * or (at your option) any later version.
9 * 9 *
10 * GNUnet is distributed in the hope that it will be useful, but 10 * GNUnet is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details. 13 * Affero General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU Affero General Public License
16 * along with GNUnet; see the file COPYING. If not, write to the 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */ 17 */
20 18
21/** 19/**
@@ -54,7 +52,7 @@ enum pingpong
54struct pingpong_msg 52struct pingpong_msg
55{ 53{
56 int peer; 54 int peer;
57 enum pingpong msg; 55 enum pingpong msg;
58}; 56};
59 57
60static void service_connect (void *cls, 58static void service_connect (void *cls,
@@ -143,13 +141,13 @@ member_join_request (void *cls,
143{ 141{
144 struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls; 142 struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls;
145 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 143 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
146 "Peer #%u (%s) sent a join request.\n", 144 "Peer #%u (%s) sent a join request.\n",
147 mc_peer->peer, 145 mc_peer->peer,
148 GNUNET_i2s (multicast_peers[mc_peer->peer]->id)); 146 GNUNET_i2s (multicast_peers[mc_peer->peer]->id));
149} 147}
150 148
151 149
152static int 150static int
153notify (void *cls, 151notify (void *cls,
154 size_t *data_size, 152 size_t *data_size,
155 void *data) 153 void *data)
@@ -162,8 +160,9 @@ notify (void *cls,
162 160
163 *data_size = sizeof (struct pingpong_msg); 161 *data_size = sizeof (struct pingpong_msg);
164 GNUNET_memcpy(data, pp_msg, *data_size); 162 GNUNET_memcpy(data, pp_msg, *data_size);
163 GNUNET_free (pp_msg);
165 164
166 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 165 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
167 "Peer #%u sents ping to origin\n", mc_peer->peer); 166 "Peer #%u sents ping to origin\n", mc_peer->peer);
168 167
169 return GNUNET_YES; 168 return GNUNET_YES;
@@ -179,20 +178,20 @@ member_join_decision (void *cls,
179 const struct GNUNET_MessageHeader *join_msg) 178 const struct GNUNET_MessageHeader *join_msg)
180{ 179{
181 struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls; 180 struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls;
182 181
183 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 182 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
184 "Peer #%u (%s) received a decision from origin: %s\n", 183 "Peer #%u (%s) received a decision from origin: %s\n",
185 mc_peer->peer, 184 mc_peer->peer,
186 GNUNET_i2s (multicast_peers[mc_peer->peer]->id), 185 GNUNET_i2s (multicast_peers[mc_peer->peer]->id),
187 (GNUNET_YES == is_admitted)?"accepted":"rejected"); 186 (GNUNET_YES == is_admitted)?"accepted":"rejected");
188 187
189 if (GNUNET_YES == is_admitted) 188 if (GNUNET_YES == is_admitted)
190 { 189 {
191 GNUNET_MULTICAST_member_to_origin (members[mc_peer->peer], 190 GNUNET_MULTICAST_member_to_origin (members[mc_peer->peer],
192 0, 191 0,
193 notify, 192 notify,
194 cls); 193 cls);
195 194
196 } 195 }
197} 196}
198 197
@@ -236,7 +235,7 @@ member_disconnected_cb (void *cls)
236 235
237 236
238static void 237static void
239member_message (void *cls, 238member_message (void *cls,
240 const struct GNUNET_MULTICAST_MessageHeader *msg) 239 const struct GNUNET_MULTICAST_MessageHeader *msg)
241{ 240{
242 struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls; 241 struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls;
@@ -245,7 +244,7 @@ member_message (void *cls,
245 if (PONG == pp_msg->msg && mc_peer->peer == pp_msg->peer) 244 if (PONG == pp_msg->msg && mc_peer->peer == pp_msg->peer)
246 { 245 {
247 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 246 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
248 "peer #%i (%s) receives a pong\n", 247 "peer #%i (%s) receives a pong\n",
249 mc_peer->peer, 248 mc_peer->peer,
250 GNUNET_i2s (multicast_peers[mc_peer->peer]->id)); 249 GNUNET_i2s (multicast_peers[mc_peer->peer]->id));
251 mc_peer->test_ok = GNUNET_OK; 250 mc_peer->test_ok = GNUNET_OK;
@@ -269,9 +268,9 @@ origin_join_request (void *cls,
269 268
270 uint8_t data_size = ntohs (join_msg->size); 269 uint8_t data_size = ntohs (join_msg->size);
271 270
272 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 271 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
273 "origin got a join request...\n"); 272 "origin got a join request...\n");
274 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 273 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
275 "origin receives: '%s'\n", (char *)&join_msg[1]); 274 "origin receives: '%s'\n", (char *)&join_msg[1]);
276 275
277 char data[] = "Come in!"; 276 char data[] = "Come in!";
@@ -281,7 +280,7 @@ origin_join_request (void *cls,
281 join_resp->type = htons (123); 280 join_resp->type = htons (123);
282 GNUNET_memcpy (&join_resp[1], data, data_size); 281 GNUNET_memcpy (&join_resp[1], data, data_size);
283 282
284 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 283 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
285 "origin sends: '%s'\n", data); 284 "origin sends: '%s'\n", data);
286 285
287 GNUNET_MULTICAST_join_decision (jh, 286 GNUNET_MULTICAST_join_decision (jh,
@@ -311,7 +310,7 @@ origin_replay_msg (void *cls,
311 uint64_t message_id, 310 uint64_t message_id,
312 uint64_t fragment_offset, 311 uint64_t fragment_offset,
313 uint64_t flags, 312 uint64_t flags,
314 struct GNUNET_MULTICAST_ReplayHandle *rh) 313 struct GNUNET_MULTICAST_ReplayHandle *rh)
315{ 314{
316 315
317 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin replay msg\n"); 316 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin replay msg\n");
@@ -319,8 +318,8 @@ origin_replay_msg (void *cls,
319 318
320 319
321static int 320static int
322origin_notify (void *cls, 321origin_notify (void *cls,
323 size_t *data_size, 322 size_t *data_size,
324 void *data) 323 void *data)
325{ 324{
326 struct pingpong_msg *rcv_pp_msg = (struct pingpong_msg*)cls; 325 struct pingpong_msg *rcv_pp_msg = (struct pingpong_msg*)cls;
@@ -329,11 +328,12 @@ origin_notify (void *cls,
329 pp_msg->peer = rcv_pp_msg->peer; 328 pp_msg->peer = rcv_pp_msg->peer;
330 pp_msg->msg = PONG; 329 pp_msg->msg = PONG;
331 *data_size = sizeof (struct pingpong_msg); 330 *data_size = sizeof (struct pingpong_msg);
332 memcpy(data, pp_msg, *data_size); 331 GNUNET_memcpy(data, pp_msg, *data_size);
332 GNUNET_free (pp_msg);
333 333
334 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends pong\n"); 334 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends pong\n");
335 335
336 return GNUNET_YES; 336 return GNUNET_YES;
337} 337}
338 338
339 339
@@ -345,7 +345,7 @@ origin_request (void *cls,
345 345
346 req++; 346 req++;
347 struct pingpong_msg *pp_msg = (struct pingpong_msg *) req; 347 struct pingpong_msg *pp_msg = (struct pingpong_msg *) req;
348 348
349 if (1 != pp_msg->msg) { 349 if (1 != pp_msg->msg) {
350 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "origin didn't reveice a correct request"); 350 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "origin didn't reveice a correct request");
351 } 351 }
@@ -360,7 +360,7 @@ origin_request (void *cls,
360 360
361static void 361static void
362origin_message (void *cls, 362origin_message (void *cls,
363 const struct GNUNET_MULTICAST_MessageHeader *msg) 363 const struct GNUNET_MULTICAST_MessageHeader *msg)
364{ 364{
365 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin message msg\n"); 365 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin message msg\n");
366} 366}
@@ -386,7 +386,7 @@ multicast_connect (void *cls,
386 { 386 {
387 group_key = GNUNET_CRYPTO_eddsa_key_create (); 387 group_key = GNUNET_CRYPTO_eddsa_key_create ();
388 GNUNET_CRYPTO_eddsa_key_get_public (group_key, &group_pub_key); 388 GNUNET_CRYPTO_eddsa_key_get_public (group_key, &group_pub_key);
389 389
390 GNUNET_CRYPTO_hash (&group_pub_key, sizeof (group_pub_key), &group_pub_key_hash); 390 GNUNET_CRYPTO_hash (&group_pub_key, sizeof (group_pub_key), &group_pub_key_hash);
391 origin = GNUNET_MULTICAST_origin_start (cfg, 391 origin = GNUNET_MULTICAST_origin_start (cfg,
392 group_key, 392 group_key,
@@ -414,7 +414,7 @@ multicast_connect (void *cls,
414 { 414 {
415 multicast_peer->key = GNUNET_CRYPTO_ecdsa_key_create (); 415 multicast_peer->key = GNUNET_CRYPTO_ecdsa_key_create ();
416 416
417 sprintf(data, "Hi, I am peer #%u (%s). Can I enter?", 417 sprintf(data, "Hi, I am peer #%u (%s). Can I enter?",
418 multicast_peer->peer, 418 multicast_peer->peer,
419 GNUNET_i2s (multicast_peers[multicast_peer->peer]->id)); 419 GNUNET_i2s (multicast_peers[multicast_peer->peer]->id));
420 uint8_t data_size = strlen (data) + 1; 420 uint8_t data_size = strlen (data) + 1;
@@ -424,7 +424,7 @@ multicast_connect (void *cls,
424 GNUNET_memcpy (&join_msg[1], data, data_size); 424 GNUNET_memcpy (&join_msg[1], data, data_size);
425 425
426 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 426 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
427 "Peer #%u (%s) tries to join multicast group %s\n", 427 "Peer #%u (%s) tries to join multicast group %s\n",
428 multicast_peer->peer, 428 multicast_peer->peer,
429 GNUNET_i2s (multicast_peers[multicast_peer->peer]->id), 429 GNUNET_i2s (multicast_peers[multicast_peer->peer]->id),
430 GNUNET_h2s (&group_pub_key_hash)); 430 GNUNET_h2s (&group_pub_key_hash));
@@ -465,12 +465,12 @@ peer_information_cb (void *cls,
465 multicast_peers[mc_peer->peer]->id = pinfo->result.id; 465 multicast_peers[mc_peer->peer]->id = pinfo->result.id;
466 466
467 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 467 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
468 "Got peer information of %s (%s)\n", 468 "Got peer information of %s (%s)\n",
469 (0 == mc_peer->peer)? "origin" : "member", 469 (0 == mc_peer->peer)? "origin" : "member",
470 GNUNET_i2s (pinfo->result.id)); 470 GNUNET_i2s (pinfo->result.id));
471 471
472 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 472 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
473 "Create peer #%u (%s)\n", 473 "Create peer #%u (%s)\n",
474 mc_peer->peer, 474 mc_peer->peer,
475 GNUNET_i2s (multicast_peers[mc_peer->peer]->id)); 475 GNUNET_i2s (multicast_peers[mc_peer->peer]->id));
476 476
@@ -479,7 +479,7 @@ peer_information_cb (void *cls,
479 /* connect to multicast service of members */ 479 /* connect to multicast service of members */
480 op[mc_peer->peer] = 480 op[mc_peer->peer] =
481 GNUNET_TESTBED_service_connect (/* Closure for operation */ 481 GNUNET_TESTBED_service_connect (/* Closure for operation */
482 NULL, 482 NULL,
483 /* The peer whose service to connect to */ 483 /* The peer whose service to connect to */
484 peers[mc_peer->peer], 484 peers[mc_peer->peer],
485 /* The name of the service */ 485 /* The name of the service */
@@ -508,8 +508,8 @@ service_connect (void *cls,
508 508
509 if (NULL == ca_result) 509 if (NULL == ca_result)
510 { 510 {
511 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 511 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
512 "Connection adapter not created for peer #%u (%s)\n", 512 "Connection adapter not created for peer #%u (%s)\n",
513 mc_peer->peer, 513 mc_peer->peer,
514 GNUNET_i2s (multicast_peers[mc_peer->peer]->id)); 514 GNUNET_i2s (multicast_peers[mc_peer->peer]->id));
515 515
@@ -519,8 +519,8 @@ service_connect (void *cls,
519 519
520 if (0 == mc_peer->peer) 520 if (0 == mc_peer->peer)
521 { 521 {
522 // Get GNUnet identity of members 522 // Get GNUnet identity of members
523 for (int i = 0; i<PEERS_REQUESTED; i++) 523 for (int i = 0; i<PEERS_REQUESTED; i++)
524 { 524 {
525 pi_op[i] = GNUNET_TESTBED_peer_get_information (peers[i], 525 pi_op[i] = GNUNET_TESTBED_peer_get_information (peers[i],
526 GNUNET_TESTBED_PIT_IDENTITY, 526 GNUNET_TESTBED_PIT_IDENTITY,
@@ -547,7 +547,7 @@ service_connect (void *cls,
547 * @param PEERS_REQUESTED size of the 'peers' array 547 * @param PEERS_REQUESTED size of the 'peers' array
548 * @param links_succeeded number of links between peers that were created 548 * @param links_succeeded number of links between peers that were created
549 * @param links_failed number of links testbed was unable to establish 549 * @param links_failed number of links testbed was unable to establish
550 */ 550 */
551static void 551static void
552testbed_master (void *cls, 552testbed_master (void *cls,
553 struct GNUNET_TESTBED_RunHandle *h, 553 struct GNUNET_TESTBED_RunHandle *h,
@@ -562,7 +562,7 @@ testbed_master (void *cls,
562 multicast_peers = GNUNET_new_array (PEERS_REQUESTED, struct MulticastPeerContext*); 562 multicast_peers = GNUNET_new_array (PEERS_REQUESTED, struct MulticastPeerContext*);
563 563
564 // Create test contexts for members 564 // Create test contexts for members
565 for (int i = 0; i<PEERS_REQUESTED; i++) 565 for (int i = 0; i<PEERS_REQUESTED; i++)
566 { 566 {
567 multicast_peers[i] = GNUNET_new (struct MulticastPeerContext); 567 multicast_peers[i] = GNUNET_new (struct MulticastPeerContext);
568 multicast_peers[i]->peer = i; 568 multicast_peers[i]->peer = i;
@@ -604,7 +604,7 @@ main (int argc, char *argv[])
604 int ret; 604 int ret;
605 char const *config_file; 605 char const *config_file;
606 606
607 if (strstr (argv[0], "_line") != NULL) 607 if (strstr (argv[0], "_line") != NULL)
608 { 608 {
609 config_file = "test_multicast_line.conf"; 609 config_file = "test_multicast_line.conf";
610 } 610 }
@@ -612,7 +612,7 @@ main (int argc, char *argv[])
612 { 612 {
613 config_file = "test_multicast_star.conf"; 613 config_file = "test_multicast_star.conf";
614 } 614 }
615 else 615 else
616 { 616 {
617 config_file = "test_multicast_star.conf"; 617 config_file = "test_multicast_star.conf";
618 } 618 }
@@ -620,19 +620,19 @@ main (int argc, char *argv[])
620 result = GNUNET_SYSERR; 620 result = GNUNET_SYSERR;
621 ret = 621 ret =
622 GNUNET_TESTBED_test_run ("test-multicast-multipeer", 622 GNUNET_TESTBED_test_run ("test-multicast-multipeer",
623 config_file, 623 config_file,
624 /* number of peers to start */ 624 /* number of peers to start */
625 PEERS_REQUESTED, 625 PEERS_REQUESTED,
626 /* Event mask - set to 0 for no event notifications */ 626 /* Event mask - set to 0 for no event notifications */
627 0LL, 627 0LL,
628 /* Controller event callback */ 628 /* Controller event callback */
629 NULL, 629 NULL,
630 /* Closure for controller event callback */ 630 /* Closure for controller event callback */
631 NULL, 631 NULL,
632 /* called when testbed setup is complete */ 632 /* called when testbed setup is complete */
633 testbed_master, 633 testbed_master,
634 /* Closure for the test_master callback */ 634 /* Closure for the test_master callback */
635 NULL); 635 NULL);
636 if ( (GNUNET_OK != ret) || (GNUNET_OK != result) ) 636 if ( (GNUNET_OK != ret) || (GNUNET_OK != result) )
637 return 1; 637 return 1;
638 return 0; 638 return 0;
diff --git a/src/multicast/test_multicast_star.conf b/src/multicast/test_multicast_star.conf
index ed690d95d..516c0e302 100644
--- a/src/multicast/test_multicast_star.conf
+++ b/src/multicast/test_multicast_star.conf
@@ -11,7 +11,7 @@ GLOBAL_POSTFIX=-L ERROR
11UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock 11UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock
12 12
13[vpn] 13[vpn]
14AUTOSTART = NO 14START_ON_DEMAND = NO
15 15
16[peerinfo] 16[peerinfo]
17# Do not use shipped gnunet HELLOs 17# Do not use shipped gnunet HELLOs
@@ -25,39 +25,39 @@ NO_IO = YES
25ID_ANNOUNCE_TIME = 5 s 25ID_ANNOUNCE_TIME = 5 s
26 26
27[hostlist] 27[hostlist]
28FORCESTART = NO 28IMMEDIATE_START = NO
29AUTOSTART = NO 29START_ON_DEMAND = NO
30 30
31[nat] 31[nat]
32ENABLE_UPNP = NO 32ENABLE_UPNP = NO
33 33
34[fs] 34[fs]
35FORCESTART = NO 35IMMEDIATE_START = NO
36AUTOSTART = NO 36START_ON_DEMAND = NO
37 37
38[vpn] 38[vpn]
39FORCESTART = NO 39IMMEDIATE_START = NO
40AUTOSTART = NO 40START_ON_DEMAND = NO
41 41
42[revocation] 42[revocation]
43FORCESTART = NO 43IMMEDIATE_START = NO
44AUTOSTART = NO 44START_ON_DEMAND = NO
45 45
46[gns] 46[gns]
47FORCESTART = NO 47IMMEDIATE_START = NO
48AUTOSTART = NO 48START_ON_DEMAND = NO
49 49
50[namestore] 50[namestore]
51FORCESTART = NO 51IMMEDIATE_START = NO
52AUTOSTART = NO 52START_ON_DEMAND = NO
53 53
54[namecache] 54[namecache]
55FORCESTART = NO 55IMMEDIATE_START = NO
56AUTOSTART = NO 56START_ON_DEMAND = NO
57 57
58[topology] 58[topology]
59FORCESTART = NO 59IMMEDIATE_START = NO
60AUTOSTART = NO 60START_ON_DEMAND = NO
61 61
62[nse] 62[nse]
63WORKBITS = 0 63WORKBITS = 0