-/**
- * Perform the actual resolution, starting with the zone
- * identified by the given public key and the shorten zone.
- *
- * @param pkey public key to use for the zone, can be NULL
- */
-static void
-lookup_with_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
-{
- if (NULL != lookup_type)
- rtype = GNUNET_GNSRECORD_typename_to_number (lookup_type);
- else
- rtype = GNUNET_DNSPARSER_TYPE_A;
- if (UINT32_MAX == rtype)
- {
- fprintf (stderr,
- _("Invalid typename specified, assuming `ANY'\n"));
- rtype = GNUNET_GNSRECORD_TYPE_ANY;
- }
-
- if (NULL != lookup_name)
- {
- lookup_request = GNUNET_GNS_lookup (gns,
- lookup_name,
- pkey,
- rtype,
- local_options,
- &process_lookup_result,
- lookup_name);
- }
- else
- {
- fprintf (stderr,
- _("Please specify name to lookup!\n"));
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
-}
-
-
-/**
- * Method called to with the ego we are to use for the lookup,
- * when the ego is determined by a name.
- *
- * @param cls closure (NULL, unused)
- * @param ego ego handle, NULL if not found
- */
-static void
-identity_zone_cb (void *cls,
- const struct GNUNET_IDENTITY_Ego *ego)
-{
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
-
- el = NULL;
- if (NULL == ego)
- {
- fprintf (stderr,
- _("Ego for `%s' not found, cannot perform lookup.\n"),
- zone_ego_name);
- GNUNET_SCHEDULER_shutdown ();
- }
- else
- {
- GNUNET_IDENTITY_ego_get_public_key (ego, &pkey);
- lookup_with_public_key (&pkey);
- }
- GNUNET_free_non_null (zone_ego_name);
- zone_ego_name = NULL;
-}
-
-
-/**
- * Method called to with the ego we are to use for the lookup,
- * when the ego is the one for the default master zone.
- *
- * @param cls closure (NULL, unused)
- * @param ego ego handle, NULL if not found
- * @param ctx context for application to store data for this ego
- * (during the lifetime of this process, initially NULL)
- * @param name name assigned by the user for this ego,
- * NULL if the user just deleted the ego and it
- * must thus no longer be used
- */
-static void
-identity_master_cb (void *cls,
- struct GNUNET_IDENTITY_Ego *ego,
- void **ctx,
- const char *name)
-{
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
- const char *dot;
-
- id_op = NULL;
- if (NULL == ego)
- {
- fprintf (stderr,
- _("Ego for `gns-master' not found, cannot perform lookup. Did you run gnunet-gns-import.sh?\n"));
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- GNUNET_IDENTITY_ego_get_public_key (ego, &pkey);
- /* main name is our own master zone, do no look for that in the DHT */
- local_options = GNUNET_GNS_LO_LOCAL_MASTER;
-
- /* if the name is of the form 'label.gnu', never go to the DHT */
- dot = NULL;
- if (NULL != lookup_name)
- dot = strchr (lookup_name, '.');
- if ( (NULL != dot) &&
- (0 == strcasecmp (dot, ".gnu")) )
- local_options = GNUNET_GNS_LO_NO_DHT;
- lookup_with_public_key (&pkey);
-}
-
-