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 Affero 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.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
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;
75 struct LookupBlockResponseMessage
78 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK_RESPONSE
80 struct GNUNET_NAMECACHE_Header gns_header;
85 struct GNUNET_TIME_AbsoluteNBO expire;
90 struct GNUNET_CRYPTO_EcdsaSignature signature;
95 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
97 /* follwed by encrypted block data */
102 * Cache a record in the namecache.
104 struct BlockCacheMessage
107 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE
109 struct GNUNET_NAMECACHE_Header gns_header;
114 struct GNUNET_TIME_AbsoluteNBO expire;
119 struct GNUNET_CRYPTO_EcdsaSignature signature;
122 * Derived public key.
124 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
126 /* follwed by encrypted block data */
131 * Response to a request to cache a block.
133 struct BlockCacheResponseMessage
136 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE_RESPONSE
138 struct GNUNET_NAMECACHE_Header gns_header;
141 * #GNUNET_OK on success, #GNUNET_SYSERR error
143 int32_t op_result GNUNET_PACKED;
147 GNUNET_NETWORK_STRUCT_END
150 /* end of namecache.h */