2 * This file is part of GNUnet
3 * Copyright (C) 2013 Christian Grothoff (and other contributing authors)
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;
83 struct HostEnterRequest
86 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER
88 struct GNUNET_MessageHeader header;
90 uint32_t policy GNUNET_PACKED;
92 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
94 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
96 struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
98 /* Followed by char *app_id */
102 struct GuestEnterRequest
105 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER
107 struct GNUNET_MessageHeader header;
109 uint32_t relay_count GNUNET_PACKED;
111 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
113 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
115 struct GNUNET_PeerIdentity origin;
117 uint32_t flags GNUNET_PACKED;
119 /* Followed by char *app_id */
120 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
121 /* Followed by struct GNUNET_MessageHeader *join_msg */
125 /** Compatible parts of HostEnterRequest and GuestEnterRequest */
126 struct PlaceEnterRequest
128 struct GNUNET_MessageHeader header;
130 uint32_t reserved GNUNET_PACKED;
132 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
134 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
138 struct EgoPlacePublicKey
140 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
141 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
145 struct GuestEnterByNameRequest
148 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
150 struct GNUNET_MessageHeader header;
152 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
154 /* Followed by char *app_id */
155 /* Followed by char *gns_name */
156 /* Followed by char *password */
157 /* Followed by struct GNUNET_MessageHeader *join_msg */
161 struct ZoneAddPlaceRequest
163 struct GNUNET_MessageHeader header;
165 uint32_t relay_count GNUNET_PACKED;
173 * Expiration time: absolute value in us.
175 uint64_t expiration_time;
177 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
179 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
181 struct GNUNET_PeerIdentity origin;
183 /* Followed by const char *name */
184 /* Followed by const char *password */
185 /* Followed by struct GNUNET_PeerIdentity *relays[relay_count] */
189 struct ZoneAddNymRequest
191 struct GNUNET_MessageHeader header;
199 * Expiration time: absolute value in us.
201 uint64_t expiration_time;
203 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
205 struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
207 /* Followed by const char *name */
210 /**** service -> library ****/
216 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
218 struct GNUNET_MessageHeader header;
223 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
225 /* Followed by char *name */
229 struct AppPlaceMessage
232 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
234 struct GNUNET_MessageHeader header;
236 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
238 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
246 struct HostEnterAck {
248 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
250 struct GNUNET_MessageHeader header;
253 * Status code for the operation.
255 uint32_t result_code GNUNET_PACKED;
258 * Last message ID sent to the channel.
260 uint64_t max_message_id GNUNET_PACKED;
263 * Public key of the place.
265 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
270 struct NymEnterRequest
273 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_NYM_ENTER
275 struct GNUNET_MessageHeader header;
278 * Public key of the joining slave.
280 struct GNUNET_CRYPTO_EcdsaPublicKey nym_key;
282 /* Followed by struct GNUNET_MessageHeader join_request */
287 GNUNET_NETWORK_STRUCT_END