aboutsummaryrefslogtreecommitdiff
path: root/src/namecache/namecache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/namecache/namecache.h')
-rw-r--r--src/namecache/namecache.h151
1 files changed, 0 insertions, 151 deletions
diff --git a/src/namecache/namecache.h b/src/namecache/namecache.h
deleted file mode 100644
index 4c809b4d1..000000000
--- a/src/namecache/namecache.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2011-2013 GNUnet e.V.
4
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.
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 Affero General Public License for more details.
14
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/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21/**
22 * @file namecache/namecache.h
23 * @brief common internal definitions for namecache service
24 * @author Matthias Wachs
25 * @author Christian Grothoff
26 */
27#ifndef NAMECACHE_H
28#define NAMECACHE_H
29
30/**
31 * Maximum length of any name, including 0-termination.
32 */
33#define MAX_NAME_LEN 256
34
35GNUNET_NETWORK_STRUCT_BEGIN
36
37/**
38 * Generic namecache message with op id
39 */
40struct GNUNET_NAMECACHE_Header
41{
42 /**
43 * header.type will be GNUNET_MESSAGE_TYPE_NAMECACHE_*
44 * header.size will be message size
45 */
46 struct GNUNET_MessageHeader header;
47
48 /**
49 * Request ID in NBO
50 */
51 uint32_t r_id GNUNET_PACKED;
52};
53
54
55/**
56 * Lookup a block in the namecache
57 */
58struct LookupBlockMessage
59{
60 /**
61 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK
62 */
63 struct GNUNET_NAMECACHE_Header gns_header;
64
65 /**
66 * The query.
67 */
68 struct GNUNET_HashCode query GNUNET_PACKED;
69};
70
71
72/**
73 * Lookup response
74 */
75struct LookupBlockResponseMessage
76{
77 /**
78 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK_RESPONSE
79 */
80 struct GNUNET_NAMECACHE_Header gns_header;
81
82 /**
83 * Expiration time
84 */
85 struct GNUNET_TIME_AbsoluteNBO expire;
86
87 /**
88 * Signature.
89 */
90 struct GNUNET_CRYPTO_EcdsaSignature signature;
91
92 /**
93 * Derived public key.
94 */
95 struct GNUNET_IDENTITY_PublicKey derived_key;
96
97 /* followed by encrypted block data */
98};
99
100
101/**
102 * Cache a record in the namecache.
103 */
104struct BlockCacheMessage
105{
106 /**
107 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE
108 */
109 struct GNUNET_NAMECACHE_Header gns_header;
110
111 /**
112 * Expiration time
113 */
114 struct GNUNET_TIME_AbsoluteNBO expire;
115
116 /**
117 * Signature.
118 */
119 struct GNUNET_CRYPTO_EcdsaSignature signature;
120
121 /**
122 * Derived public key.
123 */
124 struct GNUNET_IDENTITY_PublicKey derived_key;
125
126 /* followed by encrypted block data */
127};
128
129
130/**
131 * Response to a request to cache a block.
132 */
133struct BlockCacheResponseMessage
134{
135 /**
136 * Type will be #GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE_RESPONSE
137 */
138 struct GNUNET_NAMECACHE_Header gns_header;
139
140 /**
141 * #GNUNET_OK on success, #GNUNET_SYSERR error
142 */
143 int32_t op_result GNUNET_PACKED;
144};
145
146
147GNUNET_NETWORK_STRUCT_END
148
149
150/* end of namecache.h */
151#endif