#include <gnunet_dnsparser_lib.h>
#include <gnunet_identity_service.h>
#include <gnunet_gnsrecord_lib.h>
+#include <gnunet_gns_service.h>
#include <gnunet_namestore_service.h>
*/
static char *expirationstring;
+/**
+ * Desired nick name.
+ */
+static char *nickstring;
+
/**
* Global return value
*/
const char *emsg)
{
del_qe = NULL;
- if (success != GNUNET_YES)
+ if (GNUNET_NO == success)
+ {
fprintf (stderr,
- _("Deleting record failed: %s\n"),
- emsg);
+ _("Deleting record failed, record does not exist%s%s\n"),
+ (NULL != emsg) ? ": " : "",
+ (NULL != emsg) ? emsg : "");
+ }
+ if (GNUNET_SYSERR == success)
+ {
+ fprintf (stderr,
+ _("Deleting record failed%s%s\n"),
+ (NULL != emsg) ? ": " : "",
+ (NULL != emsg) ? emsg : "");
+ }
test_finished ();
}
ets = GNUNET_STRINGS_absolute_time_to_string (at);
}
FPRINTF (stdout,
- "\t%s: %s (%s)\n",
+ "\t%s: %s (%s)\t%s\t%s\t%s\n",
typestring,
s,
- ets);
+ ets,
+ (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) ? "PRIVATE" : "PUBLIC",
+ (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ? "SHADOW" : "",
+ (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PENDING)) ? "PENDING" : "");
GNUNET_free (s);
}
FPRINTF (stdout, "%s", "\n");
rde->data = data;
rde->data_size = data_size;
rde->record_type = type;
- if (1 != shadow)
+ if (1 == shadow)
rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
if (1 != public)
rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE;
"namestore");
return;
}
- if (! (add|del|list|(NULL != uri)|(NULL != reverse_pkey)) )
+ if (! (add|del|list|(NULL != nickstring)|(NULL != uri)|(NULL != reverse_pkey)) )
{
/* nothing more to be done */
fprintf (stderr,
rd.expiration_time = etime_abs.abs_value_us;
else
rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
+
if (1 != shadow)
rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
add_qe_uri = GNUNET_NAMESTORE_records_store (ns,
&add_continuation,
&add_qe_uri);
}
+ if (NULL != nickstring)
+ {
+ if (0 == strlen(nickstring))
+ {
+ fprintf (stderr,
+ _("Invalid nick `%s'\n"),
+ nickstring);
+ GNUNET_SCHEDULER_shutdown ();
+ ret = 1;
+ return;
+ }
+ add_qe_uri = GNUNET_NAMESTORE_set_nick(ns, &zone_pkey, nickstring,
+ &add_continuation, &add_qe_uri);
+ }
if (monitor)
{
zm = GNUNET_NAMESTORE_zone_monitor_start (cfg,
_("You must specify which zone should be accessed\n"));
return;
}
+
if ( (NULL != args[0]) && (NULL == uri) )
uri = GNUNET_strdup (args[0]);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
main (int argc, char *const *argv)
{
public = -1;
+ shadow = -1;
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'a', "add", NULL,
{'e', "expiration", "TIME",
gettext_noop ("expiration time for record to use (for adding only), \"never\" is possible"), 1,
&GNUNET_GETOPT_set_string, &expirationstring},
+ {'i', "nick", "NICKNAME",
+ gettext_noop ("set the desired nick name for the zone"), 1,
+ &GNUNET_GETOPT_set_string, &nickstring},
{'m', "monitor", NULL,
gettext_noop ("monitor changes in the namestore"), 0,
&GNUNET_GETOPT_set_one, &monitor},