2 This file is part of GNUnet.
3 Copyright (C) 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/>.
20 * @author Christian Grothoff
21 * @file identity/identity.h
23 * @brief Common type definitions for the identity
29 #include "gnunet_common.h"
32 GNUNET_NETWORK_STRUCT_BEGIN
36 * Answer from service to client about last operation;
37 * GET_DEFAULT maybe answered with this message on failure;
38 * CREATE and RENAME will always be answered with this message.
40 struct ResultCodeMessage
43 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE
45 struct GNUNET_MessageHeader header;
48 * Status code for the last operation, in NBO.
49 * (currently not used).
51 uint32_t result_code GNUNET_PACKED;
53 /* followed by 0-terminated error message (on error) */
59 * Service informs client about status of a pseudonym.
64 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE
66 struct GNUNET_MessageHeader header;
69 * Number of bytes in ego name string including 0-termination, in NBO;
70 * 0 if the ego was deleted.
72 uint16_t name_len GNUNET_PACKED;
75 * Usually #GNUNET_NO, #GNUNET_YES to signal end of list.
77 uint16_t end_of_list GNUNET_PACKED;
82 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
84 /* followed by 0-terminated ego name */
91 * Client requests knowledge about default identity for
92 * a subsystem from identity service.
94 struct GetDefaultMessage
97 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT
99 struct GNUNET_MessageHeader header;
102 * Number of bytes in service name string including 0-termination, in NBO.
104 uint16_t name_len GNUNET_PACKED;
109 uint16_t reserved GNUNET_PACKED;
112 /* followed by 0-terminated service name */
118 * Used from service to client as a result to the GET_DEFAULT
119 * message, used from client to service to SET_DEFAULT.
121 struct SetDefaultMessage
124 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
126 struct GNUNET_MessageHeader header;
129 * Number of bytes in service name string including 0-termination, in NBO.
131 uint16_t name_len GNUNET_PACKED;
136 uint16_t reserved GNUNET_PACKED;
141 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
143 /* followed by 0-terminated service name */
149 * Client requests creation of an identity. Service
150 * will respond with a result code.
152 struct CreateRequestMessage
155 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE
157 struct GNUNET_MessageHeader header;
160 * Number of bytes in identity name string including 0-termination, in NBO.
162 uint16_t name_len GNUNET_PACKED;
167 uint16_t reserved GNUNET_PACKED;
172 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
174 /* followed by 0-terminated identity name */
180 * Client requests renaming of an identity. Service
181 * will respond with a result code.
186 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME
188 struct GNUNET_MessageHeader header;
191 * Number of characters in the old name including 0-termination, in NBO.
193 uint16_t old_name_len GNUNET_PACKED;
196 * Number of characters in the new name including 0-termination, in NBO.
198 uint16_t new_name_len GNUNET_PACKED;
200 /* followed by 0-terminated old name */
201 /* followed by 0-terminated new name */
206 * Client requests deletion of an identity. Service
207 * will respond with a result code.
212 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE
214 struct GNUNET_MessageHeader header;
217 * Number of characters in the name including 0-termination, in NBO.
219 uint16_t name_len GNUNET_PACKED;
224 uint16_t reserved GNUNET_PACKED;
226 /* followed by 0-terminated name */
232 GNUNET_NETWORK_STRUCT_END