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;
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_ADD_HOST
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 username_length GNUNET_PACKED;
91 * Number of bytes in the host name (excluding 0-termination) that follows the
92 * user name; cannot be 0
94 uint16_t hostname_length GNUNET_PACKED;
97 * The length of the uncompressed configuration
99 uint16_t config_size GNUNET_PACKED;
101 /* followed by non 0-terminated user name */
103 /* followed by non 0-terminated host name */
105 /* followed by gzip compressed configuration to start or connect to a
106 controller on this host. While starting the controller this configration
107 is used as a template */
113 * Confirmation from the service that adding a host
114 * worked (or failed).
115 * FIXME: Where is this required?
117 struct GNUNET_TESTBED_HostConfirmedMessage
121 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS
123 struct GNUNET_MessageHeader header;
126 * Unique ID for the host (in NBO).
128 uint32_t host_id GNUNET_PACKED;
130 /* followed by the 0-terminated error message (on failure)
131 * (typical errors include host-id already in use) */
137 * Client notifies controller that it should delegate
138 * requests for a particular client to a particular
141 struct GNUNET_TESTBED_ControllerLinkRequest
145 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
147 struct GNUNET_MessageHeader header;
150 * For which host should requests be delegated? NBO.
152 uint32_t delegated_host_id GNUNET_PACKED;
155 * The id of the operation which created this message
157 uint64_t operation_id GNUNET_PACKED;
160 * Which host is responsible for managing the delegation? NBO
162 uint32_t slave_host_id GNUNET_PACKED;
165 * Set to 1 if the receiving controller is the master controller for
166 * the slave host (and thus responsible for starting it?). 0 if not
168 uint8_t is_subordinate;
174 * Response message for ControllerLinkRequest message
176 struct GNUNET_TESTBED_ControllerLinkResponse
180 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
182 struct GNUNET_MessageHeader header;
185 * The size of the compressed configuration. Can be ZERO if the controller is
186 * not started (depends on the ControllerLinkRequest). NBO.
188 uint16_t config_size GNUNET_PACKED;
191 * Set to GNUNET_YES to signify SUCCESS; GNUNET_NO to signify failure
193 uint16_t success GNUNET_PACKED;
196 * The id of the operation which created this message. NBO
198 uint64_t operation_id GNUNET_PACKED;
200 /* If controller linking is successful and configuration is present, then here
201 * comes the serialized gzip configuration with which the controller is
202 * running at the delegate host */
204 /* In case of failure, here comes the error message (without \0 termination)*/
210 * Message sent from client to testing service to
211 * create (configure, but not start) a peer.
213 struct GNUNET_TESTBED_PeerCreateMessage
217 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
219 struct GNUNET_MessageHeader header;
222 * On which host should the peer be started?
224 uint32_t host_id GNUNET_PACKED;
227 * Unique operation id
229 uint64_t operation_id GNUNET_PACKED;
232 * Unique ID for the peer.
234 uint32_t peer_id GNUNET_PACKED;
237 * Size of the uncompressed configuration
239 uint16_t config_size GNUNET_PACKED;
241 /* followed by serialized peer configuration;
242 * gzip'ed configuration file in INI format */
248 * Message sent from client to testing service to
249 * reconfigure a (stopped) a peer.
251 struct GNUNET_TESTBED_PeerReconfigureMessage
255 * Type is GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER
257 struct GNUNET_MessageHeader header;
260 * Unique ID for the peer.
262 uint32_t peer_id GNUNET_PACKED;
265 * Operation ID that is used to identify this operation.
267 uint64_t operation_id GNUNET_PACKED;
270 * The length of the serialized configuration when uncompressed
272 uint16_t config_size GNUNET_PACKED;
274 /* followed by serialized peer configuration;
275 * gzip'ed configuration file in INI format */
281 * Message sent from client to testing service to
284 struct GNUNET_TESTBED_PeerStartMessage
288 * Type is GNUNET_MESSAGE_TYPE_TESTBED_START_PEER
290 struct GNUNET_MessageHeader header;
293 * Unique ID for the peer.
295 uint32_t peer_id GNUNET_PACKED;
298 * Operation ID that is used to identify this operation.
300 uint64_t operation_id GNUNET_PACKED;
306 * Message sent from client to testing service to
309 struct GNUNET_TESTBED_PeerStopMessage
313 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
315 struct GNUNET_MessageHeader header;
318 * Unique ID for the peer.
320 uint32_t peer_id GNUNET_PACKED;
323 * Operation ID that is used to identify this operation.
325 uint64_t operation_id GNUNET_PACKED;
331 * Message sent from client to testing service to
332 * destroy a (stopped) peer.
334 struct GNUNET_TESTBED_PeerDestroyMessage
338 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
340 struct GNUNET_MessageHeader header;
343 * Unique ID for the peer.
345 uint32_t peer_id GNUNET_PACKED;
348 * Operation ID that is used to identify this operation.
350 uint64_t operation_id GNUNET_PACKED;
356 * Message sent from client to testing service to
357 * (re)configure a "physical" link between two peers.
359 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
363 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
365 struct GNUNET_MessageHeader header;
368 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
370 int32_t connect_option GNUNET_PACKED;
373 * Unique ID for the first peer.
375 uint32_t peer1 GNUNET_PACKED;
378 * Unique ID for the second peer.
380 uint32_t peer2 GNUNET_PACKED;
383 * Operation ID that is used to identify this operation.
385 uint64_t operation_id GNUNET_PACKED;
387 /* followed by option-dependent variable-size values */
393 * Message sent from client to testing service to
396 struct GNUNET_TESTBED_OverlayConnectMessage
400 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
402 struct GNUNET_MessageHeader header;
405 * Unique ID for the first peer.
407 uint32_t peer1 GNUNET_PACKED;
410 * Operation ID that is used to identify this operation.
412 uint64_t operation_id GNUNET_PACKED;
415 * Unique ID for the second peer.
417 uint32_t peer2 GNUNET_PACKED;
420 * The ID of the host which runs peer2
422 uint32_t peer2_host_id GNUNET_PACKED;
428 * Message sent from host controller of a peer(A) to the host controller of
429 * another peer(B) to request B to connect to A
431 struct GNUNET_TESTBED_RemoteOverlayConnectMessage
434 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
436 struct GNUNET_MessageHeader header;
441 uint32_t peer GNUNET_PACKED;
444 * The Operation ID that is used to identify this operation
446 uint64_t operation_id GNUNET_PACKED;
451 struct GNUNET_PeerIdentity peer_identity;
454 * To be followed by the HELLO message of A
456 struct GNUNET_MessageHeader hello[0];
462 * Event notification from a controller to a client.
464 struct GNUNET_TESTBED_PeerEventMessage
468 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
470 struct GNUNET_MessageHeader header;
473 * 'enum GNUNET_TESTBED_EventType' (in NBO);
474 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
476 int32_t event_type GNUNET_PACKED;
479 * Host where the peer is running.
481 uint32_t host_id GNUNET_PACKED;
484 * Peer that was started or stopped.
486 uint32_t peer_id GNUNET_PACKED;
489 * Operation ID that is used to identify this operation.
491 uint64_t operation_id GNUNET_PACKED;
497 * Event notification from a controller to a client.
499 struct GNUNET_TESTBED_ConnectionEventMessage
503 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
505 struct GNUNET_MessageHeader header;
508 * 'enum GNUNET_TESTBED_EventType' (in NBO);
509 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
511 int32_t event_type GNUNET_PACKED;
516 uint32_t peer1 GNUNET_PACKED;
521 uint32_t peer2 GNUNET_PACKED;
524 * Operation ID that is used to identify this operation.
526 uint64_t operation_id GNUNET_PACKED;
532 * Event notification from a controller to a client.
534 struct GNUNET_TESTBED_OperationFailureEventMessage
538 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
540 struct GNUNET_MessageHeader header;
543 * 'enum GNUNET_TESTBED_EventType' (in NBO);
544 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
546 int32_t event_type GNUNET_PACKED;
549 * Operation ID of the operation that created this event.
551 uint64_t operation_id GNUNET_PACKED;
553 /* followed by 0-terminated error message */
559 * Event notification from a controller to a client.
561 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
565 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
567 struct GNUNET_MessageHeader header;
570 * Peer identity of the peer that was created.
572 uint32_t peer_id GNUNET_PACKED;
575 * Operation ID of the operation that created this event.
577 uint64_t operation_id GNUNET_PACKED;
583 * Event notification from a controller to a client for
584 * a generic operational success where the operation does
585 * not return any data.
587 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
591 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
593 struct GNUNET_MessageHeader header;
596 * 'enum GNUNET_TESTBED_EventType' (in NBO);
597 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
599 int32_t event_type GNUNET_PACKED;
602 * Operation ID of the operation that created this event.
604 uint64_t operation_id GNUNET_PACKED;
610 * Message sent from client to testing service to
611 * obtain the configuration of a peer.
613 struct GNUNET_TESTBED_PeerGetConfigurationMessage
617 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_CONFIGURATION
619 struct GNUNET_MessageHeader header;
622 * Unique ID for the peer.
624 uint32_t peer_id GNUNET_PACKED;
627 * Operation ID that is used to identify this operation.
629 uint64_t operation_id GNUNET_PACKED;
635 * Peer configuration and identity reply from controller to a client.
637 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
641 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONFIGURATION
643 struct GNUNET_MessageHeader header;
646 * The id of the peer relevant to this information
648 uint32_t peer_id GNUNET_PACKED;
651 * Operation ID of the operation that created this event.
653 uint64_t operation_id GNUNET_PACKED;
656 * Identity of the peer.
658 struct GNUNET_PeerIdentity peer_identity;
661 * The size of configuration when uncompressed
663 uint16_t config_size GNUNET_PACKED;
665 /* followed by gzip-compressed configuration of the peer */
671 * Message to request configuration of a slave controller
673 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
676 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
678 struct GNUNET_MessageHeader header;
681 * The id of the slave host
683 uint32_t slave_id GNUNET_PACKED;
688 uint64_t operation_id GNUNET_PACKED;
694 * Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIG message
696 struct GNUNET_TESTBED_SlaveConfiguration
699 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
701 struct GNUNET_MessageHeader header;
704 * The id of the host where the slave is running
706 uint32_t slave_id GNUNET_PACKED;
711 uint64_t operation_id GNUNET_PACKED;
714 * The size of the configuration when uncompressed
716 uint16_t config_size GNUNET_PACKED;
718 /* followed by gzip-compressed configuration of the peer */
724 * Shutdown peers message
726 struct GNUNET_TESTBED_ShutdownPeersMessage
729 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
731 struct GNUNET_MessageHeader header;
736 uint64_t operation_id GNUNET_PACKED;
741 * Message to start/stop services of a peer
743 struct GNUNET_TESTBED_ManagePeerServiceMessage
746 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
748 struct GNUNET_MessageHeader header;
751 * Unique ID of the peer whose service has to be managed.
753 uint32_t peer_id GNUNET_PACKED;
758 uint64_t operation_id GNUNET_PACKED;
761 * set this to 1 to start the service; 0 to stop the service
766 * The NULL-terminated name of the service to start/stop follows here
771 GNUNET_NETWORK_STRUCT_END
773 /* end of testbed.h */