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 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
83 uint64_t op_id GNUNET_PACKED;
90 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET
92 struct GNUNET_MessageHeader header;
95 * @see enum GNUNET_SOCIAL_MsgProcFlags
99 /* Followed by char *method_prefix */
103 struct HostEnterRequest
106 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER
108 struct GNUNET_MessageHeader header;
110 uint32_t policy GNUNET_PACKED;
112 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
114 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
116 struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
118 /* Followed by char *app_id */
122 struct GuestEnterRequest
125 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER
127 struct GNUNET_MessageHeader header;
129 uint32_t relay_count GNUNET_PACKED;
131 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
133 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
135 struct GNUNET_PeerIdentity origin;
137 uint32_t flags GNUNET_PACKED;
139 /* Followed by char *app_id */
140 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
141 /* Followed by struct GNUNET_MessageHeader *join_msg */
145 /** Compatible parts of HostEnterRequest and GuestEnterRequest */
146 struct PlaceEnterRequest
148 struct GNUNET_MessageHeader header;
150 uint32_t reserved GNUNET_PACKED;
152 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
154 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
158 struct EgoPlacePublicKey
160 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
161 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
165 struct GuestEnterByNameRequest
168 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
170 struct GNUNET_MessageHeader header;
172 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
174 /* Followed by char *app_id */
175 /* Followed by char *gns_name */
176 /* Followed by char *password */
177 /* Followed by struct GNUNET_MessageHeader *join_msg */
181 struct ZoneAddPlaceRequest
183 struct GNUNET_MessageHeader header;
185 uint32_t relay_count GNUNET_PACKED;
193 * Expiration time: absolute value in us.
195 uint64_t expiration_time;
197 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
199 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
201 struct GNUNET_PeerIdentity origin;
203 /* Followed by const char *name */
204 /* Followed by const char *password */
205 /* Followed by struct GNUNET_PeerIdentity *relays[relay_count] */
209 struct ZoneAddNymRequest
211 struct GNUNET_MessageHeader header;
219 * Expiration time: absolute value in us.
221 uint64_t expiration_time;
223 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
225 struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
227 /* Followed by const char *name */
231 /**** service -> library ****/
237 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
239 struct GNUNET_MessageHeader header;
244 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
246 /* Followed by char *name */
250 struct AppPlaceMessage
253 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
255 struct GNUNET_MessageHeader header;
257 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
259 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
267 struct HostEnterAck {
269 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
271 struct GNUNET_MessageHeader header;
274 * Status code for the operation.
276 uint32_t result_code GNUNET_PACKED;
279 * Last message ID sent to the channel.
281 uint64_t max_message_id GNUNET_PACKED;
284 * Public key of the place.
286 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
290 GNUNET_NETWORK_STRUCT_END