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;
58 /* Followed by 0-terminated hostname of the controller */
63 * Notify the service about a host that we intend to use.
65 struct GNUNET_TESTBED_AddHostMessage
69 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOST
71 struct GNUNET_MessageHeader header;
74 * Unique ID for the host (in NBO).
76 uint32_t host_id GNUNET_PACKED;
79 * SSH port to use, 0 for default (in NBO).
81 uint16_t ssh_port GNUNET_PACKED;
84 * Number of bytes in the user name that follows;
85 * 0 to use no user name; otherwise 'strlen (username)',
86 * excluding 0-termination!
88 uint16_t user_name_length GNUNET_PACKED;
90 /* followed by 0-terminated user name */
92 /* followed by 0-terminated host name */
98 * Confirmation from the service that adding a host
100 * FIXME: Where is this required?
102 struct GNUNET_TESTBED_HostConfirmedMessage
106 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTSUCCESS
108 struct GNUNET_MessageHeader header;
111 * Unique ID for the host (in NBO).
113 uint32_t host_id GNUNET_PACKED;
115 /* followed by the 0-terminated error message (on failure)
116 * (typical errors include failure to login and
117 * host-id already in use) */
123 * Message to testing service: configure service sharing
126 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
130 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SERVICESHARE
132 struct GNUNET_MessageHeader header;
135 * Host that is being configured.
137 uint32_t host_id GNUNET_PACKED;
140 * Number of peers that should share a service instance;
141 * 1 for no sharing, 0 to forcefully disable the service.
143 uint32_t num_peers GNUNET_PACKED;
145 /* followed by 0-terminated name of the service */
151 * Client notifies controller that it should delegate
152 * requests for a particular client to a particular
155 struct GNUNET_TESTBED_ControllerLinkMessage
159 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS
161 struct GNUNET_MessageHeader header;
164 * For which host should requests be delegated? NBO.
166 uint32_t delegated_host_id GNUNET_PACKED;
169 * The id of the operation which created this message
171 uint64_t operation_id GNUNET_PACKED;
174 * Which host is responsible for managing the delegation? NBO
176 uint32_t slave_host_id GNUNET_PACKED;
179 * The size of the uncompressed configuration
181 uint16_t config_size GNUNET_PACKED;
184 * Set to 1 if the receiving controller is the master controller for
185 * the slave host (and thus responsible for starting it?). 0 if not
187 uint8_t is_subordinate;
189 /* followed by serialized slave configuration;
190 * gzip'ed configuration file in INI format */
196 * Message sent from client to testing service to
197 * create (configure, but not start) a peer.
199 struct GNUNET_TESTBED_PeerCreateMessage
203 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
205 struct GNUNET_MessageHeader header;
208 * Unique operation id
210 uint64_t operation_id GNUNET_PACKED;
213 * On which host should the peer be started?
215 uint32_t host_id GNUNET_PACKED;
218 * Unique ID for the peer.
220 uint32_t peer_id GNUNET_PACKED;
223 * Size of the uncompressed configuration
225 uint32_t config_size GNUNET_PACKED;
227 /* followed by serialized peer configuration;
228 * gzip'ed configuration file in INI format */
234 * Message sent from client to testing service to
235 * reconfigure a (stopped) a peer.
237 struct GNUNET_TESTBED_PeerReconfigureMessage
241 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
243 struct GNUNET_MessageHeader header;
246 * Unique ID for the peer.
248 uint32_t peer_id GNUNET_PACKED;
251 * Operation ID that is used to identify this operation.
253 uint64_t operation_id GNUNET_PACKED;
255 /* followed by serialized peer configuration;
256 * gzip'ed configuration file in INI format */
262 * Message sent from client to testing service to
265 struct GNUNET_TESTBED_PeerStartMessage
269 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
271 struct GNUNET_MessageHeader header;
274 * Unique ID for the peer.
276 uint32_t peer_id GNUNET_PACKED;
279 * Operation ID that is used to identify this operation.
281 uint64_t operation_id GNUNET_PACKED;
287 * Message sent from client to testing service to
290 struct GNUNET_TESTBED_PeerStopMessage
294 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
296 struct GNUNET_MessageHeader header;
299 * Unique ID for the peer.
301 uint32_t peer_id GNUNET_PACKED;
304 * Operation ID that is used to identify this operation.
306 uint64_t operation_id GNUNET_PACKED;
312 * Message sent from client to testing service to
313 * destroy a (stopped) peer.
315 struct GNUNET_TESTBED_PeerDestroyMessage
319 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
321 struct GNUNET_MessageHeader header;
324 * Unique ID for the peer.
326 uint32_t peer_id GNUNET_PACKED;
329 * Operation ID that is used to identify this operation.
331 uint64_t operation_id GNUNET_PACKED;
337 * Message sent from client to testing service to
338 * (re)configure a "physical" link between two peers.
340 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
344 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
346 struct GNUNET_MessageHeader header;
349 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
351 int32_t connect_option GNUNET_PACKED;
354 * Unique ID for the first peer.
356 uint32_t peer1 GNUNET_PACKED;
359 * Unique ID for the second peer.
361 uint32_t peer2 GNUNET_PACKED;
364 * Operation ID that is used to identify this operation.
366 uint64_t operation_id GNUNET_PACKED;
368 /* followed by option-dependent variable-size values */
374 * Message sent from client to testing service to
377 struct GNUNET_TESTBED_OverlayConnectMessage
381 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
383 struct GNUNET_MessageHeader header;
386 * Unique ID for the first peer.
388 uint32_t peer1 GNUNET_PACKED;
391 * Operation ID that is used to identify this operation.
393 uint64_t operation_id GNUNET_PACKED;
396 * Unique ID for the second peer.
398 uint32_t peer2 GNUNET_PACKED;
404 * Event notification from a controller to a client.
406 struct GNUNET_TESTBED_PeerEventMessage
410 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
412 struct GNUNET_MessageHeader header;
415 * 'enum GNUNET_TESTBED_EventType' (in NBO);
416 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
418 int32_t event_type GNUNET_PACKED;
421 * Host where the peer is running.
423 uint32_t host_id GNUNET_PACKED;
426 * Peer that was started or stopped.
428 uint32_t peer_id GNUNET_PACKED;
431 * Operation ID that is used to identify this operation.
433 uint64_t operation_id GNUNET_PACKED;
439 * Event notification from a controller to a client.
441 struct GNUNET_TESTBED_ConnectionEventMessage
445 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
447 struct GNUNET_MessageHeader header;
450 * 'enum GNUNET_TESTBED_EventType' (in NBO);
451 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
453 int32_t event_type GNUNET_PACKED;
458 uint32_t peer1 GNUNET_PACKED;
463 uint32_t peer2 GNUNET_PACKED;
466 * Operation ID that is used to identify this operation.
468 uint64_t operation_id GNUNET_PACKED;
474 * Event notification from a controller to a client.
476 struct GNUNET_TESTBED_OperationFailureEventMessage
480 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT
482 struct GNUNET_MessageHeader header;
485 * 'enum GNUNET_TESTBED_EventType' (in NBO);
486 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
488 int32_t event_type GNUNET_PACKED;
491 * Operation ID of the operation that created this event.
493 uint64_t operation_id GNUNET_PACKED;
495 /* followed by 0-terminated error message */
501 * Event notification from a controller to a client.
503 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
507 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
509 struct GNUNET_MessageHeader header;
512 * Peer identity of the peer that was created.
514 uint32_t peer_id GNUNET_PACKED;
517 * Operation ID of the operation that created this event.
519 uint64_t operation_id GNUNET_PACKED;
525 * Event notification from a controller to a client for
526 * a generic operational success where the operation does
527 * not return any data.
529 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
533 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
535 struct GNUNET_MessageHeader header;
538 * 'enum GNUNET_TESTBED_EventType' (in NBO);
539 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
541 int32_t event_type GNUNET_PACKED;
544 * Operation ID of the operation that created this event.
546 uint64_t operation_id GNUNET_PACKED;
552 * Message sent from client to testing service to
553 * obtain the configuration of a peer.
555 struct GNUNET_TESTBED_PeerGetConfigurationMessage
559 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
561 struct GNUNET_MessageHeader header;
564 * Unique ID for the peer.
566 uint32_t peer_id GNUNET_PACKED;
569 * Operation ID that is used to identify this operation.
571 uint64_t operation_id GNUNET_PACKED;
577 * Peer configuration and identity reply from controller to a client.
579 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
583 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
585 struct GNUNET_MessageHeader header;
588 * The id of the peer relevant to this information
590 uint32_t peer_id GNUNET_PACKED;
593 * Operation ID of the operation that created this event.
595 uint64_t operation_id GNUNET_PACKED;
598 * Identity of the peer.
600 struct GNUNET_PeerIdentity peer_identity;
603 * The size of configuration when uncompressed
605 uint16_t config_size;
607 /* followed by gzip-compressed configuration of the peer */