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 HostRelayRequest
87 * - GNUNET_MESSAGE_TYPE_SOCIAL_HOST_RELAY_START
88 * - GNUNET_MESSAGE_TYPE_SOCIAL_HOST_RELAY_STOP
90 struct GNUNET_MessageHeader header;
92 /* Followed by char *method_name */
96 struct HostEnterRequest
99 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER
101 struct GNUNET_MessageHeader header;
103 uint32_t policy GNUNET_PACKED;
105 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
107 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
109 struct GNUNET_CRYPTO_EddsaPrivateKey place_key;
111 /* Followed by char *app_id */
115 struct GuestEnterRequest
118 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER
120 struct GNUNET_MessageHeader header;
122 uint32_t relay_count GNUNET_PACKED;
124 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
126 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
128 struct GNUNET_PeerIdentity origin;
130 uint32_t flags GNUNET_PACKED;
132 /* Followed by char *app_id */
133 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
134 /* Followed by struct GNUNET_MessageHeader *join_msg */
138 /** Compatible parts of HostEnterRequest and GuestEnterRequest */
139 struct PlaceEnterRequest
141 struct GNUNET_MessageHeader header;
143 uint32_t reserved GNUNET_PACKED;
145 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
147 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
151 struct EgoPlacePublicKey
153 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
154 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
158 struct GuestEnterByNameRequest
161 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
163 struct GNUNET_MessageHeader header;
165 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
167 /* Followed by char *app_id */
168 /* Followed by char *gns_name */
169 /* Followed by char *password */
170 /* Followed by struct GNUNET_MessageHeader *join_msg */
174 struct ZoneAddPlaceRequest
176 struct GNUNET_MessageHeader header;
178 uint32_t relay_count GNUNET_PACKED;
186 * Expiration time: absolute value in us.
188 uint64_t expiration_time;
190 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
192 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
194 struct GNUNET_PeerIdentity origin;
196 /* Followed by const char *name */
197 /* Followed by const char *password */
198 /* Followed by struct GNUNET_PeerIdentity *relays[relay_count] */
202 struct ZoneAddNymRequest
204 struct GNUNET_MessageHeader header;
212 * Expiration time: absolute value in us.
214 uint64_t expiration_time;
216 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
218 struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
220 /* Followed by const char *name */
224 /**** service -> library ****/
230 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
232 struct GNUNET_MessageHeader header;
237 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
239 /* Followed by char *name */
243 struct AppPlaceMessage
246 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
248 struct GNUNET_MessageHeader header;
250 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
252 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
260 struct HostEnterAck {
262 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
264 struct GNUNET_MessageHeader header;
267 * Status code for the operation.
269 uint32_t result_code GNUNET_PACKED;
272 * Last message ID sent to the channel.
274 uint64_t max_message_id GNUNET_PACKED;
277 * Public key of the place.
279 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
283 GNUNET_NETWORK_STRUCT_END