2 This file is part of GNUnet.
3 Copyright (C) 2011-2013 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your 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 Affero General Public License for more details.
17 * @file namecache/namecache.h
18 * @brief common internal definitions for namecache service
19 * @author Matthias Wachs
20 * @author Christian Grothoff
26 * Maximum length of any name, including 0-termination.
28 #define MAX_NAME_LEN 256
30 GNUNET_NETWORK_STRUCT_BEGIN
33 * Generic namecache message with op id
35 struct GNUNET_NAMECACHE_Header
38 * header.type will be GNUNET_MESSAGE_TYPE_NAMECACHE_*
39 * header.size will be message size
41 struct GNUNET_MessageHeader header;
46 uint32_t r_id GNUNET_PACKED;
51 * Lookup a block in the namecache
53 struct LookupBlockMessage
56 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK
58 struct GNUNET_NAMECACHE_Header gns_header;
63 struct GNUNET_HashCode query GNUNET_PACKED;
71 struct LookupBlockResponseMessage
74 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK_RESPONSE
76 struct GNUNET_NAMECACHE_Header gns_header;
81 struct GNUNET_TIME_AbsoluteNBO expire;
86 struct GNUNET_CRYPTO_EcdsaSignature signature;
91 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
93 /* follwed by encrypted block data */
98 * Cache a record in the namecache.
100 struct BlockCacheMessage
103 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE
105 struct GNUNET_NAMECACHE_Header gns_header;
110 struct GNUNET_TIME_AbsoluteNBO expire;
115 struct GNUNET_CRYPTO_EcdsaSignature signature;
118 * Derived public key.
120 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
122 /* follwed by encrypted block data */
127 * Response to a request to cache a block.
129 struct BlockCacheResponseMessage
132 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE_RESPONSE
134 struct GNUNET_NAMECACHE_Header gns_header;
137 * #GNUNET_OK on success, #GNUNET_SYSERR error
139 int32_t op_result GNUNET_PACKED;
143 GNUNET_NETWORK_STRUCT_END
146 /* end of namecache.h */