2 This file is part of GNUnet
3 (C) 2008--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., 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"
32 GNUNET_NETWORK_STRUCT_BEGIN
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_ADD_HOST
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 username_length GNUNET_PACKED;
89 * Number of bytes in the host name (excluding 0-termination) that follows the
90 * user name; cannot be 0
92 uint16_t hostname_length GNUNET_PACKED;
95 * The length of the uncompressed configuration
97 uint16_t config_size GNUNET_PACKED;
99 /* followed by non 0-terminated user name */
101 /* followed by non 0-terminated host name */
103 /* followed by gzip compressed configuration to start or connect to a
104 controller on this host. While starting the controller this configration
105 is used as a template */
111 * Confirmation from the service that adding a host
112 * worked (or failed).
113 * FIXME: Where is this required?
115 struct GNUNET_TESTBED_HostConfirmedMessage
119 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS
121 struct GNUNET_MessageHeader header;
124 * Unique ID for the host (in NBO).
126 uint32_t host_id GNUNET_PACKED;
128 /* followed by the 0-terminated error message (on failure)
129 * (typical errors include host-id already in use) */
135 * Client notifies controller that it should delegate
136 * requests for a particular client to a particular
139 struct GNUNET_TESTBED_ControllerLinkRequest
143 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
145 struct GNUNET_MessageHeader header;
148 * For which host should requests be delegated? NBO.
150 uint32_t delegated_host_id GNUNET_PACKED;
153 * The id of the operation which created this message
155 uint64_t operation_id GNUNET_PACKED;
158 * Which host is responsible for managing the delegation? NBO
160 uint32_t slave_host_id GNUNET_PACKED;
163 * Set to 1 if the receiving controller is the master controller for
164 * the slave host (and thus responsible for starting it?). 0 if not
166 uint8_t is_subordinate;
172 * Response message for ControllerLinkRequest message
174 struct GNUNET_TESTBED_ControllerLinkResponse
178 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
180 struct GNUNET_MessageHeader header;
183 * The size of the compressed configuration. Can be ZERO if the controller is
184 * not started (depends on the ControllerLinkRequest). NBO.
186 uint16_t config_size GNUNET_PACKED;
189 * Set to GNUNET_YES to signify SUCCESS; GNUNET_NO to signify failure
191 uint16_t success GNUNET_PACKED;
194 * The id of the operation which created this message. NBO
196 uint64_t operation_id GNUNET_PACKED;
198 /* If controller linking is successful and configuration is present, then here
199 * comes the serialized gzip configuration with which the controller is
200 * running at the delegate host */
202 /* In case of failure, here comes the error message (without \0 termination)*/
208 * Message sent from client to testing service to
209 * create (configure, but not start) a peer.
211 struct GNUNET_TESTBED_PeerCreateMessage
215 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
217 struct GNUNET_MessageHeader header;
220 * On which host should the peer be started?
222 uint32_t host_id GNUNET_PACKED;
225 * Unique operation id
227 uint64_t operation_id GNUNET_PACKED;
230 * Unique ID for the peer.
232 uint32_t peer_id GNUNET_PACKED;
235 * Size of the uncompressed configuration
237 uint16_t config_size GNUNET_PACKED;
239 /* followed by serialized peer configuration;
240 * gzip'ed configuration file in INI format */
246 * Message sent from client to testing service to
247 * reconfigure a (stopped) a peer.
249 struct GNUNET_TESTBED_PeerReconfigureMessage
253 * Type is GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER
255 struct GNUNET_MessageHeader header;
258 * Unique ID for the peer.
260 uint32_t peer_id GNUNET_PACKED;
263 * Operation ID that is used to identify this operation.
265 uint64_t operation_id GNUNET_PACKED;
268 * The length of the serialized configuration when uncompressed
270 uint16_t config_size GNUNET_PACKED;
272 /* followed by serialized peer configuration;
273 * gzip'ed configuration file in INI format */
279 * Message sent from client to testing service to
282 struct GNUNET_TESTBED_PeerStartMessage
286 * Type is GNUNET_MESSAGE_TYPE_TESTBED_START_PEER
288 struct GNUNET_MessageHeader header;
291 * Unique ID for the peer.
293 uint32_t peer_id GNUNET_PACKED;
296 * Operation ID that is used to identify this operation.
298 uint64_t operation_id GNUNET_PACKED;
304 * Message sent from client to testing service to
307 struct GNUNET_TESTBED_PeerStopMessage
311 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
313 struct GNUNET_MessageHeader header;
316 * Unique ID for the peer.
318 uint32_t peer_id GNUNET_PACKED;
321 * Operation ID that is used to identify this operation.
323 uint64_t operation_id GNUNET_PACKED;
329 * Message sent from client to testing service to
330 * destroy a (stopped) peer.
332 struct GNUNET_TESTBED_PeerDestroyMessage
336 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
338 struct GNUNET_MessageHeader header;
341 * Unique ID for the peer.
343 uint32_t peer_id GNUNET_PACKED;
346 * Operation ID that is used to identify this operation.
348 uint64_t operation_id GNUNET_PACKED;
354 * Message sent from client to testing service to
355 * (re)configure a "physical" link between two peers.
357 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
361 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
363 struct GNUNET_MessageHeader header;
366 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
368 int32_t connect_option GNUNET_PACKED;
371 * Unique ID for the first peer.
373 uint32_t peer1 GNUNET_PACKED;
376 * Unique ID for the second peer.
378 uint32_t peer2 GNUNET_PACKED;
381 * Operation ID that is used to identify this operation.
383 uint64_t operation_id GNUNET_PACKED;
385 /* followed by option-dependent variable-size values */
391 * Message sent from client to testing service to
394 struct GNUNET_TESTBED_OverlayConnectMessage
398 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
400 struct GNUNET_MessageHeader header;
403 * Unique ID for the first peer.
405 uint32_t peer1 GNUNET_PACKED;
408 * Operation ID that is used to identify this operation.
410 uint64_t operation_id GNUNET_PACKED;
413 * Unique ID for the second peer.
415 uint32_t peer2 GNUNET_PACKED;
418 * The ID of the host which runs peer2
420 uint32_t peer2_host_id GNUNET_PACKED;
426 * Message sent from host controller of a peer(A) to the host controller of
427 * another peer(B) to request B to connect to A
429 struct GNUNET_TESTBED_RemoteOverlayConnectMessage
432 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
434 struct GNUNET_MessageHeader header;
439 uint32_t peer GNUNET_PACKED;
442 * The Operation ID that is used to identify this operation
444 uint64_t operation_id GNUNET_PACKED;
449 struct GNUNET_PeerIdentity peer_identity;
452 * To be followed by the HELLO message of A
454 struct GNUNET_MessageHeader hello[0];
460 * Event notification from a controller to a client.
462 struct GNUNET_TESTBED_PeerEventMessage
466 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
468 struct GNUNET_MessageHeader header;
471 * 'enum GNUNET_TESTBED_EventType' (in NBO);
472 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
474 int32_t event_type GNUNET_PACKED;
477 * Host where the peer is running.
479 uint32_t host_id GNUNET_PACKED;
482 * Peer that was started or stopped.
484 uint32_t peer_id GNUNET_PACKED;
487 * Operation ID that is used to identify this operation.
489 uint64_t operation_id GNUNET_PACKED;
495 * Event notification from a controller to a client.
497 struct GNUNET_TESTBED_ConnectionEventMessage
501 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
503 struct GNUNET_MessageHeader header;
506 * 'enum GNUNET_TESTBED_EventType' (in NBO);
507 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
509 int32_t event_type GNUNET_PACKED;
514 uint32_t peer1 GNUNET_PACKED;
519 uint32_t peer2 GNUNET_PACKED;
522 * Operation ID that is used to identify this operation.
524 uint64_t operation_id GNUNET_PACKED;
530 * Event notification from a controller to a client.
532 struct GNUNET_TESTBED_OperationFailureEventMessage
536 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
538 struct GNUNET_MessageHeader header;
541 * 'enum GNUNET_TESTBED_EventType' (in NBO);
542 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
544 int32_t event_type GNUNET_PACKED;
547 * Operation ID of the operation that created this event.
549 uint64_t operation_id GNUNET_PACKED;
551 /* followed by 0-terminated error message */
557 * Event notification from a controller to a client.
559 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
563 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
565 struct GNUNET_MessageHeader header;
568 * Peer identity of the peer that was created.
570 uint32_t peer_id GNUNET_PACKED;
573 * Operation ID of the operation that created this event.
575 uint64_t operation_id GNUNET_PACKED;
581 * Event notification from a controller to a client for
582 * a generic operational success where the operation does
583 * not return any data.
585 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
589 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
591 struct GNUNET_MessageHeader header;
594 * 'enum GNUNET_TESTBED_EventType' (in NBO);
595 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
597 int32_t event_type GNUNET_PACKED;
600 * Operation ID of the operation that created this event.
602 uint64_t operation_id GNUNET_PACKED;
608 * Message sent from client to testing service to
609 * obtain the configuration of a peer.
611 struct GNUNET_TESTBED_PeerGetConfigurationMessage
615 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_CONFIGURATION
617 struct GNUNET_MessageHeader header;
620 * Unique ID for the peer.
622 uint32_t peer_id GNUNET_PACKED;
625 * Operation ID that is used to identify this operation.
627 uint64_t operation_id GNUNET_PACKED;
633 * Peer configuration and identity reply from controller to a client.
635 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
639 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONFIGURATION
641 struct GNUNET_MessageHeader header;
644 * The id of the peer relevant to this information
646 uint32_t peer_id GNUNET_PACKED;
649 * Operation ID of the operation that created this event.
651 uint64_t operation_id GNUNET_PACKED;
654 * Identity of the peer.
656 struct GNUNET_PeerIdentity peer_identity;
659 * The size of configuration when uncompressed
661 uint16_t config_size GNUNET_PACKED;
663 /* followed by gzip-compressed configuration of the peer */
669 * Message to request configuration of a slave controller
671 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
674 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
676 struct GNUNET_MessageHeader header;
679 * The id of the slave host
681 uint32_t slave_id GNUNET_PACKED;
686 uint64_t operation_id GNUNET_PACKED;
692 * Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIG message
694 struct GNUNET_TESTBED_SlaveConfiguration
697 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
699 struct GNUNET_MessageHeader header;
702 * The id of the host where the slave is running
704 uint32_t slave_id GNUNET_PACKED;
709 uint64_t operation_id GNUNET_PACKED;
712 * The size of the configuration when uncompressed
714 uint16_t config_size GNUNET_PACKED;
716 /* followed by gzip-compressed configuration of the peer */
722 * Shutdown peers message
724 struct GNUNET_TESTBED_ShutdownPeersMessage
727 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
729 struct GNUNET_MessageHeader header;
734 uint64_t operation_id GNUNET_PACKED;
739 * Message to start/stop services of a peer
741 struct GNUNET_TESTBED_ManagePeerServiceMessage
744 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
746 struct GNUNET_MessageHeader header;
749 * Unique ID of the peer whose service has to be managed.
751 uint32_t peer_id GNUNET_PACKED;
756 uint64_t operation_id GNUNET_PACKED;
759 * set this to 1 to start the service; 0 to stop the service
764 * The NULL-terminated name of the service to start/stop follows here
769 GNUNET_NETWORK_STRUCT_END
771 /* end of testbed.h */