diff options
Diffstat (limited to 'src/dht')
25 files changed, 323 insertions, 299 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h index 95ffa33ca5..35d9e7cdb0 100644 --- a/src/dht/dht.h +++ b/src/dht/dht.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2001, 2002, 2003, 2004, 2009, 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index de29b05eb4..ec5da3b0a3 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011, 2012, 2016, 2018 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c index 52d5a3731a..f9bd2c9e3c 100644 --- a/src/dht/dht_test_lib.c +++ b/src/dht/dht_test_lib.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2012 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/dht_test_lib.c diff --git a/src/dht/dht_test_lib.h b/src/dht/dht_test_lib.h index 0b4a51c8f0..2bdcf0158f 100644 --- a/src/dht/dht_test_lib.h +++ b/src/dht/dht_test_lib.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2012 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/dht_test_lib.h diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 842ec6270e..3742ed739a 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/gnunet-dht-get.c @@ -154,7 +152,9 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, const void *data) { FPRINTF (stdout, - _("Result %d, type %d:\n%.*s\n"), + (GNUNET_BLOCK_TYPE_TEST == type) + ? _("Result %d, type %d:\n%.*s\n") + : _("Result %d, type %d:\n"), result_count, type, (unsigned int) size, @@ -196,8 +196,6 @@ run (void *cls, char *const *args, const char *cfgfile, { struct GNUNET_HashCode key; - - cfg = c; if (NULL == query_key) { @@ -215,17 +213,22 @@ run (void *cls, char *const *args, const char *cfgfile, query_type = GNUNET_BLOCK_TYPE_TEST; GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); if (verbose) - FPRINTF (stderr, "%s `%s' \n", _("Issueing DHT GET with key"), GNUNET_h2s_full (&key)); + FPRINTF (stderr, "%s `%s' \n", + _("Issueing DHT GET with key"), + GNUNET_h2s_full (&key)); GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); tt = GNUNET_SCHEDULER_add_delayed (timeout_request, - &timeout_task, NULL); + &timeout_task, + NULL); get_handle = GNUNET_DHT_get_start (dht_handle, query_type, &key, replication, (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE, - NULL, 0, &get_result_iterator, NULL); - + NULL, 0, + &get_result_iterator, + NULL); } + /** * Entry point for gnunet-dht-get * @@ -236,15 +239,12 @@ run (void *cls, char *const *args, const char *cfgfile, int main (int argc, char *const *argv) { - struct GNUNET_GETOPT_CommandLineOption options[] = { - GNUNET_GETOPT_option_string ('k', "key", "KEY", gettext_noop ("the query key"), &query_key), - GNUNET_GETOPT_option_uint ('r', "replication", "LEVEL", diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c index b7360bbabc..b08521c7be 100644 --- a/src/dht/gnunet-dht-monitor.c +++ b/src/dht/gnunet-dht-monitor.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2012 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/gnunet-dht-monitor.c @@ -141,7 +139,8 @@ get_callback (void *cls, const struct GNUNET_PeerIdentity *path, const struct GNUNET_HashCode * key) { - FPRINTF (stdout, "GET #%u: type %d, key `%s'\n", + FPRINTF (stdout, + "GET #%u: type %d, key `%s'\n", result_count, (int) type, GNUNET_h2s_full(key)); @@ -176,8 +175,11 @@ get_resp_callback (void *cls, size_t size) { FPRINTF (stdout, - "RESPONSE #%u: type %d, key `%s', data `%.*s'\n", + (GNUNET_BLOCK_TYPE_TEST == type) + ? "RESPONSE #%u (%s): type %d, key `%s', data `%.*s'\n" + : "RESPONSE #%u (%s): type %d, key `%s'\n", result_count, + GNUNET_STRINGS_absolute_time_to_string (exp), (int) type, GNUNET_h2s_full (key), (unsigned int) size, @@ -215,8 +217,11 @@ put_callback (void *cls, size_t size) { FPRINTF (stdout, - "PUT %u: type %d, key `%s', data `%.*s'\n", + (GNUNET_BLOCK_TYPE_TEST == type) + ? "PUT %u (%s): type %d, key `%s', data `%.*s'\n" + : "PUT %u (%s): type %d, key `%s'\n", result_count, + GNUNET_STRINGS_absolute_time_to_string (exp), (int) type, GNUNET_h2s_full(key), (unsigned int) size, @@ -234,7 +239,9 @@ put_callback (void *cls, * @param c configuration */ static void -run (void *cls, char *const *args, const char *cfgfile, +run (void *cls, + char *const *args, + const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { struct GNUNET_HashCode *key; @@ -291,30 +298,30 @@ int main (int argc, char *const *argv) { struct GNUNET_GETOPT_CommandLineOption options[] = { - + GNUNET_GETOPT_option_string ('k', "key", "KEY", gettext_noop ("the query key"), &query_key), - + GNUNET_GETOPT_option_uint ('t', "type", "TYPE", gettext_noop ("the type of data to look for"), &block_type), - + GNUNET_GETOPT_option_relative_time ('T', "timeout", "TIMEOUT", gettext_noop ("how long should the monitor command run"), &timeout_request), - + GNUNET_GETOPT_option_flag ('V', "verbose", gettext_noop ("be verbose (print progress information)"), &verbose), - + GNUNET_GETOPT_OPTION_END }; diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index db4d04681f..fd784871d3 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009, 2017 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/gnunet-dht-put.c diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 829c53aea0..f9d705873d 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011, 2016 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht.h b/src/dht/gnunet-service-dht.h index 8b0602104b..fa5aa7a555 100644 --- a/src/dht/gnunet-service-dht.h +++ b/src/dht/gnunet-service-dht.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009-2016 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index 503d7867bb..862654c837 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011, 2016, 2017 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c index 36047d5619..7ad9aa7280 100644 --- a/src/dht/gnunet-service-dht_datacache.c +++ b/src/dht/gnunet-service-dht_datacache.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011, 2015, 2017 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/gnunet-service-dht_datacache.c @@ -26,6 +24,7 @@ #include "platform.h" #include "gnunet_datacache_lib.h" #include "gnunet-service-dht_datacache.h" +#include "gnunet-service-dht_neighbours.h" #include "gnunet-service-dht_routing.h" #include "gnunet-service-dht.h" @@ -79,10 +78,13 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, } /* Put size is actual data size plus struct overhead plus path length (if any) */ GNUNET_STATISTICS_update (GDS_stats, - gettext_noop ("# ITEMS stored in datacache"), 1, + gettext_noop ("# ITEMS stored in datacache"), + 1, GNUNET_NO); r = GNUNET_DATACACHE_put (datacache, key, + GNUNET_CRYPTO_hash_matching_bits (key, + &my_identity_hash), data_size, data, type, @@ -169,6 +171,11 @@ datacache_get_iterator (void *cls, struct GetRequestContext *ctx = cls; enum GNUNET_BLOCK_EvaluationResult eval; + if (0 == GNUNET_TIME_absolute_get_remaining (exp).rel_value_us) + { + GNUNET_break (0); /* why does datacache return expired values? */ + return GNUNET_OK; /* skip expired record */ + } if ( (NULL == data) && (0 == data_size) ) data = &non_null; /* point anywhere, but not to NULL */ diff --git a/src/dht/gnunet-service-dht_datacache.h b/src/dht/gnunet-service-dht_datacache.h index ff6ae23dac..6f65982a56 100644 --- a/src/dht/gnunet-service-dht_datacache.h +++ b/src/dht/gnunet-service-dht_datacache.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c index 5a5c415675..142d44bccd 100644 --- a/src/dht/gnunet-service-dht_hello.c +++ b/src/dht/gnunet-service-dht_hello.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_hello.h b/src/dht/gnunet-service-dht_hello.h index 8d9b940ad8..41351da34d 100644 --- a/src/dht/gnunet-service-dht_hello.h +++ b/src/dht/gnunet-service-dht_hello.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 0309bea880..56639448f5 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009-2017 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** @@ -404,7 +402,7 @@ static struct GNUNET_PeerIdentity my_identity; /** * Hash of the identity of this peer. */ -static struct GNUNET_HashCode my_identity_hash; +struct GNUNET_HashCode my_identity_hash; /** * Handle to CORE. @@ -421,7 +419,7 @@ static struct GNUNET_ATS_ConnectivityHandle *ats_ch; * Find the optimal bucket for this key. * * @param hc the hashcode to compare our identity to - * @return the proper bucket index, or GNUNET_SYSERR + * @return the proper bucket index, or #GNUNET_SYSERR * on error (same hashcode) */ static int @@ -470,6 +468,7 @@ free_connect_info (void *cls, { struct ConnectInfo *ci = value; + (void) cls; GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multipeermap_remove (all_desired_peers, peer, @@ -581,7 +580,10 @@ update_desire_strength (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) { - try_connect (pid, NULL); + (void) cls; + (void) value; + try_connect (pid, + NULL); return GNUNET_YES; } @@ -618,6 +620,8 @@ add_known_to_bloom (void *cls, struct GNUNET_BLOCK_Group *bg = cls; struct GNUNET_HashCode key_hash; + (void) cls; + (void) value; GNUNET_CRYPTO_hash (key, sizeof (struct GNUNET_PeerIdentity), &key_hash); @@ -645,7 +649,8 @@ send_find_peer_message (void *cls) struct GNUNET_BLOCK_Group *bg; struct GNUNET_CONTAINER_BloomFilter *peer_bf; - find_peer_task = NULL; + (void) cls; + find_peer_task = NULL; if (newly_found_peers > bucket_size) { /* If we are finding many peers already, no need to send out our request right now! */ @@ -718,7 +723,8 @@ handle_core_connect (void *cls, { struct PeerInfo *pi; - /* Check for connect to self message */ + (void) cls; + /* Check for connect to self message */ if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) @@ -741,13 +747,13 @@ handle_core_connect (void *cls, &pi->phash); pi->peer_bucket = find_bucket (&pi->phash); GNUNET_assert ( (pi->peer_bucket >= 0) && - (pi->peer_bucket < MAX_BUCKETS) ); + ((unsigned int) pi->peer_bucket < MAX_BUCKETS) ); GNUNET_CONTAINER_DLL_insert_tail (k_buckets[pi->peer_bucket].head, k_buckets[pi->peer_bucket].tail, pi); k_buckets[pi->peer_bucket].peers_size++; closest_bucket = GNUNET_MAX (closest_bucket, - pi->peer_bucket); + (unsigned int) pi->peer_bucket); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_put (all_connected_peers, pi->id, @@ -785,6 +791,7 @@ handle_core_disconnect (void *cls, { struct PeerInfo *to_remove = internal_cls; + (void) cls; /* Check for disconnect from self message */ if (NULL == to_remove) return; @@ -941,30 +948,30 @@ get_distance (const struct GNUNET_HashCode *target, * @return #GNUNET_YES if node location is closest, * #GNUNET_NO otherwise. */ -static int -am_closest_peer (const struct GNUNET_HashCode *key, - const struct GNUNET_CONTAINER_BloomFilter *bloom) +int +GDS_am_closest_peer (const struct GNUNET_HashCode *key, + const struct GNUNET_CONTAINER_BloomFilter *bloom) { int bits; int other_bits; int bucket_num; - int count; struct PeerInfo *pos; - if (0 == memcmp (&my_identity_hash, key, sizeof (struct GNUNET_HashCode))) + if (0 == memcmp (&my_identity_hash, + key, + sizeof (struct GNUNET_HashCode))) return GNUNET_YES; bucket_num = find_bucket (key); GNUNET_assert (bucket_num >= 0); bits = GNUNET_CRYPTO_hash_matching_bits (&my_identity_hash, key); pos = k_buckets[bucket_num].head; - count = 0; - while ((NULL != pos) && (count < bucket_size)) + while (NULL != pos) { - if ((NULL != bloom) && - (GNUNET_YES == - GNUNET_CONTAINER_bloomfilter_test (bloom, - &pos->phash))) + if ( (NULL != bloom) && + (GNUNET_YES == + GNUNET_CONTAINER_bloomfilter_test (bloom, + &pos->phash)) ) { pos = pos->next; continue; /* Skip already checked entries */ @@ -1596,6 +1603,7 @@ static void core_init (void *cls, const struct GNUNET_PeerIdentity *identity) { + (void) cls; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CORE called, I am %s\n", GNUNET_i2s (identity)); @@ -1621,6 +1629,7 @@ check_dht_p2p_put (void *cls, uint32_t putlen; uint16_t msize; + (void) cls; msize = ntohs (put->header.size); putlen = ntohl (put->put_path_length); if ((msize < @@ -1656,7 +1665,17 @@ handle_dht_p2p_put (void *cls, struct GNUNET_CONTAINER_BloomFilter *bf; struct GNUNET_HashCode test_key; int forwarded; + struct GNUNET_TIME_Absolute exp_time; + exp_time = GNUNET_TIME_absolute_ntoh (put->expiration_time); + if (0 == GNUNET_TIME_absolute_get_remaining (exp_time).rel_value_us) + { + GNUNET_STATISTICS_update (GDS_stats, + gettext_noop ("# Expired PUTs discarded"), + 1, + GNUNET_NO); + return; + } msize = ntohs (put->header.size); putlen = ntohl (put->put_path_length); GNUNET_STATISTICS_update (GDS_stats, @@ -1792,7 +1811,7 @@ handle_dht_p2p_put (void *cls, putlen = 0; /* give to local clients */ - GDS_CLIENTS_handle_reply (GNUNET_TIME_absolute_ntoh (put->expiration_time), + GDS_CLIENTS_handle_reply (exp_time, &put->key, 0, NULL, @@ -1803,8 +1822,8 @@ handle_dht_p2p_put (void *cls, payload); /* store locally */ if ((0 != (options & GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) || - (am_closest_peer (&put->key, bf))) - GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), + (GDS_am_closest_peer (&put->key, bf))) + GDS_DATACACHE_handle_put (exp_time, &put->key, putlen, pp, @@ -1815,7 +1834,7 @@ handle_dht_p2p_put (void *cls, forwarded = GDS_NEIGHBOURS_handle_put (ntohl (put->type), options, ntohl (put->desired_replication_level), - GNUNET_TIME_absolute_ntoh (put->expiration_time), + exp_time, ntohl (put->hop_count), bf, &put->key, @@ -1832,7 +1851,7 @@ handle_dht_p2p_put (void *cls, ntohl (put->hop_count), ntohl (put->desired_replication_level), putlen, pp, - GNUNET_TIME_absolute_ntoh (put->expiration_time), + exp_time, &put->key, payload, payload_size); @@ -1909,9 +1928,9 @@ handle_find_peer (const struct GNUNET_PeerIdentity *sender, sizeof (struct GNUNET_HashCode))) bucket_idx = closest_bucket; else - bucket_idx = GNUNET_MIN (closest_bucket, + bucket_idx = GNUNET_MIN ((int) closest_bucket, find_bucket (key)); - if (bucket_idx == GNUNET_SYSERR) + if (bucket_idx < 0) return; bucket = &k_buckets[bucket_idx]; if (bucket->peers_size == 0) @@ -2018,6 +2037,7 @@ check_dht_p2p_get (void *cls, uint32_t xquery_size; uint16_t msize; + (void) cls; msize = ntohs (get->header.size); xquery_size = ntohl (get->xquery_size); if (msize < sizeof (struct PeerGetMessage) + xquery_size) @@ -2122,7 +2142,7 @@ handle_dht_p2p_get (void *cls, (unsigned int) ntohl (get->hop_count)); /* local lookup (this may update the reply_bf) */ if ((0 != (options & GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) || - (am_closest_peer (&get->key, + (GDS_am_closest_peer (&get->key, peer_bf))) { if ((0 != (options & GNUNET_DHT_RO_FIND_PEER))) @@ -2205,6 +2225,7 @@ check_dht_p2p_result (void *cls, uint32_t put_path_length; uint16_t msize; + (void) cls; msize = ntohs (prm->header.size); put_path_length = ntohl (prm->put_path_length); get_path_length = ntohl (prm->get_path_length); @@ -2318,8 +2339,18 @@ handle_dht_p2p_result (void *cls, uint16_t msize; size_t data_size; enum GNUNET_BLOCK_Type type; + struct GNUNET_TIME_Absolute exp_time; /* parse and validate message */ + exp_time = GNUNET_TIME_absolute_ntoh (prm->expiration_time); + if (0 == GNUNET_TIME_absolute_get_remaining (exp_time).rel_value_us) + { + GNUNET_STATISTICS_update (GDS_stats, + gettext_noop ("# Expired results discarded"), + 1, + GNUNET_NO); + return; + } msize = ntohs (prm->header.size); put_path_length = ntohl (prm->put_path_length); get_path_length = ntohl (prm->get_path_length); @@ -2393,7 +2424,6 @@ handle_dht_p2p_result (void *cls, h); } - /* First, check if 'peer' is already on the path, and if so, truncate it instead of expanding. */ for (unsigned int i=0;i<=get_path_length;i++) @@ -2401,7 +2431,7 @@ handle_dht_p2p_result (void *cls, peer->id, sizeof (struct GNUNET_PeerIdentity))) { - process_reply_with_path (GNUNET_TIME_absolute_ntoh (prm->expiration_time), + process_reply_with_path (exp_time, &prm->key, i, get_path, @@ -2422,7 +2452,7 @@ handle_dht_p2p_result (void *cls, get_path_length * sizeof (struct GNUNET_PeerIdentity)); xget_path[get_path_length] = *peer->id; - process_reply_with_path (GNUNET_TIME_absolute_ntoh (prm->expiration_time), + process_reply_with_path (exp_time, &prm->key, get_path_length + 1, xget_path, diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h index 34b76ee8a2..fb740c7660 100644 --- a/src/dht/gnunet-service-dht_neighbours.h +++ b/src/dht/gnunet-service-dht_neighbours.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** @@ -32,6 +30,12 @@ #include "gnunet_dht_service.h" /** + * Hash of the identity of this peer. + */ +extern struct GNUNET_HashCode my_identity_hash; + + +/** * Perform a PUT operation. Forwards the given request to other * peers. Does not store the data locally. Does not give the * data to local clients. May do nothing if this is the only @@ -123,6 +127,22 @@ GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, /** + * Check whether my identity is closer than any known peers. If a + * non-null bloomfilter is given, check if this is the closest peer + * that hasn't already been routed to. + * + * @param key hash code to check closeness to + * @param bloom bloomfilter, exclude these entries from the decision + * @return #GNUNET_YES if node location is closest, + * #GNUNET_NO otherwise. + */ +int +GDS_am_closest_peer (const struct GNUNET_HashCode *key, + const struct GNUNET_CONTAINER_BloomFilter *bloom); + + + +/** * Initialize neighbours subsystem. * * @return #GNUNET_OK on success, #GNUNET_SYSERR on error diff --git a/src/dht/gnunet-service-dht_nse.c b/src/dht/gnunet-service-dht_nse.c index da4aae60c2..446ae2dbda 100644 --- a/src/dht/gnunet-service-dht_nse.c +++ b/src/dht/gnunet-service-dht_nse.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2010, 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_nse.h b/src/dht/gnunet-service-dht_nse.h index 075a872b3c..a5e259cbae 100644 --- a/src/dht/gnunet-service-dht_nse.h +++ b/src/dht/gnunet-service-dht_nse.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c index 098b6e8958..0098ce0964 100644 --- a/src/dht/gnunet-service-dht_routing.c +++ b/src/dht/gnunet-service-dht_routing.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet-service-dht_routing.h b/src/dht/gnunet-service-dht_routing.h index ad7958363a..d9c0345b65 100644 --- a/src/dht/gnunet-service-dht_routing.h +++ b/src/dht/gnunet-service-dht_routing.h @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2011 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index 5341e7d61c..75ca2a3aa0 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2014, 2018 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c index 9f2861b50c..d4b19677e1 100644 --- a/src/dht/plugin_block_dht.c +++ b/src/dht/plugin_block_dht.c @@ -2,20 +2,18 @@ This file is part of GNUnet Copyright (C) 2010, 2017 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 62d1213062..9097a0011b 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2009, 2015, 2017 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/test_dht_api.c diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c index 3de8001448..33467e89c9 100644 --- a/src/dht/test_dht_monitor.c +++ b/src/dht/test_dht_monitor.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2011, 2012 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/test_dht_monitor.c diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c index 79edb2b0cc..e09a3be676 100644 --- a/src/dht/test_dht_topo.c +++ b/src/dht/test_dht_topo.c @@ -2,20 +2,18 @@ This file is part of GNUnet. Copyright (C) 2012, 2016 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file dht/test_dht_topo.c |