This is an ALPHA release. There are known and significant bugs as
well as many missing features in this release.
-GNUnet is free software released under the GNU General Public License
-(v3 or later). For details see the COPYING file in this directory.
+GNUnet is free software released under the GNU Affero General Public
+License (v3 or later). For details see the COPYING file in this
+directory. If you fork this software, you MUST adjust GNUNET_AGPL_URL
+in src/include/gnunet_util_lib.h to point to the source code of your
+fork!
Additional documentation about GNUnet can be found at
https://gnunet.org/ and in the doc/ folder.
Dependencies:
=============
-Please note that for many of its dependencies GNUnet requires very
-recent versions of the libraries which are often NOT to be found in
-stable distributions in 2014. While using older packages may in some
-cases on some operating systems may seem to work in some limited
-fashion, we are in many cases aware of serious problems with older
-packages. Hence please make sure to use the versions listed below.
-
These are the direct dependencies for running GNUnet:
-- libmicrohttpd >= 0.9.42
+- libmicrohttpd >= 0.9.52
- libgcrypt >= 1.6
- libgnurl >= 7.35.0 (available from https://gnunet.org/gnurl)
- libunistring >= 0.9.2
GNUNET_MQ_copy_handlers (const struct GNUNET_MQ_MessageHandler *handlers);
+/**
+ * Copy an array of handlers, appending AGPL handler.
+ *
+ * Useful if the array has been delared in local memory and needs to be
+ * persisted for future use.
+ *
+ * @param handlers Array of handlers to be copied. Can be NULL (nothing done).
+ * @param agpl_handler function to call for AGPL handling
+ * @param agpl_cls closure for @a agpl_handler
+ * @return A newly allocated array of handlers.
+ * Needs to be freed with #GNUNET_free.
+ */
+struct GNUNET_MQ_MessageHandler *
+GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers,
+ GNUNET_MQ_MessageCallback agpl_handler,
+ void *agpl_cls);
+
+
/**
* Count the handlers in a handler array.
*
/*
This file is part of GNUnet.
- Copyright (C) 2001--2015 GNUnet e.V.
+ Copyright (C) 2001--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
*/
#define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5
+/*******************************************************************************
+ * AGPL source code download
+ * *****************************************************************************/
+
+/**
+ * Message to request source code link.
+ */
+#define GNUNET_MESSAGE_TYPE_REQUEST_AGPL 6
+
+/**
+ * Source code link.
+ */
+#define GNUNET_MESSAGE_TYPE_RESPONSE_AGPL 7
+
+
/*******************************************************************************
* ARM message types
******************************************************************************/
*/
#define GNUNET_MIN_MESSAGE_SIZE sizeof (struct GNUNET_MessageHeader)
+/**
+ * NOTE: You MUST adjust this URL to point to the location of a
+ * publicly accessible repository (or TGZ) containing the sources of
+ * THIS release. Otherwise, you are violating the Affero GPL if you make
+ * this service available to anyone but yourself.
+ */
+#define GNUNET_AGPL_URL "https://gnunet.org/git/gnunet.git#" PACKAGE_VERSION;
+
#include "gnunet_crypto_lib.h"
#include "gnunet_bandwidth_lib.h"
}
+/**
+ * Copy an array of handlers, appending AGPL handler.
+ *
+ * Useful if the array has been delared in local memory and needs to be
+ * persisted for future use.
+ *
+ * @param handlers Array of handlers to be copied. Can be NULL (nothing done).
+ * @param agpl_handler function to call for AGPL handling
+ * @param agpl_cls closure for @a agpl_handler
+ * @return A newly allocated array of handlers.
+ * Needs to be freed with #GNUNET_free.
+ */
+struct GNUNET_MQ_MessageHandler *
+GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers,
+ GNUNET_MQ_MessageCallback agpl_handler,
+ void *agpl_cls)
+{
+ struct GNUNET_MQ_MessageHandler *copy;
+ unsigned int count;
+
+ if (NULL == handlers)
+ return NULL;
+ count = GNUNET_MQ_count_handlers (handlers);
+ copy = GNUNET_new_array (count + 2,
+ struct GNUNET_MQ_MessageHandler);
+ GNUNET_memcpy (copy,
+ handlers,
+ count * sizeof (struct GNUNET_MQ_MessageHandler));
+ copy[count].mv = NULL;
+ copy[count].cb = agpl_handler;
+ copy[count].cls = agpl_cls;
+ copy[count].type = GNUNET_MESSAGE_TYPE_REQUEST_AGPL;
+ copy[count].expected_size = sizeof (struct GNUNET_MessageHeader);
+ return copy;
+}
+
+
/**
* Count the handlers in a handler array.
*
}
+/**
+ * Function to return link to AGPL source upon request.
+ *
+ * @param cls closure with the identification of the client
+ * @param msg AGPL request
+ */
+static void
+return_agpl (void *cls,
+ const struct GNUNET_MessageHeader *msg)
+{
+ struct GNUNET_SERVICE_Client *client = cls;
+ struct GNUNET_MQ_Handle *mq;
+ struct GNUNET_MQ_Envelope *env;
+ struct GNUNET_MessageHeader *res;
+ size_t slen;
+
+ slen = strlen (GNUNET_AGPL_URL) + 1;
+ env = GNUNET_MQ_msg_extra (res,
+ GNUNET_MESSAGE_TYPE_RESPONSE_AGPL,
+ slen);
+ memcpy (&res[1],
+ GNUNET_AGPL_URL,
+ slen);
+ mq = GNUNET_SERVICE_client_get_mq (client);
+ GNUNET_MQ_send (mq,
+ env);
+ GNUNET_SERVICE_client_continue (client);
+}
+
+
/**
* Low-level function to start a service if the scheduler
* is already running. Should only be used directly in
sh->connect_cb = connect_cb;
sh->disconnect_cb = disconnect_cb;
sh->cb_cls = cls;
- sh->handlers = GNUNET_MQ_copy_handlers (handlers);
+ sh->handlers = GNUNET_MQ_copy_handlers2 (handlers,
+ &return_agpl,
+ NULL);
if (GNUNET_OK != setup_service (sh))
{
GNUNET_free_non_null (sh->handlers);
struct GNUNET_GETOPT_CommandLineOption service_options[] = {
GNUNET_GETOPT_option_cfgfile (&opt_cfg_filename),
GNUNET_GETOPT_option_flag ('d',
- "daemonize",
- gettext_noop ("do daemonize (detach from terminal)"),
- &do_daemonize),
+ "daemonize",
+ gettext_noop ("do daemonize (detach from terminal)"),
+ &do_daemonize),
GNUNET_GETOPT_option_help (NULL),
GNUNET_GETOPT_option_loglevel (&loglev),
GNUNET_GETOPT_option_logfile (&logfile),