aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-gns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gnunet-gns.c')
-rw-r--r--src/gns/gnunet-gns.c59
1 files changed, 57 insertions, 2 deletions
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c
index a56b229b5..b56423c04 100644
--- a/src/gns/gnunet-gns.c
+++ b/src/gns/gnunet-gns.c
@@ -48,6 +48,41 @@ static struct GNUNET_CRYPTO_RsaPrivateKey *zone_pkey;
48 * Keyfile to manipulate. 48 * Keyfile to manipulate.
49 */ 49 */
50static char *keyfile; 50static char *keyfile;
51
52/**
53 * Desired action is to add a record.
54 */
55static int add;
56
57/**
58 * Desired action is to list records.
59 */
60static int list;
61
62/**
63 * Desired action is to remove a record.
64 */
65static int del;
66
67/**
68 * Name of the records to add/list/remove.
69 */
70static char *name;
71
72/**
73 * Value of the record to add/remove.
74 */
75static char *value;
76
77/**
78 * Type of the record to add/remove, NULL to remove all.
79 */
80static char *typestring;
81
82/**
83 * Desired expiration time.
84 */
85static char *expirationstring;
51 86
52 87
53/** 88/**
@@ -113,8 +148,7 @@ run (void *cls, char *const *args, const char *cfgfile,
113 _("Failed to connect to namestore\n")); 148 _("Failed to connect to namestore\n"));
114 return; 149 return;
115 } 150 }
116 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 151 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
117 &do_shutdown, NULL);
118} 152}
119 153
120 154
@@ -129,6 +163,27 @@ int
129main (int argc, char *const *argv) 163main (int argc, char *const *argv)
130{ 164{
131 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 165 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
166 {'a', "add", NULL,
167 gettext_noop ("add record"), 0,
168 &GNUNET_GETOPT_set_one, &add},
169 {'d', "delete", NULL,
170 gettext_noop ("delete record"), 0,
171 &GNUNET_GETOPT_set_one, &del},
172 {'D', "display", NULL,
173 gettext_noop ("display records"), 0,
174 &GNUNET_GETOPT_set_one, &list},
175 {'e', "expiration", "TIME",
176 gettext_noop ("expiration time to use (for adding only)"), 1,
177 &GNUNET_GETOPT_set_string, &expirationstring},
178 {'n', "name", "NAME",
179 gettext_noop ("name of the record to add/delete/display"), 1,
180 &GNUNET_GETOPT_set_string, &name},
181 {'t', "type", "TYPE",
182 gettext_noop ("type of the record to add/delete/display"), 1,
183 &GNUNET_GETOPT_set_string, &typestring},
184 {'V', "value", "VALUE",
185 gettext_noop ("value of the record to add/delete"), 1,
186 &GNUNET_GETOPT_set_string, &value},
132 {'z', "zonekey", "FILENAME", 187 {'z', "zonekey", "FILENAME",
133 gettext_noop ("filename with the zone key"), 1, 188 gettext_noop ("filename with the zone key"), 1,
134 &GNUNET_GETOPT_set_string, &keyfile}, 189 &GNUNET_GETOPT_set_string, &keyfile},