-
-}
-
-
-/**
- * Method called to inform about the egos of this peer.
- *
- * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get,
- * this function is only called ONCE, and 'NULL' being passed in
- * @a ego does indicate an error (i.e. name is taken or no default
- * value is known). If @a ego is non-NULL and if '*ctx'
- * is set in those callbacks, the value WILL be passed to a subsequent
- * call to the identity callback of #GNUNET_IDENTITY_connect (if
- * that one was not NULL).
- *
- * @param cls closure, NULL
- * @param ego ego handle
- * @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_cb (void *cls,
- struct GNUNET_IDENTITY_Ego *ego,
- void **ctx,
- const char *name)
-{
- id_op = NULL;
- if (NULL == ego)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("No ego configured for `dns2gns` subsystem\n"));
- return;
- }
- GNUNET_IDENTITY_ego_get_public_key (ego,
- &my_zone);
- run_dnsd ();
-}
-
-
-/**
- * Main function that will be run.
- *
- * @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param c configuration
- */
-static void
-run (void *cls, char *const *args, const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *c)
-{
- cfg = c;
-
- if (NULL == dns_ip)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("No DNS server specified!\n"));
- return;
- }
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &do_shutdown, NULL);
- if (NULL == gns_zone_str)
- {
- identity = GNUNET_IDENTITY_connect (cfg,
- NULL, NULL);
- id_op = GNUNET_IDENTITY_get (identity,
- "dns2gns",
- &identity_cb,
- NULL);
- return;
- }
- if ( (NULL == gns_zone_str) ||
- (GNUNET_OK !=
- GNUNET_CRYPTO_ecc_public_sign_key_from_string (gns_zone_str,
- strlen (gns_zone_str),
- &my_zone)) )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("No valid GNS zone specified!\n"));
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- run_dnsd ();