aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c160
-rw-r--r--src/namestore/gnunet-namestore.c18
-rw-r--r--src/namestore/gnunet-service-namestore.c18
-rw-r--r--src/namestore/gnunet-zoneimport.c18
-rw-r--r--src/namestore/namestore.h18
-rw-r--r--src/namestore/namestore_api.c18
-rw-r--r--src/namestore/namestore_api_monitor.c18
-rw-r--r--src/namestore/perf_namestore_api_zone_iteration.c23
-rw-r--r--src/namestore/plugin_namestore_flat.c16
-rw-r--r--src/namestore/plugin_namestore_postgres.c16
-rw-r--r--src/namestore/plugin_namestore_sqlite.c16
-rw-r--r--src/namestore/plugin_rest_namestore.c18
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c21
-rw-r--r--src/namestore/test_namestore_api_lookup_private.c21
-rw-r--r--src/namestore/test_namestore_api_lookup_public.c21
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow.c21
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow_filter.c22
-rw-r--r--src/namestore/test_namestore_api_monitoring.c32
-rw-r--r--src/namestore/test_namestore_api_monitoring_existing.c23
-rw-r--r--src/namestore/test_namestore_api_remove.c21
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c18
-rw-r--r--src/namestore/test_namestore_api_store.c21
-rw-r--r--src/namestore/test_namestore_api_store_update.c27
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c23
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_nick.c23
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c23
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c30
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c23
-rw-r--r--src/namestore/test_plugin_namestore.c24
29 files changed, 381 insertions, 370 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 903253b1a..f4cdf26b4 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012-2014 GNUnet e.V. 3 Copyright (C) 2012-2014 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 * @file gnunet-namestore-fcfsd.c 19 * @file gnunet-namestore-fcfsd.c
@@ -161,11 +159,6 @@ struct Request
161struct ZoneinfoRequest 159struct ZoneinfoRequest
162{ 160{
163 /** 161 /**
164 * Connection
165 */
166 struct MHD_Connection *connection;
167
168 /**
169 * List iterator 162 * List iterator
170 */ 163 */
171 struct GNUNET_NAMESTORE_ZoneIterator *list_it; 164 struct GNUNET_NAMESTORE_ZoneIterator *list_it;
@@ -212,6 +205,16 @@ static struct GNUNET_CRYPTO_EcdsaPrivateKey fcfs_zone_pkey;
212static struct GNUNET_IDENTITY_Handle *identity; 205static struct GNUNET_IDENTITY_Handle *identity;
213 206
214/** 207/**
208 * Zoneinfo page we currently use.
209 */
210static struct MHD_Response *info_page;
211
212/**
213 * Task that runs #update_zoneinfo_page peridicially.
214 */
215static struct GNUNET_SCHEDULER_Task *uzp_task;
216
217/**
215 * Request for our ego. 218 * Request for our ego.
216 */ 219 */
217static struct GNUNET_IDENTITY_Operation *id_op; 220static struct GNUNET_IDENTITY_Operation *id_op;
@@ -221,6 +224,11 @@ static struct GNUNET_IDENTITY_Operation *id_op;
221 */ 224 */
222static unsigned long long port; 225static unsigned long long port;
223 226
227/**
228 * Name of the zone we manage.
229 */
230static char *zone;
231
224 232
225/** 233/**
226 * Task run whenever HTTP server operations are pending. 234 * Task run whenever HTTP server operations are pending.
@@ -247,25 +255,25 @@ run_httpd_now ()
247 255
248 256
249/** 257/**
258 * Create fresh version of zone information.
259 */
260static void
261update_zoneinfo_page (void *cls);
262
263
264/**
250 * Function called on error in zone iteration. 265 * Function called on error in zone iteration.
251 */ 266 */
252static void 267static void
253zone_iteration_error (void *cls) 268zone_iteration_error (void *cls)
254{ 269{
255 struct ZoneinfoRequest *zr = cls; 270 struct ZoneinfoRequest *zr = cls;
256 struct MHD_Response *response;
257 271
258 zr->list_it = NULL; 272 zr->list_it = NULL;
259 response = MHD_create_response_from_buffer (strlen ("internal error"),
260 (void *) "internal error",
261 MHD_RESPMEM_PERSISTENT);
262 MHD_queue_response (zr->connection,
263 MHD_HTTP_INTERNAL_SERVER_ERROR,
264 response);
265 MHD_destroy_response (response);
266 GNUNET_free (zr->zoneinfo); 273 GNUNET_free (zr->zoneinfo);
267 GNUNET_free (zr); 274 GNUNET_SCHEDULER_cancel (uzp_task);
268 run_httpd_now (); 275 uzp_task = GNUNET_SCHEDULER_add_now (&update_zoneinfo_page,
276 NULL);
269} 277}
270 278
271 279
@@ -292,13 +300,9 @@ zone_iteration_end (void *cls)
292 MHD_add_response_header (response, 300 MHD_add_response_header (response,
293 MHD_HTTP_HEADER_CONTENT_TYPE, 301 MHD_HTTP_HEADER_CONTENT_TYPE,
294 MIME_HTML); 302 MIME_HTML);
295 MHD_queue_response (zr->connection, 303 MHD_destroy_response (info_page);
296 MHD_HTTP_OK, 304 info_page = response;
297 response);
298 MHD_destroy_response (response);
299 GNUNET_free (zr->zoneinfo); 305 GNUNET_free (zr->zoneinfo);
300 GNUNET_free (zr);
301 run_httpd_now ();
302} 306}
303 307
304 308
@@ -373,27 +377,41 @@ iterate_cb (void *cls,
373 * Handler that returns FCFS zoneinfo page. 377 * Handler that returns FCFS zoneinfo page.
374 * 378 *
375 * @param connection connection to use 379 * @param connection connection to use
376 * @return MHD_YES on success
377 */ 380 */
378static int 381static int
379serve_zoneinfo_page (struct MHD_Connection *connection) 382serve_zoneinfo_page (struct MHD_Connection *connection)
380{ 383{
381 struct ZoneinfoRequest *zr; 384 return MHD_queue_response (connection,
382 385 MHD_HTTP_OK,
383 zr = GNUNET_new (struct ZoneinfoRequest); 386 info_page);
384 zr->zoneinfo = GNUNET_malloc (DEFAULT_ZONEINFO_BUFSIZE); 387}
385 zr->buf_len = DEFAULT_ZONEINFO_BUFSIZE; 388
386 zr->connection = connection; 389
387 zr->write_offset = 0; 390/**
388 zr->list_it = GNUNET_NAMESTORE_zone_iteration_start (ns, 391 * Create fresh version of zone information.
389 &fcfs_zone_pkey, 392 */
390 &zone_iteration_error, 393static void
391 zr, 394update_zoneinfo_page (void *cls)
392 &iterate_cb, 395{
393 zr, 396 static struct ZoneinfoRequest zr;
394 &zone_iteration_end, 397
395 zr); 398 (void) cls;
396 return MHD_YES; 399 uzp_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
400 &update_zoneinfo_page,
401 NULL);
402 if (NULL != zr.list_it)
403 return;
404 zr.zoneinfo = GNUNET_malloc (DEFAULT_ZONEINFO_BUFSIZE);
405 zr.buf_len = DEFAULT_ZONEINFO_BUFSIZE;
406 zr.write_offset = 0;
407 zr.list_it = GNUNET_NAMESTORE_zone_iteration_start (ns,
408 &fcfs_zone_pkey,
409 &zone_iteration_error,
410 &zr,
411 &iterate_cb,
412 &zr,
413 &zone_iteration_end,
414 &zr);
397} 415}
398 416
399 417
@@ -401,7 +419,7 @@ serve_zoneinfo_page (struct MHD_Connection *connection)
401 * Handler that returns a simple static HTTP page. 419 * Handler that returns a simple static HTTP page.
402 * 420 *
403 * @param connection connection to use 421 * @param connection connection to use
404 * @return MHD_YES on success 422 * @return #MHD_YES on success
405 */ 423 */
406static int 424static int
407serve_main_page (struct MHD_Connection *connection) 425serve_main_page (struct MHD_Connection *connection)
@@ -634,14 +652,14 @@ lookup_block_error (void *cls)
634 * and continue to process the result. 652 * and continue to process the result.
635 * 653 *
636 * @param cls the 'struct Request' we are processing 654 * @param cls the 'struct Request' we are processing
637 * @param zone private key of the zone; NULL on disconnect 655 * @param zonekey private key of the zone; NULL on disconnect
638 * @param label label of the records; NULL on disconnect 656 * @param label label of the records; NULL on disconnect
639 * @param rd_count number of entries in @a rd array, 0 if label was deleted 657 * @param rd_count number of entries in @a rd array, 0 if label was deleted
640 * @param rd array of records with data to store 658 * @param rd array of records with data to store
641 */ 659 */
642static void 660static void
643lookup_block_processor (void *cls, 661lookup_block_processor (void *cls,
644 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 662 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zonekey,
645 const char *label, 663 const char *label,
646 unsigned int rd_count, 664 unsigned int rd_count,
647 const struct GNUNET_GNSRECORD_Data *rd) 665 const struct GNUNET_GNSRECORD_Data *rd)
@@ -650,7 +668,7 @@ lookup_block_processor (void *cls,
650 668
651 (void) label; 669 (void) label;
652 (void) rd; 670 (void) rd;
653 (void) zone; 671 (void) zonekey;
654 request->qe = NULL; 672 request->qe = NULL;
655 if (0 == rd_count) 673 if (0 == rd_count)
656 { 674 {
@@ -703,8 +721,8 @@ lookup_block_processor (void *cls,
703 * @a upload_data provided; the method must update this 721 * @a upload_data provided; the method must update this
704 * value to the number of bytes NOT processed; 722 * value to the number of bytes NOT processed;
705 * @param ptr pointer to location where we store the 'struct Request' 723 * @param ptr pointer to location where we store the 'struct Request'
706 * @return MHD_YES if the connection was handled successfully, 724 * @return #MHD_YES if the connection was handled successfully,
707 * MHD_NO if the socket must be closed due to a serious 725 * #MHD_NO if the socket must be closed due to a serious
708 * error while handling the request 726 * error while handling the request
709 */ 727 */
710static int 728static int
@@ -959,6 +977,11 @@ do_shutdown (void *cls)
959 GNUNET_SCHEDULER_cancel (httpd_task); 977 GNUNET_SCHEDULER_cancel (httpd_task);
960 httpd_task = NULL; 978 httpd_task = NULL;
961 } 979 }
980 if (NULL != uzp_task)
981 {
982 GNUNET_SCHEDULER_cancel (uzp_task);
983 uzp_task = NULL;
984 }
962 if (NULL != ns) 985 if (NULL != ns)
963 { 986 {
964 GNUNET_NAMESTORE_disconnect (ns); 987 GNUNET_NAMESTORE_disconnect (ns);
@@ -1011,12 +1034,16 @@ identity_cb (void *cls,
1011 1034
1012 (void) cls; 1035 (void) cls;
1013 (void) ctx; 1036 (void) ctx;
1014 (void) name; 1037 if (NULL == name)
1015 id_op = NULL; 1038 return;
1039 if (0 != strcmp (name,
1040 zone))
1041 return;
1016 if (NULL == ego) 1042 if (NULL == ego)
1017 { 1043 {
1018 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1044 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1019 _("No ego configured for `fcfsd` subsystem\n")); 1045 _("No ego configured for `fcfsd` subsystem\n"));
1046 GNUNET_SCHEDULER_shutdown ();
1020 return; 1047 return;
1021 } 1048 }
1022 fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); 1049 fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
@@ -1041,6 +1068,7 @@ identity_cb (void *cls,
1041 while (NULL == httpd); 1068 while (NULL == httpd);
1042 if (NULL == httpd) 1069 if (NULL == httpd)
1043 { 1070 {
1071
1044 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1072 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1045 _("Failed to start HTTP server\n")); 1073 _("Failed to start HTTP server\n"));
1046 GNUNET_SCHEDULER_shutdown (); 1074 GNUNET_SCHEDULER_shutdown ();
@@ -1085,16 +1113,18 @@ run (void *cls,
1085 return; 1113 return;
1086 } 1114 }
1087 identity = GNUNET_IDENTITY_connect (cfg, 1115 identity = GNUNET_IDENTITY_connect (cfg,
1088 NULL, NULL); 1116 &identity_cb,
1117 NULL);
1089 if (NULL == identity) 1118 if (NULL == identity)
1090 { 1119 {
1091 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1120 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1092 _("Failed to connect to identity\n")); 1121 _("Failed to connect to identity\n"));
1093 return; 1122 return;
1094 } 1123 }
1095 id_op = GNUNET_IDENTITY_get (identity, "fcfsd", 1124 uzp_task = GNUNET_SCHEDULER_add_now (&update_zoneinfo_page,
1096 &identity_cb, NULL); 1125 NULL);
1097 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); 1126 GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
1127 NULL);
1098} 1128}
1099 1129
1100 1130
@@ -1109,7 +1139,13 @@ int
1109main (int argc, 1139main (int argc,
1110 char *const *argv) 1140 char *const *argv)
1111{ 1141{
1112 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 1142 struct GNUNET_GETOPT_CommandLineOption options[] = {
1143 GNUNET_GETOPT_option_mandatory
1144 (GNUNET_GETOPT_option_string ('z',
1145 "zone",
1146 "EGO",
1147 gettext_noop ("name of the zone that is to be managed by FCFSD"),
1148 &zone)),
1113 GNUNET_GETOPT_OPTION_END 1149 GNUNET_GETOPT_OPTION_END
1114 }; 1150 };
1115 int ret; 1151 int ret;
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 83a7ee349..6ffd99773 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012, 2013, 2014 GNUnet e.V. 3 Copyright (C) 2012, 2013, 2014 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 * @file gnunet-namestore.c 19 * @file gnunet-namestore.c
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 2044010df..2d6020552 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012, 2013, 2014, 2018 GNUnet e.V. 3 Copyright (C) 2012, 2013, 2014, 2018 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/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c
index 44c9fe89e..6c89cdb05 100644
--- a/src/namestore/gnunet-zoneimport.c
+++ b/src/namestore/gnunet-zoneimport.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2018 GNUnet e.V. 3 Copyright (C) 2018 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 * @file src/namestore/gnunet-zoneimport.c 19 * @file src/namestore/gnunet-zoneimport.c
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h
index 679ca3d3d..e6f5ae848 100644
--- a/src/namestore/namestore.h
+++ b/src/namestore/namestore.h
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2011-2013 GNUnet e.V. 3 Copyright (C) 2011-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/namestore/namestore_api.c b/src/namestore/namestore_api.c
index f2aaa43c8..55745d83d 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2010-2013, 2016 GNUnet e.V. 3 Copyright (C) 2010-2013, 2016 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/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c
index 16780ad0c..6c441d786 100644
--- a/src/namestore/namestore_api_monitor.c
+++ b/src/namestore/namestore_api_monitor.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2013, 2016, 2018 GNUnet e.V. 3 Copyright (C) 2013, 2016, 2018 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 * @file namestore/namestore_api_monitor.c 19 * @file namestore/namestore_api_monitor.c
diff --git a/src/namestore/perf_namestore_api_zone_iteration.c b/src/namestore/perf_namestore_api_zone_iteration.c
index 55d6fafa0..03f53e63b 100644
--- a/src/namestore/perf_namestore_api_zone_iteration.c
+++ b/src/namestore/perf_namestore_api_zone_iteration.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2013, 2018 GNUnet e.V. 3 Copyright (C) 2013, 2018 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 * @file namestore/perf_namestore_api_zone_iteration.c 19 * @file namestore/perf_namestore_api_zone_iteration.c
@@ -26,6 +24,9 @@
26#include "gnunet_namestore_service.h" 24#include "gnunet_namestore_service.h"
27#include "gnunet_testing_lib.h" 25#include "gnunet_testing_lib.h"
28#include "namestore.h" 26#include "namestore.h"
27#include "gnunet_dnsparser_lib.h"
28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 30
30/** 31/**
31 * A #BENCHMARK_SIZE of 1000 takes less than a minute on a reasonably 32 * A #BENCHMARK_SIZE of 1000 takes less than a minute on a reasonably
@@ -141,7 +142,7 @@ create_record (unsigned int count)
141 142
142 rd = GNUNET_malloc (count + sizeof (struct GNUNET_GNSRECORD_Data)); 143 rd = GNUNET_malloc (count + sizeof (struct GNUNET_GNSRECORD_Data));
143 rd->expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 144 rd->expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
144 rd->record_type = count; 145 rd->record_type = TEST_RECORD_TYPE;
145 rd->data_size = count; 146 rd->data_size = count;
146 rd->data = (void *) &rd[1]; 147 rd->data = (void *) &rd[1];
147 rd->flags = 0; 148 rd->flags = 0;
diff --git a/src/namestore/plugin_namestore_flat.c b/src/namestore/plugin_namestore_flat.c
index 95edb9d87..33c48b244 100644
--- a/src/namestore/plugin_namestore_flat.c
+++ b/src/namestore/plugin_namestore_flat.c
@@ -2,20 +2,18 @@
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2009-2015, 2018 GNUnet e.V. 3 * Copyright (C) 2009-2015, 2018 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/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c
index 09fdd760f..7c6acc91b 100644
--- a/src/namestore/plugin_namestore_postgres.c
+++ b/src/namestore/plugin_namestore_postgres.c
@@ -2,20 +2,18 @@
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2009-2013, 2016-2018 GNUnet e.V. 3 * Copyright (C) 2009-2013, 2016-2018 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/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c
index 81391ce8a..6960e5d12 100644
--- a/src/namestore/plugin_namestore_sqlite.c
+++ b/src/namestore/plugin_namestore_sqlite.c
@@ -2,20 +2,18 @@
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2009-2017 GNUnet e.V. 3 * Copyright (C) 2009-2017 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/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index fd1528a1d..ec44046e0 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012-2015 GNUnet e.V. 3 Copyright (C) 2012-2015 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 * @author Martin Schanzenbach 19 * @author Martin Schanzenbach
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index b9ae93bf2..1a5a09e47 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_namestore_api_lookup_nick.c 19 * @file namestore/test_namestore_api_lookup_nick.c
@@ -24,8 +22,9 @@
24#include "platform.h" 22#include "platform.h"
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
25#include "gnunet_dnsparser_lib.h"
27 26
28#define TEST_RECORD_TYPE 1234 27#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 28
30#define TEST_RECORD_DATALEN 123 29#define TEST_RECORD_DATALEN 123
31 30
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c
index 689e73a2e..024adaa43 100644
--- a/src/namestore/test_namestore_api_lookup_private.c
+++ b/src/namestore/test_namestore_api_lookup_private.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_namestore_api_store.c 19 * @file namestore/test_namestore_api_store.c
@@ -24,8 +22,9 @@
24#include "platform.h" 22#include "platform.h"
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
25#include "gnunet_dnsparser_lib.h"
27 26
28#define TEST_RECORD_TYPE 1234 27#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 28
30#define TEST_RECORD_DATALEN 123 29#define TEST_RECORD_DATALEN 123
31 30
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c
index 28a68daf9..63cd7662e 100644
--- a/src/namestore/test_namestore_api_lookup_public.c
+++ b/src/namestore/test_namestore_api_lookup_public.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_namestore_api.c 19 * @file namestore/test_namestore_api.c
@@ -25,8 +23,9 @@
25#include "gnunet_namecache_service.h" 23#include "gnunet_namecache_service.h"
26#include "gnunet_namestore_service.h" 24#include "gnunet_namestore_service.h"
27#include "gnunet_testing_lib.h" 25#include "gnunet_testing_lib.h"
26#include "gnunet_dnsparser_lib.h"
28 27
29#define TEST_RECORD_TYPE 1234 28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 29
31#define TEST_RECORD_DATALEN 123 30#define TEST_RECORD_DATALEN 123
32 31
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c
index 39ce4e564..ecfd03735 100644
--- a/src/namestore/test_namestore_api_lookup_shadow.c
+++ b/src/namestore/test_namestore_api_lookup_shadow.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_namestore_api_lookup_shadow.c 19 * @file namestore/test_namestore_api_lookup_shadow.c
@@ -27,8 +25,9 @@
27#include "gnunet_namecache_service.h" 25#include "gnunet_namecache_service.h"
28#include "gnunet_namestore_service.h" 26#include "gnunet_namestore_service.h"
29#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
28#include "gnunet_dnsparser_lib.h"
30 29
31#define TEST_RECORD_TYPE 1234 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
32 31
33#define TEST_RECORD_DATALEN 123 32#define TEST_RECORD_DATALEN 123
34 33
diff --git a/src/namestore/test_namestore_api_lookup_shadow_filter.c b/src/namestore/test_namestore_api_lookup_shadow_filter.c
index 09fd8ce07..b751ff703 100644
--- a/src/namestore/test_namestore_api_lookup_shadow_filter.c
+++ b/src/namestore/test_namestore_api_lookup_shadow_filter.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_namestore_api_lookup_shadow_filter.c 19 * @file namestore/test_namestore_api_lookup_shadow_filter.c
@@ -28,9 +26,11 @@
28#include "gnunet_namecache_service.h" 26#include "gnunet_namecache_service.h"
29#include "gnunet_namestore_service.h" 27#include "gnunet_namestore_service.h"
30#include "gnunet_testing_lib.h" 28#include "gnunet_testing_lib.h"
29#include "gnunet_dnsparser_lib.h"
30
31#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 32
32#define TEST_NAME "dummy.dummy.gnunet" 33#define TEST_NAME "dummy.dummy.gnunet"
33#define TEST_RECORD_TYPE 1234
34#define TEST_RECORD_DATALEN 123 34#define TEST_RECORD_DATALEN 123
35#define TEST_RECORD_DATA 'a' 35#define TEST_RECORD_DATA 'a'
36#define TEST_SHADOW_RECORD_DATA 'b' 36#define TEST_SHADOW_RECORD_DATA 'b'
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index de202d535..1051e3248 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2013, 2018 GNUnet e.V. 3 Copyright (C) 2013, 2018 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 * @file namestore/test_namestore_api_monitoring.c 19 * @file namestore/test_namestore_api_monitoring.c
@@ -25,6 +23,10 @@
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
27#include "namestore.h" 25#include "namestore.h"
26#include "gnunet_dnsparser_lib.h"
27
28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29
28 30
29 31
30#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) 32#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
@@ -244,14 +246,14 @@ put_cont (void *cls,
244static struct GNUNET_GNSRECORD_Data * 246static struct GNUNET_GNSRECORD_Data *
245create_record (unsigned int count) 247create_record (unsigned int count)
246{ 248{
247 unsigned int c; 249 struct GNUNET_GNSRECORD_Data *rd;
248 struct GNUNET_GNSRECORD_Data * rd;
249 250
250 rd = GNUNET_malloc (count * sizeof (struct GNUNET_GNSRECORD_Data)); 251 rd = GNUNET_new_array (count,
251 for (c = 0; c < count; c++) 252 struct GNUNET_GNSRECORD_Data);
253 for (unsigned int c = 0; c < count; c++)
252 { 254 {
253 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 255 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
254 rd[c].record_type = 1111; 256 rd[c].record_type = TEST_RECORD_TYPE;
255 rd[c].data_size = 50; 257 rd[c].data_size = 50;
256 rd[c].data = GNUNET_malloc(50); 258 rd[c].data = GNUNET_malloc(50);
257 rd[c].flags = 0; 259 rd[c].flags = 0;
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c
index 449b36d65..9c8ddf7ad 100644
--- a/src/namestore/test_namestore_api_monitoring_existing.c
+++ b/src/namestore/test_namestore_api_monitoring_existing.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2013, 2018 GNUnet e.V. 3 Copyright (C) 2013, 2018 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 * @file namestore/test_namestore_api_monitoring_existing.c 19 * @file namestore/test_namestore_api_monitoring_existing.c
@@ -25,6 +23,9 @@
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
27#include "namestore.h" 25#include "namestore.h"
26#include "gnunet_dnsparser_lib.h"
27
28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
28 29
29 30
30#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
@@ -292,7 +293,7 @@ create_record (unsigned int count)
292 for (unsigned int c = 0; c < count; c++) 293 for (unsigned int c = 0; c < count; c++)
293 { 294 {
294 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 295 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
295 rd[c].record_type = 1111; 296 rd[c].record_type = TEST_RECORD_TYPE;
296 rd[c].data_size = 50; 297 rd[c].data_size = 50;
297 rd[c].data = GNUNET_malloc(50); 298 rd[c].data = GNUNET_malloc(50);
298 rd[c].flags = 0; 299 rd[c].flags = 0;
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c
index c9e2802bd..7d993d4d9 100644
--- a/src/namestore/test_namestore_api_remove.c
+++ b/src/namestore/test_namestore_api_remove.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 * @file namestore/test_namestore_api.c 19 * @file namestore/test_namestore_api.c
@@ -24,8 +22,9 @@
24#include "platform.h" 22#include "platform.h"
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
25#include "gnunet_dnsparser_lib.h"
27 26
28#define TEST_RECORD_TYPE 1234 27#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 28
30#define TEST_RECORD_DATALEN 123 29#define TEST_RECORD_DATALEN 123
31 30
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c
index d0438a7e1..a5bd6c8c2 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.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 * @file namestore/test_namestore_api_remove_not_existing_record.c 19 * @file namestore/test_namestore_api_remove_not_existing_record.c
diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c
index 4abcfa4d3..61b534781 100644
--- a/src/namestore/test_namestore_api_store.c
+++ b/src/namestore/test_namestore_api_store.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_namestore_api_store.c 19 * @file namestore/test_namestore_api_store.c
@@ -24,8 +22,9 @@
24#include "platform.h" 22#include "platform.h"
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
25#include "gnunet_dnsparser_lib.h"
27 26
28#define TEST_RECORD_TYPE 1234 27#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 28
30#define TEST_RECORD_DATALEN 123 29#define TEST_RECORD_DATALEN 123
31 30
diff --git a/src/namestore/test_namestore_api_store_update.c b/src/namestore/test_namestore_api_store_update.c
index 7b13cd9c5..bd62fdd4c 100644
--- a/src/namestore/test_namestore_api_store_update.c
+++ b/src/namestore/test_namestore_api_store_update.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012, 2013, 2018 GNUnet e.V. 3 Copyright (C) 2012, 2013, 2018 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 * @file namestore/test_namestore_api_store_update.c 19 * @file namestore/test_namestore_api_store_update.c
@@ -27,15 +25,14 @@
27#include "gnunet_namecache_service.h" 25#include "gnunet_namecache_service.h"
28#include "gnunet_namestore_service.h" 26#include "gnunet_namestore_service.h"
29#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
28#include "gnunet_dnsparser_lib.h"
30 29
31#define TEST_RECORD_TYPE 1234 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
32 31
33#define TEST_RECORD_DATALEN 123 32#define TEST_RECORD_DATALEN 123
34 33
35#define TEST_RECORD_DATA 'a' 34#define TEST_RECORD_DATA 'a'
36 35
37#define TEST_RECORD_TYPE2 4321
38
39#define TEST_RECORD_DATALEN2 234 36#define TEST_RECORD_DATALEN2 234
40 37
41#define TEST_RECORD_DATA2 'b' 38#define TEST_RECORD_DATA2 'b'
@@ -149,7 +146,7 @@ rd_decrypt_cb (void *cls,
149 146
150 rd_new.flags = GNUNET_GNSRECORD_RF_NONE; 147 rd_new.flags = GNUNET_GNSRECORD_RF_NONE;
151 rd_new.expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000; 148 rd_new.expiration_time = GNUNET_TIME_absolute_get().abs_value_us + 1000000000;
152 rd_new.record_type = TEST_RECORD_TYPE2; 149 rd_new.record_type = TEST_RECORD_TYPE;
153 rd_new.data_size = TEST_RECORD_DATALEN2; 150 rd_new.data_size = TEST_RECORD_DATALEN2;
154 rd_new.data = GNUNET_malloc (TEST_RECORD_DATALEN2); 151 rd_new.data = GNUNET_malloc (TEST_RECORD_DATALEN2);
155 memset ((char *) rd_new.data, 152 memset ((char *) rd_new.data,
@@ -172,7 +169,7 @@ rd_decrypt_cb (void *cls,
172 memset (rd_cmp_data, 169 memset (rd_cmp_data,
173 TEST_RECORD_DATA2, 170 TEST_RECORD_DATA2,
174 TEST_RECORD_DATALEN2); 171 TEST_RECORD_DATALEN2);
175 GNUNET_assert (TEST_RECORD_TYPE2 == rd[0].record_type); 172 GNUNET_assert (TEST_RECORD_TYPE == rd[0].record_type);
176 GNUNET_assert (TEST_RECORD_DATALEN2 == rd[0].data_size); 173 GNUNET_assert (TEST_RECORD_DATALEN2 == rd[0].data_size);
177 GNUNET_assert (0 == memcmp (&rd_cmp_data, 174 GNUNET_assert (0 == memcmp (&rd_cmp_data,
178 rd[0].data, 175 rd[0].data,
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index 68c3de9b8..af263c816 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2013, 2018 GNUnet e.V. 3 Copyright (C) 2013, 2018 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 * @file namestore/test_namestore_api_zone_iteration.c 19 * @file namestore/test_namestore_api_zone_iteration.c
@@ -25,6 +23,9 @@
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
27#include "namestore.h" 25#include "namestore.h"
26#include "gnunet_dnsparser_lib.h"
27
28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
28 29
29 30
30#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
@@ -322,7 +323,7 @@ create_record (unsigned int count)
322 for (unsigned int c = 0; c < count; c++) 323 for (unsigned int c = 0; c < count; c++)
323 { 324 {
324 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 325 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
325 rd[c].record_type = 1111; 326 rd[c].record_type = TEST_RECORD_TYPE;
326 rd[c].data_size = 50; 327 rd[c].data_size = 50;
327 rd[c].data = GNUNET_malloc(50); 328 rd[c].data = GNUNET_malloc(50);
328 rd[c].flags = 0; 329 rd[c].flags = 0;
diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c
index d950b7e69..efaadff55 100644
--- a/src/namestore/test_namestore_api_zone_iteration_nick.c
+++ b/src/namestore/test_namestore_api_zone_iteration_nick.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 * @file namestore/test_namestore_api_zone_iteration.c 19 * @file namestore/test_namestore_api_zone_iteration.c
@@ -25,6 +23,9 @@
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
27#include "namestore.h" 25#include "namestore.h"
26#include "gnunet_dnsparser_lib.h"
27
28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
28 29
29#define ZONE_NICK_1 "nick1" 30#define ZONE_NICK_1 "nick1"
30#define ZONE_NICK_2 "nick2" 31#define ZONE_NICK_2 "nick2"
@@ -322,7 +323,7 @@ create_record (unsigned int count)
322 for (unsigned int c = 0; c < count; c++) 323 for (unsigned int c = 0; c < count; c++)
323 { 324 {
324 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 325 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
325 rd[c].record_type = 1111; 326 rd[c].record_type = TEST_RECORD_TYPE;
326 rd[c].data_size = 50; 327 rd[c].data_size = 50;
327 rd[c].data = GNUNET_malloc(50); 328 rd[c].data = GNUNET_malloc(50);
328 rd[c].flags = 0; 329 rd[c].flags = 0;
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
index 0b137cc62..303a7648a 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.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 * @file namestore/test_namestore_api_zone_iteration_specific_zone.c 19 * @file namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -26,6 +24,9 @@
26#include "gnunet_namestore_service.h" 24#include "gnunet_namestore_service.h"
27#include "gnunet_testing_lib.h" 25#include "gnunet_testing_lib.h"
28#include "namestore.h" 26#include "namestore.h"
27#include "gnunet_dnsparser_lib.h"
28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 30
30 31
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) 32#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
@@ -299,7 +300,7 @@ create_record (unsigned int count)
299 for (unsigned int c = 0; c < count; c++) 300 for (unsigned int c = 0; c < count; c++)
300 { 301 {
301 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 302 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
302 rd[c].record_type = 1111; 303 rd[c].record_type = TEST_RECORD_TYPE;
303 rd[c].data_size = 50; 304 rd[c].data_size = 50;
304 rd[c].data = GNUNET_malloc(50); 305 rd[c].data = GNUNET_malloc(50);
305 rd[c].flags = 0; 306 rd[c].flags = 0;
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index c7358fc6e..eb7ad4305 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.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 * @file namestore/test_namestore_api_zone_iteration.c 19 * @file namestore/test_namestore_api_zone_iteration.c
@@ -25,7 +23,9 @@
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
27#include "namestore.h" 25#include "namestore.h"
26#include "gnunet_dnsparser_lib.h"
28 27
28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
29 29
30#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) 30#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
31#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2) 31#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2)
@@ -349,14 +349,14 @@ put_cont (void *cls, int32_t success, const char *emsg)
349static struct GNUNET_GNSRECORD_Data * 349static struct GNUNET_GNSRECORD_Data *
350create_record (unsigned int count) 350create_record (unsigned int count)
351{ 351{
352 unsigned int c; 352 struct GNUNET_GNSRECORD_Data *rd;
353 struct GNUNET_GNSRECORD_Data * rd;
354 353
355 rd = GNUNET_malloc (count * sizeof (struct GNUNET_GNSRECORD_Data)); 354 rd = GNUNET_new_array (count,
356 for (c = 0; c < count; c++) 355 struct GNUNET_GNSRECORD_Data);
356 for (unsigned int c = 0; c < count; c++)
357 { 357 {
358 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us; 358 rd[c].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS).abs_value_us;
359 rd[c].record_type = 1111; 359 rd[c].record_type = TEST_RECORD_TYPE;
360 rd[c].data_size = 50; 360 rd[c].data_size = 50;
361 rd[c].data = GNUNET_malloc(50); 361 rd[c].data = GNUNET_malloc(50);
362 rd[c].flags = 0; 362 rd[c].flags = 0;
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 292d8f701..e689455b0 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.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 * @file namestore/test_namestore_api_zone_to_name.c 19 * @file namestore/test_namestore_api_zone_to_name.c
@@ -25,10 +23,11 @@
25#include "gnunet_namestore_service.h" 23#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 24#include "gnunet_testing_lib.h"
27#include "namestore.h" 25#include "namestore.h"
26#include "gnunet_dnsparser_lib.h"
28 27
29#define RECORDS 5 28#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 29
31#define TEST_RECORD_TYPE 1234 30#define RECORDS 5
32 31
33#define TEST_RECORD_DATALEN 123 32#define TEST_RECORD_DATALEN 123
34 33
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c
index 8732acbcb..9d21ad16a 100644
--- a/src/namestore/test_plugin_namestore.c
+++ b/src/namestore/test_plugin_namestore.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 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 * @file namestore/test_plugin_namestore.c 19 * @file namestore/test_plugin_namestore.c
@@ -26,7 +24,9 @@
26#include "gnunet_util_lib.h" 24#include "gnunet_util_lib.h"
27#include "gnunet_namestore_plugin.h" 25#include "gnunet_namestore_plugin.h"
28#include "gnunet_testing_lib.h" 26#include "gnunet_testing_lib.h"
27#include "gnunet_dnsparser_lib.h"
29 28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 30
31static int ok; 31static int ok;
32 32
@@ -110,7 +110,7 @@ test_record (void *cls,
110 { 110 {
111 GNUNET_assert (rd[i].data_size == id % 10); 111 GNUNET_assert (rd[i].data_size == id % 10);
112 GNUNET_assert (0 == memcmp ("Hello World", rd[i].data, id % 10)); 112 GNUNET_assert (0 == memcmp ("Hello World", rd[i].data, id % 10));
113 GNUNET_assert (rd[i].record_type == 1 + (id % 13)); 113 GNUNET_assert (rd[i].record_type == TEST_RECORD_TYPE);
114 GNUNET_assert (rd[i].flags == 0); 114 GNUNET_assert (rd[i].flags == 0);
115 } 115 }
116 memset (&tzone_private_key, 116 memset (&tzone_private_key,
@@ -154,7 +154,7 @@ put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp,
154 rd[i].data = "Hello World"; 154 rd[i].data = "Hello World";
155 rd[i].data_size = id % 10; 155 rd[i].data_size = id % 10;
156 rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value_us; 156 rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value_us;
157 rd[i].record_type = 1 + (id % 13); 157 rd[i].record_type = TEST_RECORD_TYPE;
158 rd[i].flags = 0; 158 rd[i].flags = 0;
159 } 159 }
160 memset (&zone_private_key, (id % 241), sizeof (zone_private_key)); 160 memset (&zone_private_key, (id % 241), sizeof (zone_private_key));