aboutsummaryrefslogtreecommitdiff
path: root/src/identity/identity.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/identity/identity.h')
-rw-r--r--src/identity/identity.h281
1 files changed, 0 insertions, 281 deletions
diff --git a/src/identity/identity.h b/src/identity/identity.h
deleted file mode 100644
index 11c5883bc..000000000
--- a/src/identity/identity.h
+++ /dev/null
@@ -1,281 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 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 * @author Christian Grothoff
23 * @file identity/identity.h
24 *
25 * @brief Common type definitions for the identity
26 * service and API.
27 */
28#ifndef IDENTITY_H
29#define IDENTITY_H
30
31#include "gnunet_common.h"
32
33/**
34 * Handle for an ego.
35 */
36struct GNUNET_IDENTITY_Ego
37{
38 /**
39 * Hash of the private key of this ego.
40 */
41 struct GNUNET_HashCode id;
42
43 /**
44 * The identity key pair
45 */
46 struct GNUNET_IDENTITY_PublicKey pub;
47
48 /**
49 * The identity key pair
50 */
51 struct GNUNET_IDENTITY_PrivateKey pk;
52
53 /**
54 * Current name associated with this ego.
55 */
56 char *name;
57
58 /**
59 * Client context associated with this ego.
60 */
61 void *ctx;
62
63 /**
64 * Set to true once @e pub was initialized
65 */
66 bool pub_initialized;
67};
68
69
70
71
72GNUNET_NETWORK_STRUCT_BEGIN
73
74
75/**
76 * Answer from service to client about last operation;
77 * GET_DEFAULT maybe answered with this message on failure;
78 * CREATE and RENAME will always be answered with this message.
79 */
80struct ResultCodeMessage
81{
82 /**
83 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE
84 */
85 struct GNUNET_MessageHeader header;
86
87 /**
88 * Status code for the last operation, in NBO.
89 * (currently not used).
90 */
91 uint32_t result_code GNUNET_PACKED;
92
93 /* followed by 0-terminated error message (on error) */
94};
95
96
97/**
98 * Client informs service about desire to lookup a (single) pseudonym.
99 */
100struct LookupMessage
101{
102 /**
103 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP or
104 * #GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP_BY_SUFFIX
105 */
106 struct GNUNET_MessageHeader header;
107
108 /* followed by 0-terminated ego name */
109};
110
111
112/**
113 * Service informs client about status of a pseudonym.
114 */
115struct UpdateMessage
116{
117 /**
118 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE
119 */
120 struct GNUNET_MessageHeader header;
121
122 /**
123 * Number of bytes in ego name string including 0-termination, in NBO;
124 * 0 if the ego was deleted.
125 */
126 uint16_t name_len GNUNET_PACKED;
127
128 /**
129 * Usually #GNUNET_NO, #GNUNET_YES to signal end of list.
130 */
131 uint16_t end_of_list GNUNET_PACKED;
132
133 /**
134 * The private key
135 */
136 struct GNUNET_IDENTITY_PrivateKey private_key;
137
138 /* followed by 0-terminated ego name */
139};
140
141
142/**
143 * Client requests knowledge about default identity for
144 * a subsystem from identity service.
145 */
146struct GetDefaultMessage
147{
148 /**
149 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT
150 */
151 struct GNUNET_MessageHeader header;
152
153 /**
154 * Number of bytes in service name string including 0-termination, in NBO.
155 */
156 uint16_t name_len GNUNET_PACKED;
157
158 /**
159 * Always zero.
160 */
161 uint16_t reserved GNUNET_PACKED;
162
163
164 /* followed by 0-terminated service name */
165};
166
167
168/**
169 * Used from service to client as a result to the GET_DEFAULT
170 * message, used from client to service to SET_DEFAULT.
171 */
172struct SetDefaultMessage
173{
174 /**
175 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
176 */
177 struct GNUNET_MessageHeader header;
178
179 /**
180 * Number of bytes in service name string including 0-termination, in NBO.
181 */
182 uint16_t name_len GNUNET_PACKED;
183
184 /**
185 * Always zero.
186 */
187 uint16_t reserved GNUNET_PACKED;
188
189 /**
190 * The private key
191 */
192 struct GNUNET_IDENTITY_PrivateKey private_key;
193
194 /* followed by 0-terminated service name */
195};
196
197
198/**
199 * Client requests creation of an identity. Service
200 * will respond with a result code.
201 */
202struct CreateRequestMessage
203{
204 /**
205 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE
206 */
207 struct GNUNET_MessageHeader header;
208
209 /**
210 * Number of bytes in identity name string including 0-termination, in NBO.
211 */
212 uint16_t name_len GNUNET_PACKED;
213
214 /**
215 * Always zero.
216 */
217 uint16_t reserved GNUNET_PACKED;
218
219 /**
220 * The private key
221 */
222 struct GNUNET_IDENTITY_PrivateKey private_key;
223
224 /* followed by 0-terminated identity name */
225};
226
227
228/**
229 * Client requests renaming of an identity. Service
230 * will respond with a result code.
231 */
232struct RenameMessage
233{
234 /**
235 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME
236 */
237 struct GNUNET_MessageHeader header;
238
239 /**
240 * Number of characters in the old name including 0-termination, in NBO.
241 */
242 uint16_t old_name_len GNUNET_PACKED;
243
244 /**
245 * Number of characters in the new name including 0-termination, in NBO.
246 */
247 uint16_t new_name_len GNUNET_PACKED;
248
249 /* followed by 0-terminated old name */
250 /* followed by 0-terminated new name */
251};
252
253
254/**
255 * Client requests deletion of an identity. Service
256 * will respond with a result code.
257 */
258struct DeleteMessage
259{
260 /**
261 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE
262 */
263 struct GNUNET_MessageHeader header;
264
265 /**
266 * Number of characters in the name including 0-termination, in NBO.
267 */
268 uint16_t name_len GNUNET_PACKED;
269
270 /**
271 * Always zero.
272 */
273 uint16_t reserved GNUNET_PACKED;
274
275 /* followed by 0-terminated name */
276};
277
278GNUNET_NETWORK_STRUCT_END
279
280
281#endif