gnunet-service-gns_shorten.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. This file is part of GNUnet.
  3. (C) 2009-2013 Christian Grothoff (and other contributing authors)
  4. GNUnet is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published
  6. by the Free Software Foundation; either version 3, or (at your
  7. option) any later version.
  8. GNUnet is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNUnet; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17. /**
  18. * @file gns/gnunet-service-gns_shorten.h
  19. * @brief GNUnet GNS shortening API
  20. * @author Martin Schanzenbach
  21. */
  22. #ifndef GNS_SHORTEN_H
  23. #define GNS_SHORTEN_H
  24. #include "gns.h"
  25. #include "gnunet_dht_service.h"
  26. #include "gnunet_namecache_service.h"
  27. #include "gnunet_namestore_service.h"
  28. /**
  29. * Initialize the shorten subsystem.
  30. * MUST be called before #GNS_shorten_start.
  31. *
  32. * @param nh handle to the namestore
  33. * @param nc the namecache handle
  34. * @param dht handle to the dht
  35. */
  36. void
  37. GNS_shorten_init (struct GNUNET_NAMESTORE_Handle *nh,
  38. struct GNUNET_NAMECACHE_Handle *nc,
  39. struct GNUNET_DHT_Handle *dht);
  40. /**
  41. * Cleanup shorten: Terminate pending lookups
  42. */
  43. void
  44. GNS_shorten_done (void);
  45. /**
  46. * Start shortening algorithm, try to allocate a nice short
  47. * canonical name for @a pub in @a shorten_zone, using
  48. * @a original_label as one possible suggestion.
  49. *
  50. * @param original_label original label for the zone
  51. * @param pub public key of the zone to shorten
  52. * @param shorten_zone private key of the target zone for the new record
  53. */
  54. void
  55. GNS_shorten_start (const char *original_label,
  56. const char *suggested_label,
  57. const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
  58. const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone);
  59. #endif