2 This file is part of GNUnet.
3 (C) 2010,2011 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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @brief automatic transport selection messages
23 * @author Christian Grothoff
24 * @author Matthias Wachs
29 #include "gnunet_util_lib.h"
32 * Flag used to indicate which type of client is connecting
38 START_FLAG_SCHEDULING = 0,
40 START_FLAG_PERFORMANCE_WITH_PIC = 1,
42 START_FLAG_PERFORMANCE_NO_PIC = 2
46 GNUNET_NETWORK_STRUCT_BEGIN
48 struct ClientStartMessage
50 struct GNUNET_MessageHeader header;
53 * NBO value of an `enum StartFlag`.
55 uint32_t start_flag GNUNET_PACKED;
59 struct RequestAddressMessage
61 struct GNUNET_MessageHeader header;
63 uint32_t reserved GNUNET_PACKED;
65 struct GNUNET_PeerIdentity peer;
68 struct ResetBackoffMessage
70 struct GNUNET_MessageHeader header;
72 uint32_t reserved GNUNET_PACKED;
74 struct GNUNET_PeerIdentity peer;
79 * ATS client to ATS service: here is another address you can use.
81 struct AddressAddMessage
84 * Type is #GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD.
86 struct GNUNET_MessageHeader header;
89 * Length of the `struct GNUNET_ATS_Information` array that follows this struct.
91 uint32_t ats_count GNUNET_PACKED;
94 * Identity of the peer that this address is for.
96 struct GNUNET_PeerIdentity peer;
99 * Number of bytes in the address that follows this struct.
101 uint16_t address_length GNUNET_PACKED;
104 * Number of bytes in the plugin name that follows this struct.
106 uint16_t plugin_name_length GNUNET_PACKED;
109 * Internal number this client will henceforth use to
110 * refer to this address.
112 uint32_t session_id GNUNET_PACKED;
115 * Local-only information of the address, see
116 * `enum GNUNET_HELLO_AddressInfo`.
118 uint32_t address_local_info GNUNET_PACKED;
121 * - struct GNUNET_ATS_Information [ats_count];
122 * - char address[address_length]
123 * - char plugin_name[plugin_name_length] (including '\0'-termination).
130 * Message used to notify ATS that the performance
131 * characteristics for an address have changed.
133 struct AddressUpdateMessage
136 * Message of type #GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE.
138 struct GNUNET_MessageHeader header;
141 * Length of the `struct GNUNET_ATS_Information` array that follows.
143 uint32_t ats_count GNUNET_PACKED;
146 * Which peer is this about? (Technically redundant, as the
147 * @e session_id should be sufficient, but enables ATS service
148 * to find the session faster).
150 struct GNUNET_PeerIdentity peer;
153 * Internal number this client uses to refer to this address.
155 uint32_t session_id GNUNET_PACKED;
158 * - struct GNUNET_ATS_Information [ats_count];
165 * Message sent from ATS client to ATS service to notify
166 * it if we started (or stopped) using an address.
168 struct AddressUseMessage
171 * Type is #GNUNET_MESSAGE_TYPE_ATS_ADDRESS_IN_USE.
173 struct GNUNET_MessageHeader header;
176 * Internal number this client uses to refer to this address.
178 uint32_t session_id GNUNET_PACKED;
181 * Which peer is this about? (Technically redundant, as the
182 * @e session_id should be sufficient, but enables ATS service
183 * to find the session faster).
185 struct GNUNET_PeerIdentity peer;
188 * #GNUNET_YES or #GNUNET_NO.
190 uint32_t in_use GNUNET_PACKED;
196 * Message sent by ATS client to ATS service when an address
197 * was destroyed and must thus henceforth no longer be considered
200 struct AddressDestroyedMessage
203 * Type is #GNUNET_MESSAGE_TYPE_ATS_ADDRESS_DESTROYED.
205 struct GNUNET_MessageHeader header;
208 * Internal number this client uses to refer to this address.
210 uint32_t session_id GNUNET_PACKED;
213 * Which peer is this about? (Technically redundant, as the
214 * @e session_id should be sufficient, but enables ATS service
215 * to find the session faster).
217 struct GNUNET_PeerIdentity peer;
222 struct AddressSuggestionMessage
224 struct GNUNET_MessageHeader header;
226 uint32_t ats_count GNUNET_PACKED;
228 struct GNUNET_PeerIdentity peer;
230 uint16_t address_length GNUNET_PACKED;
232 uint16_t plugin_name_length GNUNET_PACKED;
234 uint32_t session_id GNUNET_PACKED;
236 uint32_t address_local_info GNUNET_PACKED;
238 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
240 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
243 * - struct GNUNET_ATS_Information [ats_count];
244 * - char address[address_length]
245 * - char plugin_name[plugin_name_length] (including '\0'-termination).
251 struct PeerInformationMessage
253 struct GNUNET_MessageHeader header;
255 uint32_t ats_count GNUNET_PACKED;
257 uint32_t address_active GNUNET_PACKED;
259 uint32_t id GNUNET_PACKED;
261 struct GNUNET_PeerIdentity peer;
263 uint16_t address_length GNUNET_PACKED;
265 uint16_t plugin_name_length GNUNET_PACKED;
267 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
269 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
272 * - struct GNUNET_ATS_Information [ats_count];
273 * - char address[address_length]
274 * - char plugin_name[plugin_name_length] (including '\0'-termination).
281 * Client to service: please give us an overview of the addresses.
283 struct AddressListRequestMessage
286 * Type is #GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_REQUEST
288 struct GNUNET_MessageHeader header;
291 * ID used to match replies to this request.
293 uint32_t id GNUNET_PACKED;
296 * Which peer do we care about? All zeros for all.
298 struct GNUNET_PeerIdentity peer;
301 * #GNUNET_YES to get information about all addresses,
302 * #GNUNET_NO to only return addresses that are in use.
304 int32_t all GNUNET_PACKED;
309 struct ReservationRequestMessage
311 struct GNUNET_MessageHeader header;
313 int32_t amount GNUNET_PACKED;
315 struct GNUNET_PeerIdentity peer;
320 * Message sent by ATS service to client to confirm that it is done
321 * using the given session ID.
323 struct SessionReleaseMessage
325 struct GNUNET_MessageHeader header;
327 uint32_t session_id GNUNET_PACKED;
329 struct GNUNET_PeerIdentity peer;
333 struct ReservationResultMessage
335 struct GNUNET_MessageHeader header;
337 int32_t amount GNUNET_PACKED;
339 struct GNUNET_PeerIdentity peer;
341 struct GNUNET_TIME_RelativeNBO res_delay;
344 struct PreferenceInformation
347 uint32_t preference_kind GNUNET_PACKED;
349 float preference_value GNUNET_PACKED;
354 struct ChangePreferenceMessage
356 struct GNUNET_MessageHeader header;
358 uint32_t num_preferences GNUNET_PACKED;
360 struct GNUNET_PeerIdentity peer;
362 /* followed by 'num_preferences'
363 * struct PreferenceInformation values */
368 * Message containing application feedback for a peer
370 struct FeedbackPreferenceMessage
372 struct GNUNET_MessageHeader header;
375 * Number of feedback values included
377 uint32_t num_feedback GNUNET_PACKED;
380 * Relative time describing for which time interval this feedback is
382 struct GNUNET_TIME_RelativeNBO scope;
385 * Peer this feedback is for
387 struct GNUNET_PeerIdentity peer;
389 /* followed by 'num_feedback'
390 * struct PreferenceInformation values */
393 GNUNET_NETWORK_STRUCT_END