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 /* Followed by char *app_id */
118 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
119 /* Followed by struct GNUNET_MessageHeader *join_msg */
123 /** Compatible parts of HostEnterRequest and GuestEnterRequest */
124 struct PlaceEnterRequest
126 struct GNUNET_MessageHeader header;
128 uint32_t reserved GNUNET_PACKED;
130 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
132 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
136 struct EgoPlacePublicKey
138 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
139 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
143 struct GuestEnterByNameRequest
146 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_BY_NAME
148 struct GNUNET_MessageHeader header;
150 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
152 /* Followed by char *app_id */
153 /* Followed by char *gns_name */
154 /* Followed by char *password */
155 /* Followed by struct GNUNET_MessageHeader *join_msg */
159 struct ZoneAddPlaceRequest
161 struct GNUNET_MessageHeader header;
163 uint32_t relay_count GNUNET_PACKED;
171 * Expiration time: absolute value in us.
173 uint64_t expiration_time;
175 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
177 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
179 struct GNUNET_PeerIdentity origin;
181 /* Followed by const char *name */
182 /* Followed by const char *password */
183 /* Followed by struct GNUNET_PeerIdentity *relays[relay_count] */
187 struct ZoneAddNymRequest
189 struct GNUNET_MessageHeader header;
197 * Expiration time: absolute value in us.
199 uint64_t expiration_time;
201 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
203 struct GNUNET_CRYPTO_EcdsaPublicKey nym_pub_key;
205 /* Followed by const char *name */
208 /**** service -> library ****/
214 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO
216 struct GNUNET_MessageHeader header;
221 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
223 /* Followed by char *name */
227 struct AppPlaceMessage
230 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE
232 struct GNUNET_MessageHeader header;
234 struct GNUNET_CRYPTO_EcdsaPublicKey ego_pub_key;
236 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
242 struct HostEnterAck {
244 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK
246 struct GNUNET_MessageHeader header;
249 * Status code for the operation.
251 uint32_t result_code GNUNET_PACKED;
254 * Last message ID sent to the channel.
256 uint64_t max_message_id GNUNET_PACKED;
259 * Public key of the place.
261 struct GNUNET_CRYPTO_EddsaPublicKey place_pub_key;
266 struct NymEnterRequest
269 * Type: GNUNET_MESSAGE_TYPE_SOCIAL_NYM_ENTER
271 struct GNUNET_MessageHeader header;
274 * Public key of the joining slave.
276 struct GNUNET_CRYPTO_EcdsaPublicKey nym_key;
278 /* Followed by struct GNUNET_MessageHeader join_request */
283 GNUNET_NETWORK_STRUCT_END