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.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c
index e7e2404f6..713f94b92 100644
--- a/src/gns/gnunet-gns.c
+++ b/src/gns/gnunet-gns.c
@@ -70,7 +70,7 @@ static int raw;
70static int rtype; 70static int rtype;
71 71
72/** 72/**
73 * Handle to lookup request 73 * Handle to lookup request
74 */ 74 */
75static struct GNUNET_GNS_LookupRequest *lookup_request; 75static struct GNUNET_GNS_LookupRequest *lookup_request;
76 76
@@ -144,13 +144,13 @@ process_lookup_result (void *cls, uint32_t rd_count,
144 const char *typename; 144 const char *typename;
145 char* string_val; 145 char* string_val;
146 146
147 lookup_request = NULL; 147 lookup_request = NULL;
148 if (!raw) 148 if (!raw)
149 { 149 {
150 if (0 == rd_count) 150 if (0 == rd_count)
151 printf ("No results.\n"); 151 printf ("No results.\n");
152 else 152 else
153 printf ("%s:\n", 153 printf ("%s:\n",
154 name); 154 name);
155 } 155 }
156 for (i=0; i<rd_count; i++) 156 for (i=0; i<rd_count; i++)
@@ -171,11 +171,11 @@ process_lookup_result (void *cls, uint32_t rd_count,
171 continue; 171 continue;
172 } 172 }
173 if (raw) 173 if (raw)
174 printf ("%s\n", 174 printf ("%s\n",
175 string_val); 175 string_val);
176 else 176 else
177 printf ("Got `%s' record: %s\n", 177 printf ("Got `%s' record: %s\n",
178 typename, 178 typename,
179 string_val); 179 string_val);
180 GNUNET_free (string_val); 180 GNUNET_free (string_val);
181 } 181 }
@@ -201,13 +201,13 @@ lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey,
201 201
202 if (NULL != lookup_name) 202 if (NULL != lookup_name)
203 { 203 {
204 lookup_request = GNUNET_GNS_lookup (gns, 204 lookup_request = GNUNET_GNS_lookup (gns,
205 lookup_name, 205 lookup_name,
206 pkey, 206 pkey,
207 rtype, 207 rtype,
208 GNUNET_NO, /* Use DHT */ 208 GNUNET_NO, /* Use DHT */
209 shorten_key, 209 shorten_key,
210 &process_lookup_result, 210 &process_lookup_result,
211 lookup_name); 211 lookup_name);
212 } 212 }
213 else 213 else
@@ -220,7 +220,7 @@ lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey,
220} 220}
221 221
222 222
223/** 223/**
224 * Method called to with the ego we are to use for shortening 224 * Method called to with the ego we are to use for shortening
225 * during the lookup. 225 * during the lookup.
226 * 226 *
@@ -232,7 +232,7 @@ lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey,
232 * NULL if the user just deleted the ego and it 232 * NULL if the user just deleted the ego and it
233 * must thus no longer be used 233 * must thus no longer be used
234 */ 234 */
235static void 235static void
236identity_shorten_cb (void *cls, 236identity_shorten_cb (void *cls,
237 struct GNUNET_IDENTITY_Ego *ego, 237 struct GNUNET_IDENTITY_Ego *ego,
238 void **ctx, 238 void **ctx,
@@ -276,21 +276,21 @@ lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey)
276} 276}
277 277
278 278
279/** 279/**
280 * Method called to with the ego we are to use for the lookup, 280 * Method called to with the ego we are to use for the lookup,
281 * when the ego is determined by a name. 281 * when the ego is determined by a name.
282 * 282 *
283 * @param cls closure (NULL, unused) 283 * @param cls closure (NULL, unused)
284 * @param ego ego handle, NULL if not found 284 * @param ego ego handle, NULL if not found
285 */ 285 */
286static void 286static void
287identity_zone_cb (void *cls, 287identity_zone_cb (void *cls,
288 const struct GNUNET_IDENTITY_Ego *ego) 288 const struct GNUNET_IDENTITY_Ego *ego)
289{ 289{
290 struct GNUNET_CRYPTO_EccPublicSignKey pkey; 290 struct GNUNET_CRYPTO_EccPublicSignKey pkey;
291 291
292 el = NULL; 292 el = NULL;
293 if (NULL == ego) 293 if (NULL == ego)
294 { 294 {
295 fprintf (stderr, 295 fprintf (stderr,
296 _("Ego for `%s' not found, cannot perform lookup.\n"), 296 _("Ego for `%s' not found, cannot perform lookup.\n"),
@@ -307,7 +307,7 @@ identity_zone_cb (void *cls,
307} 307}
308 308
309 309
310/** 310/**
311 * Method called to with the ego we are to use for the lookup, 311 * Method called to with the ego we are to use for the lookup,
312 * when the ego is the one for the default master zone. 312 * when the ego is the one for the default master zone.
313 * 313 *
@@ -319,7 +319,7 @@ identity_zone_cb (void *cls,
319 * NULL if the user just deleted the ego and it 319 * NULL if the user just deleted the ego and it
320 * must thus no longer be used 320 * must thus no longer be used
321 */ 321 */
322static void 322static void
323identity_master_cb (void *cls, 323identity_master_cb (void *cls,
324 struct GNUNET_IDENTITY_Ego *ego, 324 struct GNUNET_IDENTITY_Ego *ego,
325 void **ctx, 325 void **ctx,
@@ -328,7 +328,7 @@ identity_master_cb (void *cls,
328 struct GNUNET_CRYPTO_EccPublicSignKey pkey; 328 struct GNUNET_CRYPTO_EccPublicSignKey pkey;
329 329
330 id_op = NULL; 330 id_op = NULL;
331 if (NULL == ego) 331 if (NULL == ego)
332 { 332 {
333 fprintf (stderr, 333 fprintf (stderr,
334 _("Ego for `master-zone' not found, cannot perform lookup. Did you run gnunet-gns-import.sh?\n")); 334 _("Ego for `master-zone' not found, cannot perform lookup. Did you run gnunet-gns-import.sh?\n"));
@@ -372,7 +372,7 @@ run (void *cls, char *const *args, const char *cfgfile,
372 strlen (public_key), 372 strlen (public_key),
373 &pkey)) 373 &pkey))
374 { 374 {
375 fprintf (stderr, 375 fprintf (stderr,
376 _("Public key `%s' is not well-formed\n"), 376 _("Public key `%s' is not well-formed\n"),
377 public_key); 377 public_key);
378 GNUNET_SCHEDULER_shutdown (); 378 GNUNET_SCHEDULER_shutdown ();
@@ -383,7 +383,7 @@ run (void *cls, char *const *args, const char *cfgfile,
383 } 383 }
384 if (NULL != zone_ego_name) 384 if (NULL != zone_ego_name)
385 { 385 {
386 el = GNUNET_IDENTITY_ego_lookup (cfg, 386 el = GNUNET_IDENTITY_ego_lookup (cfg,
387 zone_ego_name, 387 zone_ego_name,
388 &identity_zone_cb, 388 &identity_zone_cb,
389 NULL); 389 NULL);
@@ -447,7 +447,7 @@ main (int argc, char *const *argv)
447 ret = 447 ret =
448 (GNUNET_OK == 448 (GNUNET_OK ==
449 GNUNET_PROGRAM_run (argc, argv, "gnunet-gns", 449 GNUNET_PROGRAM_run (argc, argv, "gnunet-gns",
450 _("GNUnet GNS resolver tool"), 450 _("GNUnet GNS resolver tool"),
451 options, 451 options,
452 &run, NULL)) ? 0 : 1; 452 &run, NULL)) ? 0 : 1;
453 GNUNET_free ((void*) argv); 453 GNUNET_free ((void*) argv);