#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
*/
"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,
{'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},