aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlessio Vanni <vannilla@firemail.cc>2020-05-27 15:01:30 +0200
committerChristian Grothoff <christian@grothoff.org>2020-05-27 22:37:08 +0200
commitcf4608196bc02093409dbf6b7a24e6ed08c36f76 (patch)
tree46c2ecc852810e35d9d5eabcfcb52620e06aaa3f /src/include
parent3a966c83d32db67d0e9cb23675f28b7233280aeb (diff)
downloadgnunet-cf4608196bc02093409dbf6b7a24e6ed08c36f76.tar.gz
gnunet-cf4608196bc02093409dbf6b7a24e6ed08c36f76.zip
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 <christian@grothoff.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_os_lib.h8
-rw-r--r--src/include/gnunet_protocols.h30
2 files changed, 25 insertions, 13 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index a6188c1ca..b583cc493 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -287,6 +287,14 @@ struct GNUNET_OS_ProjectData
287 * If this field is NULL, the path is automatically inferred. 287 * If this field is NULL, the path is automatically inferred.
288 */ 288 */
289 char *gettext_path; 289 char *gettext_path;
290
291 /**
292 * URL pointing to the source code of the application. Required for AGPL.
293 * Setting this to NULL disables the built-in mechanism, but you must
294 * provide it in some other way. If non-NULL, message type 1 and 2 are
295 * reserved.
296 */
297 char *agpl_url;
290}; 298};
291 299
292 300
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" {
50#endif 50#endif
51 51
52/******************************************************************************* 52/*******************************************************************************
53 * UTIL message types 53* Deprecated
54 ******************************************************************************/ 54* *****************************************************************************/
55 55
56/** 56/**
57 * Test if service is online. 57 * Test if service is online.
58 * 58 *
59 * @deprecated! 59 * @deprecated!
60 */ 60 */
61#define GNUNET_MESSAGE_TYPE_TEST 1 61#define GNUNET_MESSAGE_TYPE_TEST 0
62
63/*******************************************************************************
64* AGPL source code download
65* *****************************************************************************/
62 66
63/** 67/**
64 * Dummy messages for testing / benchmarking. 68 * Message to request source code link.
65 */ 69 */
66#define GNUNET_MESSAGE_TYPE_DUMMY 2 70#define GNUNET_MESSAGE_TYPE_REQUEST_AGPL 1
67 71
68/** 72/**
69 * Another dummy messages for testing / benchmarking. 73 * Source code link.
70 */ 74 */
71#define GNUNET_MESSAGE_TYPE_DUMMY2 3 75#define GNUNET_MESSAGE_TYPE_RESPONSE_AGPL 2
72 76
73/******************************************************************************* 77/*******************************************************************************
74 * RESOLVER message types 78 * RESOLVER message types
@@ -85,18 +89,18 @@ extern "C" {
85#define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5 89#define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5
86 90
87/******************************************************************************* 91/*******************************************************************************
88* AGPL source code download 92 * UTIL message types
89* *****************************************************************************/ 93 ******************************************************************************/
90 94
91/** 95/**
92 * Message to request source code link. 96 * Dummy messages for testing / benchmarking.
93 */ 97 */
94#define GNUNET_MESSAGE_TYPE_REQUEST_AGPL 6 98#define GNUNET_MESSAGE_TYPE_DUMMY 6
95 99
96/** 100/**
97 * Source code link. 101 * Another dummy messages for testing / benchmarking.
98 */ 102 */
99#define GNUNET_MESSAGE_TYPE_RESPONSE_AGPL 7 103#define GNUNET_MESSAGE_TYPE_DUMMY2 7
100 104
101 105
102/******************************************************************************* 106/*******************************************************************************