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
6 * it under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 3, 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., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 * @file social/social.h
23 * @brief Common type definitions for the Social service and API.
24 * @author Gabor X Toth
31 #include "gnunet_social_service.h"
38 MSG_STATE_MODIFIER = 3,
39 MSG_STATE_MOD_CONT = 4,
47 GNUNET_NETWORK_STRUCT_BEGIN
49 /**** library -> service ****/
52 struct AppConnectRequest
55 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_CONNECT
57 struct GNUNET_MessageHeader header;
59 /* Followed by char *app_id */
63 struct AppDetachRequest
66 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_DETACH
68 struct GNUNET_MessageHeader header;
71 * Public key of place.
73 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
78 uint64_t op_id GNUNET_PACKED;
86 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET
88 struct GNUNET_MessageHeader header;
91 * @see enum GNUNET_SOCIAL_MsgProcFlags
95 /* Followed by char *method_prefix */
99 struct HostEnterRequest
102 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER
104 struct GNUNET_MessageHeader header;
106 uint32_t policy GNUNET_PACKED;
108 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
110 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
112 struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
114 /* Followed by char *app_id */
118 struct GuestEnterRequest
121 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER
123 struct GNUNET_MessageHeader header;
125 uint32_t relay_count GNUNET_PACKED;
127 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
129 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
131 struct GNUNET_PeerIdentity origin;
133 uint32_t flags GNUNET_PACKED;
135 /* Followed by char *app_id */
136 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
137 /* Followed by struct GNUNET_MessageHeader *join_msg */
141 /** Compatible parts of HostEnterRequest and GuestEnterRequest */
142 struct PlaceEnterRequest
144 struct GNUNET_MessageHeader header;
146 uint32_t reserved GNUNET_PACKED;
148 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
150 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
154 struct EgoPlacePublicKey
156 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
157 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
161 struct GuestEnterByNameRequest
164 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
166 struct GNUNET_MessageHeader header;
168 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
170 /* Followed by char *app_id */
171 /* Followed by char *gns_name */
172 /* Followed by char *password */
173 /* Followed by struct GNUNET_MessageHeader *join_msg */
177 struct ZoneAddPlaceRequest
179 struct GNUNET_MessageHeader header;
181 uint32_t relay_count GNUNET_PACKED;
189 * Expiration time: absolute value in us.
191 uint64_t expiration_time;
193 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
195 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
197 struct GNUNET_PeerIdentity origin;
199 /* Followed by const char *name */
200 /* Followed by const char *password */
201 /* Followed by struct GNUNET_PeerIdentity *relays[relay_count] */
205 struct ZoneAddNymRequest
207 struct GNUNET_MessageHeader header;
215 * Expiration time: absolute value in us.
217 uint64_t expiration_time;
219 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
221 struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
223 /* Followed by const char *name */
227 /**** service -> library ****/
233 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
235 struct GNUNET_MessageHeader header;
240 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
242 /* Followed by char *name */
246 struct AppPlaceMessage
249 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
251 struct GNUNET_MessageHeader header;
253 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
255 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
263 struct HostEnterAck {
265 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
267 struct GNUNET_MessageHeader header;
270 * Status code for the operation.
272 uint32_t result_code GNUNET_PACKED;
275 * Last message ID sent to the channel.
277 uint64_t max_message_id GNUNET_PACKED;
280 * Public key of the place.
282 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
286 GNUNET_NETWORK_STRUCT_END