From cf4608196bc02093409dbf6b7a24e6ed08c36f76 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Wed, 27 May 2020 15:01:30 +0200 Subject: Make REQUEST_AGPL messages configurable and add handler by default This makes two changes: * Add a field to `struct GNUNET_OS_ProjectData' containing a URL (as a string) pointing to the source code of the application. * If the field is not NULL, add a handler for the REQUEST_AGPL messages sending the specified URL to the client. The handler is added both in client-service communications (i.e. local services that don't make requests to other peers in the network) and in peer-peer communications (CADET.) This way, any client (local or remote with CADET) can request the source code location using a standardized mechanism instead of writing ad-hoc solutions (unless the service/peer explicitly specifies a NULL pointer.) Signed-off-by: Christian Grothoff --- src/include/gnunet_protocols.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/include/gnunet_protocols.h') diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 3b05fb8bb..282bb53d1 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h @@ -50,25 +50,29 @@ extern "C" { #endif /******************************************************************************* - * UTIL message types - ******************************************************************************/ +* Deprecated +* *****************************************************************************/ /** * Test if service is online. * * @deprecated! */ -#define GNUNET_MESSAGE_TYPE_TEST 1 +#define GNUNET_MESSAGE_TYPE_TEST 0 + +/******************************************************************************* +* AGPL source code download +* *****************************************************************************/ /** - * Dummy messages for testing / benchmarking. + * Message to request source code link. */ -#define GNUNET_MESSAGE_TYPE_DUMMY 2 +#define GNUNET_MESSAGE_TYPE_REQUEST_AGPL 1 /** - * Another dummy messages for testing / benchmarking. + * Source code link. */ -#define GNUNET_MESSAGE_TYPE_DUMMY2 3 +#define GNUNET_MESSAGE_TYPE_RESPONSE_AGPL 2 /******************************************************************************* * RESOLVER message types @@ -85,18 +89,18 @@ extern "C" { #define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5 /******************************************************************************* -* AGPL source code download -* *****************************************************************************/ + * UTIL message types + ******************************************************************************/ /** - * Message to request source code link. + * Dummy messages for testing / benchmarking. */ -#define GNUNET_MESSAGE_TYPE_REQUEST_AGPL 6 +#define GNUNET_MESSAGE_TYPE_DUMMY 6 /** - * Source code link. + * Another dummy messages for testing / benchmarking. */ -#define GNUNET_MESSAGE_TYPE_RESPONSE_AGPL 7 +#define GNUNET_MESSAGE_TYPE_DUMMY2 7 /******************************************************************************* -- cgit v1.2.3