aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-06-07 16:36:50 +0200
committerChristian Grothoff <christian@grothoff.org>2018-06-07 16:36:50 +0200
commitb29bd047910a3f0c526b99de2dd1da24c7f0a224 (patch)
tree37b4eae1f7e83367d7bc01bc4b1f54cf3a2d19d1
parent3ec6a0f2b110771d09f407b47c3d56b2bcf12848 (diff)
downloadgnunet-b29bd047910a3f0c526b99de2dd1da24c7f0a224.tar.gz
gnunet-b29bd047910a3f0c526b99de2dd1da24c7f0a224.zip
add -z option to gnunet-namestore-fcfsd
-rw-r--r--doc/man/gnunet-namestore-fcfsd.119
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c28
2 files changed, 31 insertions, 16 deletions
diff --git a/doc/man/gnunet-namestore-fcfsd.1 b/doc/man/gnunet-namestore-fcfsd.1
index 6b13c3db4..7fc4093c2 100644
--- a/doc/man/gnunet-namestore-fcfsd.1
+++ b/doc/man/gnunet-namestore-fcfsd.1
@@ -17,19 +17,18 @@ names to be mapped to their GNS zone. Names are made available on a
17First Come First Served basis (hence fcfs). Registered names do not 17First Come First Served basis (hence fcfs). Registered names do not
18expire. The HTTP server is run on the port that is specified in the 18expire. The HTTP server is run on the port that is specified in the
19configuration file in section "[fcfsd]" under the name "HTTPPORT". 19configuration file in section "[fcfsd]" under the name "HTTPPORT".
20The key of the zone in which the names are registered must be 20
21specified under the name "ZONEKEY" in the same section. It is 21It is possible to manage gnunet\-gns\-fcfsd using
22possible to manage gnunet\-gns\-fcfsd using gnunet\-(service\-arm) by 22gnunet\-(service\-arm) by starting the daemon using "gnunet\-arm \-i
23starting the daemon using "gnunet\-arm \-i fcfsd" or by setting 23fcfsd" or by setting "FORCESTART=YES" in the "fcfds" section of your
24"FORCESTART=YES" in the "fcfds" section of your configuration. 24configuration and the "-z ZONE" in as the "OPTION".
25 25
26An FCFS\-zone is run at http://gnunet.org/fcfs/. GNS users are 26An FCFS\-zone is run at http://gnunet.org/fcfs/. GNS users are
27encouraged to register their zone with the gnunet.org FCFS authority. 27encouraged to register their zone with the gnunet.org FCFS authority.
28 28
29If you want to run your own FCFS registrar, you need to first create a 29If you want to run your own FCFS registrar, you need to first create a
30pseudonym (using "gnunet\-identity \-C NAME"), and then assign it to 30pseudonym (using "gnunet\-identity \-C NAME"), and use it with the
31be used for the "fcfsd" service using "gnunet\-identity \-e NAME \-s 31"-z" option. After that, you can start the FCFSD service (possibly using
32fcfsd". After that, you can start the FCFSD service (possibly using
33gnunet\-arm). 32gnunet\-arm).
34 33
35.SH OPTIONS 34.SH OPTIONS
@@ -46,7 +45,9 @@ ERROR.
46.B 45.B
47.IP "\-v, \-\-version" 46.IP "\-v, \-\-version"
48Print GNUnet version number. 47Print GNUnet version number.
49 48.B
49.IP "\-z EGO, \-\-zone=EGO"
50Specifies for which EGO should FCFSD manage the zone.
50 51
51.SH BUGS 52.SH BUGS
52Report bugs by using Mantis <https://gnunet.org/bugs/> or by sending electronic mail to <bug\-gnunet@gnu.org> 53Report bugs by using Mantis <https://gnunet.org/bugs/> or by sending electronic mail to <bug\-gnunet@gnu.org>
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 0698e6d72..e0c04e6f1 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -216,6 +216,11 @@ static struct GNUNET_IDENTITY_Operation *id_op;
216 */ 216 */
217static unsigned long long port; 217static unsigned long long port;
218 218
219/**
220 * Name of the zone we manage.
221 */
222static char *zone;
223
219 224
220/** 225/**
221 * Task run whenever HTTP server operations are pending. 226 * Task run whenever HTTP server operations are pending.
@@ -629,14 +634,14 @@ lookup_block_error (void *cls)
629 * and continue to process the result. 634 * and continue to process the result.
630 * 635 *
631 * @param cls the 'struct Request' we are processing 636 * @param cls the 'struct Request' we are processing
632 * @param zone private key of the zone; NULL on disconnect 637 * @param zonekey private key of the zone; NULL on disconnect
633 * @param label label of the records; NULL on disconnect 638 * @param label label of the records; NULL on disconnect
634 * @param rd_count number of entries in @a rd array, 0 if label was deleted 639 * @param rd_count number of entries in @a rd array, 0 if label was deleted
635 * @param rd array of records with data to store 640 * @param rd array of records with data to store
636 */ 641 */
637static void 642static void
638lookup_block_processor (void *cls, 643lookup_block_processor (void *cls,
639 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 644 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zonekey,
640 const char *label, 645 const char *label,
641 unsigned int rd_count, 646 unsigned int rd_count,
642 const struct GNUNET_GNSRECORD_Data *rd) 647 const struct GNUNET_GNSRECORD_Data *rd)
@@ -645,7 +650,7 @@ lookup_block_processor (void *cls,
645 650
646 (void) label; 651 (void) label;
647 (void) rd; 652 (void) rd;
648 (void) zone; 653 (void) zonekey;
649 request->qe = NULL; 654 request->qe = NULL;
650 if (0 == rd_count) 655 if (0 == rd_count)
651 { 656 {
@@ -1087,9 +1092,12 @@ run (void *cls,
1087 _("Failed to connect to identity\n")); 1092 _("Failed to connect to identity\n"));
1088 return; 1093 return;
1089 } 1094 }
1090 id_op = GNUNET_IDENTITY_get (identity, "fcfsd", 1095 id_op = GNUNET_IDENTITY_get (identity,
1091 &identity_cb, NULL); 1096 zone,
1092 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); 1097 &identity_cb,
1098 NULL);
1099 GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
1100 NULL);
1093} 1101}
1094 1102
1095 1103
@@ -1104,7 +1112,13 @@ int
1104main (int argc, 1112main (int argc,
1105 char *const *argv) 1113 char *const *argv)
1106{ 1114{
1107 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 1115 struct GNUNET_GETOPT_CommandLineOption options[] = {
1116 GNUNET_GETOPT_option_mandatory
1117 (GNUNET_GETOPT_option_string ('z',
1118 "zone",
1119 "EGO",
1120 gettext_noop ("name of the zone that is to be managed by FCFSD"),
1121 &zone)),
1108 GNUNET_GETOPT_OPTION_END 1122 GNUNET_GETOPT_OPTION_END
1109 }; 1123 };
1110 int ret; 1124 int ret;