2 This file is part of GNUnet.
3 (C) 2011-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.
22 * @file namecache/namecache.h
23 * @brief common internal definitions for namecache service
24 * @author Matthias Wachs
25 * @author Christian Grothoff
31 * Maximum length of any name, including 0-termination.
33 #define MAX_NAME_LEN 256
35 GNUNET_NETWORK_STRUCT_BEGIN
38 * Generic namecache message with op id
40 struct GNUNET_NAMECACHE_Header
43 * header.type will be GNUNET_MESSAGE_TYPE_NAMECACHE_*
44 * header.size will be message size
46 struct GNUNET_MessageHeader header;
51 uint32_t r_id GNUNET_PACKED;
56 * Lookup a block in the namecache
58 struct LookupBlockMessage
61 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK
63 struct GNUNET_NAMECACHE_Header gns_header;
68 struct GNUNET_HashCode query GNUNET_PACKED;
76 struct LookupBlockResponseMessage
79 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK_RESPONSE
81 struct GNUNET_NAMECACHE_Header gns_header;
86 struct GNUNET_TIME_AbsoluteNBO expire;
91 struct GNUNET_CRYPTO_EcdsaSignature signature;
96 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
98 /* follwed by encrypted block data */
103 * Cache a record in the namecache.
105 struct BlockCacheMessage
108 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE
110 struct GNUNET_NAMECACHE_Header gns_header;
115 struct GNUNET_TIME_AbsoluteNBO expire;
120 struct GNUNET_CRYPTO_EcdsaSignature signature;
123 * Derived public key.
125 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
127 /* follwed by encrypted block data */
132 * Response to a request to cache a block.
134 struct BlockCacheResponseMessage
137 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE_RESPONSE
139 struct GNUNET_NAMECACHE_Header gns_header;
142 * #GNUNET_OK on success, #GNUNET_SYSERR error
144 int32_t op_result GNUNET_PACKED;
148 GNUNET_NETWORK_STRUCT_END
151 /* end of namecache.h */