* @author Christian Grothoff
*
* TODO:
- * - printing records
* - allow users to set record options (not just 'RF_AUTHORITY')
* - test
* - parsing SOA, PTR and MX value specifications (and define format!)
*/
static char *expirationstring;
-/**
- * Desired block expiration time.
- */
-static char *blockexpirationstring;
/**
* Task run on shutdown. Cleans up everything.
void *data = NULL;
size_t data_size = 0;
struct GNUNET_TIME_Relative etime;
- struct GNUNET_TIME_Relative btime;
struct GNUNET_NAMESTORE_RecordData rd;
if (NULL == keyfile)
fprintf (stderr, _("Unsupported type `%s'\n"), typestring);
GNUNET_SCHEDULER_shutdown ();
return;
- } else if (add | del)
+ }
+ if ((NULL == typestring) && (add | del))
{
fprintf (stderr,
_("Missing option `%s' for operation `%s'\n"),
GNUNET_SCHEDULER_shutdown ();
return;
}
- if (NULL != blockexpirationstring)
- {
- if (GNUNET_OK !=
- GNUNET_STRINGS_fancy_time_to_relative (blockexpirationstring,
- &btime))
- {
- fprintf (stderr,
- _("Invalid time format `%s'\n"),
- blockexpirationstring);
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- } else if (add | del)
- {
- fprintf (stderr,
- _("Missing option `%s' for operation `%s'\n"),
- "-b", _("add/del"));
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
-
if (add)
{
if (NULL == name)
rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; // FIXME: not always...
add_qe = GNUNET_NAMESTORE_record_create (ns,
zone_pkey,
- GNUNET_TIME_relative_to_absolute (btime),
name,
&rd,
&add_continuation,
{'a', "add", NULL,
gettext_noop ("add record"), 0,
&GNUNET_GETOPT_set_one, &add},
- {'b', "name-expiration", "TIME",
- gettext_noop ("expiration time for name to use (for adding only)"), 1,
- &GNUNET_GETOPT_set_string, &blockexpirationstring},
{'d', "delete", NULL,
gettext_noop ("delete record"), 0,
&GNUNET_GETOPT_set_one, &del},