aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2014-04-18 12:20:18 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2014-04-18 12:20:18 +0000
commita3a577a83c4c63c4597d8a9bb624a1c5e2d1e5e3 (patch)
treeaf8595da03b54b705db2c52a111d5a4bb9d3547a
parent7bae7a6783251df63244fc1eea7476f21b894e4e (diff)
hack namestore pending capability
git-svn-id: https://gnunet.org/svn/gnunet@33111 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r--doc/man/gnunet-namestore.119
-rw-r--r--src/namestore/gnunet-namestore.c31
2 files changed, 37 insertions, 13 deletions
diff --git a/doc/man/gnunet-namestore.1 b/doc/man/gnunet-namestore.1
index ec99d088d2..577785df11 100644
--- a/doc/man/gnunet-namestore.1
+++ b/doc/man/gnunet-namestore.1
@@ -1,4 +1,4 @@
-.TH GNUNET\-NAMESTORE 1 "Mar 5, 2012" "GNUnet"
+.TH GNUNET\-NAMESTORE 1 "Apr 15, 2014" "GNUnet"
.SH NAME
gnunet\-namestore \- manipulate GNUnet zones
@@ -9,7 +9,7 @@ gnunet\-namestore \- manipulate GNUnet zones
.br
.SH DESCRIPTION
-\fBgnunet\-namestore\fP can be used to create and manipulate a GNS zone.
+\fBgnunet\-namestore\fP can be used to manipulate records in a GNS zone.
.SH OPTIONS
.B
@@ -31,6 +31,9 @@ Specifies expiration time of record to add; format is relative time, i.e "1 h" o
.IP "\-h, \-\-help"
Print short help on options.
.B
+.IP "\-i NICKNAME, \-\-nick=NICKNAME"
+Set the desired NICKNAME for the zone. The nickname will be included in all (public) records and used as the suggested name for this zone.
+.B
.IP "\-L LOGLEVEL, \-\-loglevel=LOGLEVEL"
Use LOGLEVEL for logging. Valid values are DEBUG, INFO, WARNING and ERROR.
.B
@@ -40,9 +43,18 @@ Monitor changes to the zone on an ongoing basis (in contrast to \-D, which merel
.IP "\-n NAME, \-\-name=NAME"
Name of the record to add/delete/display
.B
+.IP "\-p, \-\-public"
+Create a record that is public (shared with other users that know the label)
+.B
+.IP "\-P, \-\-pending"
+Create a record that is pending approval (stored in the namestore but unavailable for resolution to anyone)
+.B
.IP "\-r PKEY, \-\-reverse=PKEY"
Determine our GNS name for the given public key (reverse lookup of the PKEY) in the given zone.
.B
+.IP "\-s, \-\-shadow"
+Create a record that is a shadow record. Shadow records are only used once all other records of the same type under the same label have expired.
+.B
.IP "\-t TYPE, \-\-type=TYPE"
Type of the record to add/delete/display (i.e. "A", "AAAA", "NS", "PKEY", "MX" etc.)
.B
@@ -64,4 +76,5 @@ Report bugs by using Mantis <https://gnunet.org/bugs/> or by sending electronic
.SH "SEE ALSO"
-\fBgnunet\-gns\fP(1)
+\fBgnunet\-gns\fP(1), \fBgnunet\-namestore\-gtk\fP(1)
+
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index ec6ccbfbed..8dc35984e7 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+ (C) 2012, 2013, 2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -102,12 +102,17 @@ static int del;
/**
* Is record public (opposite of #GNUNET_GNSRECORD_RF_PRIVATE)
*/
-static int public;
+static int is_public;
/**
* Is record a shadow record (#GNUNET_GNSRECORD_RF_SHADOW_RECORD)
*/
-static int shadow;
+static int is_shadow;
+
+/**
+ * Is record pending approval (#GNUNET_GNSRECORD_RF_PENDING)
+ */
+static int is_pending;
/**
* Queue entry for the 'del' operation.
@@ -475,10 +480,12 @@ get_existing_record (void *cls,
rde->data = data;
rde->data_size = data_size;
rde->record_type = type;
- if (1 == shadow)
+ if (1 == is_shadow)
rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
- if (1 != public)
+ if (1 != is_public)
rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE;
+ if (1 == is_pending)
+ rde->flags |= GNUNET_GNSRECORD_RF_PENDING;
if (GNUNET_YES == etime_is_rel)
{
rde->expiration_time = etime_rel.rel_value_us;
@@ -732,7 +739,7 @@ testservice_task (void *cls,
else
rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
- if (1 == shadow)
+ if (1 == is_shadow)
rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
add_qe_uri = GNUNET_NAMESTORE_records_store (ns,
&zone_pkey,
@@ -905,8 +912,9 @@ run (void *cls, char *const *args, const char *cfgfile,
int
main (int argc, char *const *argv)
{
- public = -1;
- shadow = -1;
+ is_public = -1;
+ is_pending = -1;
+ is_shadow = -1;
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'a', "add", NULL,
@@ -944,10 +952,13 @@ main (int argc, char *const *argv)
&GNUNET_GETOPT_set_string, &value},
{'p', "public", NULL,
gettext_noop ("create or list public record"), 0,
- &GNUNET_GETOPT_set_one, &public},
+ &GNUNET_GETOPT_set_one, &is_public},
+ {'P', "pending", NULL,
+ gettext_noop ("create record that is pending approval (and thus for now inactive)"), 0,
+ &GNUNET_GETOPT_set_one, &is_pending},
{'s', "shadow", NULL,
gettext_noop ("create shadow record (only valid if all other records of the same type have expired"), 0,
- &GNUNET_GETOPT_set_one, &shadow},
+ &GNUNET_GETOPT_set_one, &is_shadow},
{'z', "zone", "EGO",
gettext_noop ("name of the ego controlling the zone"), 1,
&GNUNET_GETOPT_set_string, &ego_name},