2 This file is part of GNUnet
3 (C) 2012 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 2, 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 * @brief IPC messages between GNS API and GNS service
23 * @author Martin Schanzenbach
28 #include "gnunet_gns_service.h"
31 * Name of the GADS TLD.
33 #define GNUNET_GNS_TLD "gads"
36 * Name of the zone key TLD.
38 #define GNUNET_GNS_TLD_ZKEY "zkey"
41 * TLD name used to indicate relative names.
43 #define GNUNET_GNS_TLD_PLUS "+"
46 * Maximum length of a label in DNS.
48 #define MAX_DNS_LABEL_LENGTH 63
51 * Maximum length of a name in DNS.
53 #define MAX_DNS_NAME_LENGTH 253
56 GNUNET_NETWORK_STRUCT_BEGIN
59 * Message from client to GNS service to lookup records.
61 struct GNUNET_GNS_ClientLookupMessage
64 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_LOOKUP
66 struct GNUNET_MessageHeader header;
69 * Unique identifier for this request (for key collisions).
71 uint32_t id GNUNET_PACKED;
74 * If use_default_zone is empty this zone is used for lookup
76 struct GNUNET_CRYPTO_ShortHashCode zone;
79 * Only check cached results
81 uint32_t only_cached GNUNET_PACKED;
84 * Should we look up in the default zone?
86 uint32_t use_default_zone GNUNET_PACKED;
89 * Is a shorten key attached?
91 uint32_t have_key GNUNET_PACKED;
94 * the type of record to look up
96 /* enum GNUNET_GNS_RecordType */ uint32_t type;
98 /* Followed by the key for shorten (optional) see have_key */
100 /* Followed by the name to look up */
105 * Message from GNS service to client: new results.
107 struct GNUNET_GNS_ClientLookupResultMessage
110 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_RESULT
112 struct GNUNET_MessageHeader header;
115 * Unique identifier for this request (for key collisions).
117 uint32_t id GNUNET_PACKED;
120 * The number of records contained in response
124 /* followed by rd_count GNUNET_NAMESTORE_RecordData structs*/
130 * Message from client to GNS service to shorten names.
132 struct GNUNET_GNS_ClientShortenMessage
135 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_SHORTEN
137 struct GNUNET_MessageHeader header;
140 * Unique identifier for this request
142 uint32_t id GNUNET_PACKED;
145 * If use_default_zone is empty this zone is used for lookup
147 struct GNUNET_CRYPTO_ShortHashCode zone;
152 struct GNUNET_CRYPTO_ShortHashCode shorten_zone;
157 struct GNUNET_CRYPTO_ShortHashCode private_zone;
160 * Should we look up in the default zone?
162 uint32_t use_default_zone GNUNET_PACKED;
164 /* Followed by the name to shorten up */
169 * Message from GNS service to client: shorten result.
171 struct GNUNET_GNS_ClientShortenResultMessage
174 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_SHORTEN_RESULT
176 struct GNUNET_MessageHeader header;
179 * Unique identifier for this request (for key collisions).
181 uint32_t id GNUNET_PACKED;
183 /* followed by the shortened name or '\0' for no result*/
189 * Message from client to GNS service to lookup an authority of a name.
191 struct GNUNET_GNS_ClientGetAuthMessage
194 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_GET_AUTH
196 struct GNUNET_MessageHeader header;
199 * Unique identifier for this request
201 uint32_t id GNUNET_PACKED;
203 /* Followed by the name to get authority for */
208 * Message from GNS service to client: authority result.
210 struct GNUNET_GNS_ClientGetAuthResultMessage
213 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_GET_AUTH_RESULT
215 struct GNUNET_MessageHeader header;
218 * Unique identifier for this request (for key collisions).
220 uint32_t id GNUNET_PACKED;
222 /* followed by the authority part of the name or '\0' for no result*/
226 GNUNET_NETWORK_STRUCT_END