2 This file is part of GNUnet
3 (C) 2012 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 * @file testbed/testbed.h
23 * @brief IPC messages between testing API and service ("controller")
24 * @author Christian Grothoff
30 #include "gnunet_util_lib.h"
34 * Initial message from a client to a testing control service.
36 struct GNUNET_TESTBED_InitMessage
40 * Type is GNUNET_MESSAGE_TYPE_TESTBED_INIT
42 struct GNUNET_MessageHeader header;
45 * Host ID that the controller is either given (if this is the
46 * dominating client) or assumed to have (for peer-connections
47 * between controllers). A controller must check that all
48 * connections make consistent claims...
50 uint32_t host_id GNUNET_PACKED;
53 * Event mask that specifies which events this client
54 * is interested in. In NBO.
56 uint64_t event_mask GNUNET_PACKED;
61 * Notify the service about a host that we intend to use.
63 struct GNUNET_TESTBED_AddHostMessage
67 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOST
69 struct GNUNET_MessageHeader header;
72 * Unique ID for the host (in NBO).
74 uint32_t host_id GNUNET_PACKED;
77 * SSH port to use, 0 for default (in NBO).
79 uint16_t ssh_port GNUNET_PACKED;
82 * Number of bytes in the user name that follows;
83 * 0 to use no user name; otherwise 'strlen (username)',
84 * excluding 0-termination!
86 uint16_t user_name_length GNUNET_PACKED;
88 /* followed by 0-terminated user name */
90 /* followed by 0-terminated host name */
96 * Confirmation from the service that adding a host
98 * FIXME: Where is this required?
100 struct GNUNET_TESTBED_HostConfirmedMessage
104 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTSUCCESS
106 struct GNUNET_MessageHeader header;
109 * Unique ID for the host (in NBO).
111 uint32_t host_id GNUNET_PACKED;
113 /* followed by the 0-terminated error message (on failure)
114 (typical errors include failure to login and
115 host-id already in use) */
121 * Message to testing service: configure service sharing
124 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
128 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SERVICESHARE
130 struct GNUNET_MessageHeader header;
133 * Host that is being configured.
135 uint32_t host_id GNUNET_PACKED;
138 * Number of peers that should share a service instance;
139 * 1 for no sharing, 0 to forcefully disable the service.
141 uint32_t num_peers GNUNET_PACKED;
143 /* followed by 0-terminated name of the service */
149 * Client notifies controller that it should delegate
150 * requests for a particular client to a particular
153 struct GNUNET_TESTBED_ControllerLinkMessage
157 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS
159 struct GNUNET_MessageHeader header;
162 * For which host should requests be delegated? NBO.
164 uint32_t delegated_host_id GNUNET_PACKED;
167 * Which host is responsible for managing the delegation? NBO
169 uint32_t slave_host_id GNUNET_PACKED;
172 * The size of the uncompressed configuration
174 uint16_t config_size GNUNET_PACKED;
177 * Set to 1 if the receiving controller is the master controller for
178 * the slave host (and thus responsible for starting it?). 0 if not
180 uint8_t is_subordinate;
182 /* followed by serialized slave configuration;
183 gzip'ed configuration file in INI format */
189 * Message sent from client to testing service to
190 * create (configure, but not start) a peer.
192 struct GNUNET_TESTBED_PeerCreateMessage
196 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
198 struct GNUNET_MessageHeader header;
201 * On which host should the peer be started?
203 uint32_t host_id GNUNET_PACKED;
206 * Unique ID for the peer.
208 uint32_t peer_id GNUNET_PACKED;
210 /* followed by serialized peer configuration;
211 gzip'ed configuration file in INI format */
217 * Message sent from client to testing service to
218 * reconfigure a (stopped) a peer.
220 struct GNUNET_TESTBED_PeerReconfigureMessage
224 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
226 struct GNUNET_MessageHeader header;
229 * Unique ID for the peer.
231 uint32_t peer_id GNUNET_PACKED;
234 * Operation ID that is used to identify this operation.
236 uint64_t operation_id GNUNET_PACKED;
238 /* followed by serialized peer configuration;
239 gzip'ed configuration file in INI format */
245 * Message sent from client to testing service to
248 struct GNUNET_TESTBED_PeerStartMessage
252 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
254 struct GNUNET_MessageHeader header;
257 * Unique ID for the peer.
259 uint32_t peer_id GNUNET_PACKED;
262 * Operation ID that is used to identify this operation.
264 uint64_t operation_id GNUNET_PACKED;
270 * Message sent from client to testing service to
273 struct GNUNET_TESTBED_PeerStopMessage
277 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
279 struct GNUNET_MessageHeader header;
282 * Unique ID for the peer.
284 uint32_t peer_id GNUNET_PACKED;
287 * Operation ID that is used to identify this operation.
289 uint64_t operation_id GNUNET_PACKED;
295 * Message sent from client to testing service to
296 * destroy a (stopped) peer.
298 struct GNUNET_TESTBED_PeerDestroyMessage
302 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
304 struct GNUNET_MessageHeader header;
307 * Unique ID for the peer.
309 uint32_t peer_id GNUNET_PACKED;
312 * Operation ID that is used to identify this operation.
314 uint64_t operation_id GNUNET_PACKED;
320 * Message sent from client to testing service to
321 * (re)configure a "physical" link between two peers.
323 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
327 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
329 struct GNUNET_MessageHeader header;
332 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
334 int32_t connect_option GNUNET_PACKED;
337 * Unique ID for the first peer.
339 uint32_t peer1 GNUNET_PACKED;
342 * Unique ID for the second peer.
344 uint32_t peer2 GNUNET_PACKED;
347 * Operation ID that is used to identify this operation.
349 uint64_t operation_id GNUNET_PACKED;
351 /* followed by option-dependent variable-size values */
357 * Message sent from client to testing service to
360 struct GNUNET_TESTBED_OverlayConnectMessage
364 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
366 struct GNUNET_MessageHeader header;
369 * Unique ID for the first peer.
371 uint32_t peer1 GNUNET_PACKED;
374 * Operation ID that is used to identify this operation.
376 uint64_t operation_id GNUNET_PACKED;
379 * Unique ID for the second peer.
381 uint32_t peer2 GNUNET_PACKED;
387 * Event notification from a controller to a client.
389 struct GNUNET_TESTBED_PeerEventMessage
393 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
395 struct GNUNET_MessageHeader header;
398 * 'enum GNUNET_TESTBED_EventType' (in NBO);
399 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
401 int32_t event_type GNUNET_PACKED;
404 * Host where the peer is running.
406 uint32_t host_id GNUNET_PACKED;
409 * Peer that was started or stopped.
411 uint32_t peer_id GNUNET_PACKED;
414 * Operation ID that is used to identify this operation.
416 uint64_t operation_id GNUNET_PACKED;
422 * Event notification from a controller to a client.
424 struct GNUNET_TESTBED_ConnectionEventMessage
428 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
430 struct GNUNET_MessageHeader header;
433 * 'enum GNUNET_TESTBED_EventType' (in NBO);
434 * either GNUNET_TESTBED_ET_PEER_CONNECT or GNUNET_TESTBED_ET_PEER_DISCONNECT.
436 int32_t event_type GNUNET_PACKED;
441 uint32_t peer1 GNUNET_PACKED;
446 uint32_t peer2 GNUNET_PACKED;
449 * Operation ID that is used to identify this operation.
451 uint64_t operation_id GNUNET_PACKED;
457 * Event notification from a controller to a client.
459 struct GNUNET_TESTBED_OperationFailureEventMessage
463 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONEVENT
465 struct GNUNET_MessageHeader header;
468 * 'enum GNUNET_TESTBED_EventType' (in NBO);
469 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
471 int32_t event_type GNUNET_PACKED;
474 * Operation ID of the operation that created this event.
476 uint64_t operation_id GNUNET_PACKED;
478 /* followed by 0-terminated error message */
484 * Event notification from a controller to a client.
486 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
490 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
492 struct GNUNET_MessageHeader header;
495 * Peer identity of the peer that was created.
497 uint32_t peer_id GNUNET_PACKED;
500 * Operation ID of the operation that created this event.
502 uint64_t operation_id GNUNET_PACKED;
508 * Event notification from a controller to a client for
509 * a generic operational success where the operation does
510 * not return any data.
512 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
516 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
518 struct GNUNET_MessageHeader header;
521 * 'enum GNUNET_TESTBED_EventType' (in NBO);
522 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
524 int32_t event_type GNUNET_PACKED;
527 * Operation ID of the operation that created this event.
529 uint64_t operation_id GNUNET_PACKED;
537 * Message sent from client to testing service to
538 * obtain the configuration of a peer.
540 struct GNUNET_TESTBED_PeerGetConfigurationMessage
544 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
546 struct GNUNET_MessageHeader header;
549 * Unique ID for the peer.
551 uint32_t peer_id GNUNET_PACKED;
554 * Operation ID that is used to identify this operation.
556 uint64_t operation_id GNUNET_PACKED;
563 * Event notification from a controller to a client.
565 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
569 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
571 struct GNUNET_MessageHeader header;
574 * Peer number of the peer that was created.
576 uint32_t peer_number GNUNET_PACKED;
579 * Operation ID of the operation that created this event.
581 uint64_t operation_id GNUNET_PACKED;
584 * Identity of the peer.
586 struct GNUNET_PeerIdentity peer_id;
588 /* followed by gzip-compressed configuration of the peer */