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.
23 * @brief Common type definitions for the PSYC service and API.
24 * @author Gabor X Toth
31 #include "gnunet_psyc_service.h"
35 GNUNET_PSYC_check_message_parts (uint16_t data_size, const char *data,
36 uint16_t *first_ptype, uint16_t *last_ptype);
39 GNUNET_PSYC_log_message (enum GNUNET_ErrorType kind,
40 const struct GNUNET_MessageHeader *msg);
48 MSG_STATE_MODIFIER = 3,
49 MSG_STATE_MOD_CONT = 4,
57 enum MessageFragmentState
59 MSG_FRAG_STATE_START = 0,
60 MSG_FRAG_STATE_HEADER = 1,
61 MSG_FRAG_STATE_DATA = 2,
62 MSG_FRAG_STATE_END = 3,
63 MSG_FRAG_STATE_CANCEL = 4,
64 MSG_FRAG_STATE_DROP = 5,
68 GNUNET_NETWORK_STRUCT_BEGIN
71 /**** library -> service ****/
74 struct MasterStartRequest
77 * Type: GNUNET_MESSAGE_TYPE_PSYC_MASTER_START
79 struct GNUNET_MessageHeader header;
81 uint32_t policy GNUNET_PACKED;
83 struct GNUNET_CRYPTO_EddsaPrivateKey channel_key;
87 struct SlaveJoinRequest
90 * Type: GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN
92 struct GNUNET_MessageHeader header;
94 uint32_t relay_count GNUNET_PACKED;
96 struct GNUNET_CRYPTO_EddsaPublicKey channel_pub_key;
98 struct GNUNET_CRYPTO_EcdsaPrivateKey slave_key;
100 struct GNUNET_PeerIdentity origin;
102 uint32_t flags GNUNET_PACKED;
104 /* Followed by struct GNUNET_PeerIdentity relays[relay_count] */
106 /* Followed by struct GNUNET_MessageHeader join_msg */
110 struct ChannelMembershipStoreRequest
113 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_MEMBERSHIP_STORE
115 struct GNUNET_MessageHeader header;
117 uint32_t reserved GNUNET_PACKED;
119 uint64_t op_id GNUNET_PACKED;
121 struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key;
123 uint64_t announced_at GNUNET_PACKED;
125 uint64_t effective_since GNUNET_PACKED;
131 struct HistoryRequest
134 * Type: GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_HISTORY_REQUEST
136 struct GNUNET_MessageHeader header;
138 uint32_t reserved GNUNET_PACKED;
141 * ID for this operation.
143 uint64_t op_id GNUNET_PACKED;
145 uint64_t start_message_id GNUNET_PACKED;
147 uint64_t end_message_id GNUNET_PACKED;
149 uint64_t message_limit GNUNET_PACKED;
157 * - GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STATE_GET
158 * - GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_STATE_GET_PREFIX
160 struct GNUNET_MessageHeader header;
162 uint32_t reserved GNUNET_PACKED;
165 * ID for this operation.
167 uint64_t op_id GNUNET_PACKED;
169 /* Followed by NUL-terminated name. */
173 /**** service -> library ****/
176 GNUNET_NETWORK_STRUCT_END