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