diff options
Diffstat (limited to 'src/zklaim/zklaim_api.h')
-rw-r--r-- | src/zklaim/zklaim_api.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/zklaim/zklaim_api.h b/src/zklaim/zklaim_api.h new file mode 100644 index 000000000..77053c667 --- /dev/null +++ b/src/zklaim/zklaim_api.h | |||
@@ -0,0 +1,90 @@ | |||
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 | |||
19 | /** | ||
20 | * @author Martin Schanzenbach | ||
21 | * @file zklaim/zklaim.h | ||
22 | * | ||
23 | * @brief Common type definitions for the zklaim | ||
24 | * service and API. | ||
25 | */ | ||
26 | #ifndef ZKLAIM_API_H | ||
27 | #define ZKLAIM_API_H | ||
28 | |||
29 | #include "gnunet_common.h" | ||
30 | |||
31 | |||
32 | GNUNET_NETWORK_STRUCT_BEGIN | ||
33 | |||
34 | |||
35 | /** | ||
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. | ||
39 | */ | ||
40 | struct ResultCodeMessage | ||
41 | { | ||
42 | /** | ||
43 | * Type: #GNUNET_MESSAGE_TYPE_ZKLAIM_RESULT_CODE | ||
44 | */ | ||
45 | struct GNUNET_MessageHeader header; | ||
46 | |||
47 | /** | ||
48 | * Status code for the last operation, in NBO. | ||
49 | * (currently not used). | ||
50 | */ | ||
51 | uint32_t result_code GNUNET_PACKED; | ||
52 | |||
53 | /* followed by 0-terminated error message (on error) */ | ||
54 | |||
55 | }; | ||
56 | |||
57 | |||
58 | /** | ||
59 | * Client requests creation of an identity. Service | ||
60 | * will respond with a result code. | ||
61 | */ | ||
62 | struct CreateRequestMessage | ||
63 | { | ||
64 | /** | ||
65 | * Type: #GNUNET_MESSAGE_TYPE_ZKLAIM_CREATE | ||
66 | */ | ||
67 | struct GNUNET_MessageHeader header; | ||
68 | |||
69 | /** | ||
70 | * Number of bytes in identity name string including 0-termination, in NBO. | ||
71 | */ | ||
72 | uint16_t name_len GNUNET_PACKED; | ||
73 | |||
74 | /** | ||
75 | * Always zero. | ||
76 | */ | ||
77 | uint16_t reserved GNUNET_PACKED; | ||
78 | |||
79 | /** | ||
80 | * The private key | ||
81 | */ | ||
82 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; | ||
83 | |||
84 | /* followed by 0-terminated identity name */ | ||
85 | |||
86 | }; | ||
87 | |||
88 | GNUNET_NETWORK_STRUCT_END | ||
89 | |||
90 | #endif | ||