one shorten call to analyze
[oweals/gnunet.git] / src / gns / gnunet-service-gns_shorten.h
1 /*
2      This file is part of GNUnet.
3      (C) 2009-2013 Christian Grothoff (and other contributing authors)
4
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.
9
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.
14
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.
19 */
20 /**
21  * @file gns/gnunet-service-gns_shorten.h
22  * @brief GNUnet GNS shortening API
23  * @author Martin Schanzenbach
24  */
25 #ifndef GNS_SHORTEN_H
26 #define GNS_SHORTEN_H
27 #include "gns.h"
28 #include "gnunet_dht_service.h"
29 #include "gnunet_namecache_service.h"
30 #include "gnunet_namestore_service.h"
31
32
33 /**
34  * Initialize the shorten subsystem.
35  * MUST be called before #GNS_shorten_start.
36  *
37  * @param nh handle to the namestore
38  * @param nc the namecache handle
39  * @param dht handle to the dht
40  */
41 void
42 GNS_shorten_init (struct GNUNET_NAMESTORE_Handle *nh,
43                   struct GNUNET_NAMECACHE_Handle *nc,
44                   struct GNUNET_DHT_Handle *dht);
45
46
47 /**
48  * Cleanup shorten: Terminate pending lookups
49  */
50 void
51 GNS_shorten_done (void);
52
53
54 /**
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.
58  *
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
62  */
63 void
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);
68
69
70 #endif