.SH OPTIONS
.B
-.IP "\-z FILENAME, \-\-zonekey=FILENAME"
-Specifies the filename with the private key for the zone (mandatory option)
+.IP "\-a, \-\-add"
+Desired operation is adding a record
.B
.IP "\-c FILENAME, \-\-config=FILENAME"
Use the configuration file FILENAME.
.B
+.IP "\-d, \-\-delete"
+Desired operation is deleting a record
+.B
+.IP "\-D, \-\-display"
+Desired operation is listing of matching records
+.B
+.IP "\-e TIME, \-\-expiration=TIME"
+Specifies expiration time of record to add; format is relative time, i.e "1 h" or "7 d 30 m". Supported units are "ms", "s", "min" or "minutes", "h" (hours), "d" (days) and "a" (years).
+.B
.IP "\-h, \-\-help"
Print short help on options.
.B
.IP "\-L LOGLEVEL, \-\-loglevel=LOGLEVEL"
Use LOGLEVEL for logging. Valid values are DEBUG, INFO, WARNING and ERROR.
.B
+.IP "\-n NAME, \-\-name=NAME"
+Name of the record to add/delete/display
+.B
+.IP "\-t TYPE, \-\-type=TYPE"
+Type of the record to add/delete/display (i.e. "A", "AAAA", "NS", "PKEY", "MX" etc.)
+.B
.IP "\-v, \-\-version"
Print GNUnet version number.
+.B
+.IP "\-V VALUE, \-\-value=VALUE"
+Value to store or remove from the GNS zone. Specific format depends on the record type. A records expect a dotted decimal IPv4 address, AAAA records an IPv6 address, PKEY a public key in GNUnet's printable format, and CNAME and NS records should be a domain name.
+.B
+.IP "\-z FILENAME, \-\-zonekey=FILENAME"
+Specifies the filename with the private key for the zone (mandatory option)
.SH BUGS
* Keyfile to manipulate.
*/
static char *keyfile;
+
+/**
+ * Desired action is to add a record.
+ */
+static int add;
+
+/**
+ * Desired action is to list records.
+ */
+static int list;
+
+/**
+ * Desired action is to remove a record.
+ */
+static int del;
+
+/**
+ * Name of the records to add/list/remove.
+ */
+static char *name;
+
+/**
+ * Value of the record to add/remove.
+ */
+static char *value;
+
+/**
+ * Type of the record to add/remove, NULL to remove all.
+ */
+static char *typestring;
+
+/**
+ * Desired expiration time.
+ */
+static char *expirationstring;
/**
_("Failed to connect to namestore\n"));
return;
}
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &do_shutdown, NULL);
+ GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
main (int argc, char *const *argv)
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ {'a', "add", NULL,
+ gettext_noop ("add record"), 0,
+ &GNUNET_GETOPT_set_one, &add},
+ {'d', "delete", NULL,
+ gettext_noop ("delete record"), 0,
+ &GNUNET_GETOPT_set_one, &del},
+ {'D', "display", NULL,
+ gettext_noop ("display records"), 0,
+ &GNUNET_GETOPT_set_one, &list},
+ {'e', "expiration", "TIME",
+ gettext_noop ("expiration time to use (for adding only)"), 1,
+ &GNUNET_GETOPT_set_string, &expirationstring},
+ {'n', "name", "NAME",
+ gettext_noop ("name of the record to add/delete/display"), 1,
+ &GNUNET_GETOPT_set_string, &name},
+ {'t', "type", "TYPE",
+ gettext_noop ("type of the record to add/delete/display"), 1,
+ &GNUNET_GETOPT_set_string, &typestring},
+ {'V', "value", "VALUE",
+ gettext_noop ("value of the record to add/delete"), 1,
+ &GNUNET_GETOPT_set_string, &value},
{'z', "zonekey", "FILENAME",
gettext_noop ("filename with the zone key"), 1,
&GNUNET_GETOPT_set_string, &keyfile},