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.
17 * @file social/social.h
18 * @brief Common type definitions for the Social service and API.
19 * @author Gabor X Toth
26 #include "gnunet_social_service.h"
33 MSG_STATE_MODIFIER = 3,
34 MSG_STATE_MOD_CONT = 4,
42 GNUNET_NETWORK_STRUCT_BEGIN
44 /**** library -> service ****/
47 struct AppConnectRequest
50 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_CONNECT
52 struct GNUNET_MessageHeader header;
54 /* Followed by char *app_id */
58 struct AppDetachRequest
61 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_DETACH
63 struct GNUNET_MessageHeader header;
66 * Public key of place.
68 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
73 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
78 uint64_t op_id GNUNET_PACKED;
85 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET
87 struct GNUNET_MessageHeader header;
90 * @see enum GNUNET_SOCIAL_MsgProcFlags
94 /* Followed by char *method_prefix */
98 struct HostEnterRequest
101 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER
103 struct GNUNET_MessageHeader header;
105 uint32_t policy GNUNET_PACKED;
107 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
109 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
111 struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
113 /* Followed by char *app_id */
117 struct GuestEnterRequest
120 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER
122 struct GNUNET_MessageHeader header;
124 uint32_t relay_count GNUNET_PACKED;
126 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
128 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
130 struct GNUNET_PeerIdentity origin;
132 uint32_t flags GNUNET_PACKED;
134 /* Followed by char *app_id */
135 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
136 /* Followed by struct GNUNET_MessageHeader *join_msg */
140 /** Compatible parts of HostEnterRequest and GuestEnterRequest */
141 struct PlaceEnterRequest
143 struct GNUNET_MessageHeader header;
145 uint32_t reserved GNUNET_PACKED;
147 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
149 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
153 struct EgoPlacePublicKey
155 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
156 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
160 struct GuestEnterByNameRequest
163 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
165 struct GNUNET_MessageHeader header;
167 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
169 /* Followed by char *app_id */
170 /* Followed by char *gns_name */
171 /* Followed by char *password */
172 /* Followed by struct GNUNET_MessageHeader *join_msg */
176 struct ZoneAddPlaceRequest
178 struct GNUNET_MessageHeader header;
180 uint32_t relay_count GNUNET_PACKED;
188 * Expiration time: absolute value in us.
190 uint64_t expiration_time;
192 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
194 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
196 struct GNUNET_PeerIdentity origin;
198 /* Followed by const char *name */
199 /* Followed by const char *password */
200 /* Followed by struct GNUNET_PeerIdentity *relays[relay_count] */
204 struct ZoneAddNymRequest
206 struct GNUNET_MessageHeader header;
214 * Expiration time: absolute value in us.
216 uint64_t expiration_time;
218 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
220 struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
222 /* Followed by const char *name */
226 /**** service -> library ****/
232 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
234 struct GNUNET_MessageHeader header;
239 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
241 /* Followed by char *name */
245 struct AppPlaceMessage
248 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
250 struct GNUNET_MessageHeader header;
252 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
254 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
262 struct HostEnterAck {
264 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
266 struct GNUNET_MessageHeader header;
269 * Status code for the operation.
271 uint32_t result_code GNUNET_PACKED;
274 * Last message ID sent to the channel.
276 uint64_t max_message_id GNUNET_PACKED;
279 * Public key of the place.
281 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
285 GNUNET_NETWORK_STRUCT_END