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 * Message to testing service: configure service sharing
140 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
144 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHARE_SERVICE
146 struct GNUNET_MessageHeader header;
149 * Host that is being configured.
151 uint32_t host_id GNUNET_PACKED;
154 * Number of peers that should share a service instance;
155 * 1 for no sharing, 0 to forcefully disable the service.
157 uint32_t num_peers GNUNET_PACKED;
159 /* followed by 0-terminated name of the service */
165 * Client notifies controller that it should delegate
166 * requests for a particular client to a particular
169 struct GNUNET_TESTBED_ControllerLinkRequest
173 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
175 struct GNUNET_MessageHeader header;
178 * For which host should requests be delegated? NBO.
180 uint32_t delegated_host_id GNUNET_PACKED;
183 * The id of the operation which created this message
185 uint64_t operation_id GNUNET_PACKED;
188 * Which host is responsible for managing the delegation? NBO
190 uint32_t slave_host_id GNUNET_PACKED;
193 * Set to 1 if the receiving controller is the master controller for
194 * the slave host (and thus responsible for starting it?). 0 if not
196 uint8_t is_subordinate;
202 * Response message for ControllerLinkRequest message
204 struct GNUNET_TESTBED_ControllerLinkResponse
208 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
210 struct GNUNET_MessageHeader header;
213 * The size of the compressed configuration. Can be ZERO if the controller is
214 * not started (depends on the ControllerLinkRequest). NBO.
216 uint16_t config_size GNUNET_PACKED;
219 * Set to GNUNET_YES to signify SUCCESS; GNUNET_NO to signify failure
221 uint16_t success GNUNET_PACKED;
224 * The id of the operation which created this message. NBO
226 uint64_t operation_id GNUNET_PACKED;
228 /* If controller linking is successful and configuration is present, then here
229 * comes the serialized gzip configuration with which the controller is
230 * running at the delegate host */
232 /* In case of failure, here comes the error message (without \0 termination)*/
238 * Message sent from client to testing service to
239 * create (configure, but not start) a peer.
241 struct GNUNET_TESTBED_PeerCreateMessage
245 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
247 struct GNUNET_MessageHeader header;
250 * Unique operation id
252 uint64_t operation_id GNUNET_PACKED;
255 * On which host should the peer be started?
257 uint32_t host_id GNUNET_PACKED;
260 * Unique ID for the peer.
262 uint32_t peer_id GNUNET_PACKED;
265 * Size of the uncompressed configuration
267 uint32_t config_size GNUNET_PACKED;
269 /* followed by serialized peer configuration;
270 * gzip'ed configuration file in INI format */
276 * Message sent from client to testing service to
277 * reconfigure a (stopped) a peer.
279 struct GNUNET_TESTBED_PeerReconfigureMessage
283 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER
285 struct GNUNET_MessageHeader header;
288 * Unique ID for the peer.
290 uint32_t peer_id GNUNET_PACKED;
293 * Operation ID that is used to identify this operation.
295 uint64_t operation_id GNUNET_PACKED;
297 /* followed by serialized peer configuration;
298 * gzip'ed configuration file in INI format */
304 * Message sent from client to testing service to
307 struct GNUNET_TESTBED_PeerStartMessage
311 * Type is GNUNET_MESSAGE_TYPE_TESTBED_START_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
332 struct GNUNET_TESTBED_PeerStopMessage
336 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_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 * destroy a (stopped) peer.
357 struct GNUNET_TESTBED_PeerDestroyMessage
361 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
363 struct GNUNET_MessageHeader header;
366 * Unique ID for the peer.
368 uint32_t peer_id GNUNET_PACKED;
371 * Operation ID that is used to identify this operation.
373 uint64_t operation_id GNUNET_PACKED;
379 * Message sent from client to testing service to
380 * (re)configure a "physical" link between two peers.
382 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
386 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
388 struct GNUNET_MessageHeader header;
391 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
393 int32_t connect_option GNUNET_PACKED;
396 * Unique ID for the first peer.
398 uint32_t peer1 GNUNET_PACKED;
401 * Unique ID for the second peer.
403 uint32_t peer2 GNUNET_PACKED;
406 * Operation ID that is used to identify this operation.
408 uint64_t operation_id GNUNET_PACKED;
410 /* followed by option-dependent variable-size values */
416 * Message sent from client to testing service to
419 struct GNUNET_TESTBED_OverlayConnectMessage
423 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
425 struct GNUNET_MessageHeader header;
428 * Unique ID for the first peer.
430 uint32_t peer1 GNUNET_PACKED;
433 * Operation ID that is used to identify this operation.
435 uint64_t operation_id GNUNET_PACKED;
438 * Unique ID for the second peer.
440 uint32_t peer2 GNUNET_PACKED;
443 * The ID of the host which runs peer2
445 uint32_t peer2_host_id GNUNET_PACKED;
451 * Message sent from host controller of a peer(A) to the host controller of
452 * another peer(B) to request B to connect to A
454 struct GNUNET_TESTBED_RemoteOverlayConnectMessage
457 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
459 struct GNUNET_MessageHeader header;
464 uint32_t peer GNUNET_PACKED;
467 * The Operation ID that is used to identify this operation
469 uint64_t operation_id GNUNET_PACKED;
474 struct GNUNET_PeerIdentity peer_identity;
477 * To be followed by the HELLO message of A
479 struct GNUNET_MessageHeader hello[0];
485 * Event notification from a controller to a client.
487 struct GNUNET_TESTBED_PeerEventMessage
491 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
493 struct GNUNET_MessageHeader header;
496 * 'enum GNUNET_TESTBED_EventType' (in NBO);
497 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
499 int32_t event_type GNUNET_PACKED;
502 * Host where the peer is running.
504 uint32_t host_id GNUNET_PACKED;
507 * Peer that was started or stopped.
509 uint32_t peer_id GNUNET_PACKED;
512 * Operation ID that is used to identify this operation.
514 uint64_t operation_id GNUNET_PACKED;
520 * Event notification from a controller to a client.
522 struct GNUNET_TESTBED_ConnectionEventMessage
526 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
528 struct GNUNET_MessageHeader header;
531 * 'enum GNUNET_TESTBED_EventType' (in NBO);
532 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
534 int32_t event_type GNUNET_PACKED;
539 uint32_t peer1 GNUNET_PACKED;
544 uint32_t peer2 GNUNET_PACKED;
547 * Operation ID that is used to identify this operation.
549 uint64_t operation_id GNUNET_PACKED;
555 * Event notification from a controller to a client.
557 struct GNUNET_TESTBED_OperationFailureEventMessage
561 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
563 struct GNUNET_MessageHeader header;
566 * 'enum GNUNET_TESTBED_EventType' (in NBO);
567 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
569 int32_t event_type GNUNET_PACKED;
572 * Operation ID of the operation that created this event.
574 uint64_t operation_id GNUNET_PACKED;
576 /* followed by 0-terminated error message */
582 * Event notification from a controller to a client.
584 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
588 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
590 struct GNUNET_MessageHeader header;
593 * Peer identity of the peer that was created.
595 uint32_t peer_id GNUNET_PACKED;
598 * Operation ID of the operation that created this event.
600 uint64_t operation_id GNUNET_PACKED;
606 * Event notification from a controller to a client for
607 * a generic operational success where the operation does
608 * not return any data.
610 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
614 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
616 struct GNUNET_MessageHeader header;
619 * 'enum GNUNET_TESTBED_EventType' (in NBO);
620 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
622 int32_t event_type GNUNET_PACKED;
625 * Operation ID of the operation that created this event.
627 uint64_t operation_id GNUNET_PACKED;
633 * Message sent from client to testing service to
634 * obtain the configuration of a peer.
636 struct GNUNET_TESTBED_PeerGetConfigurationMessage
640 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_CONFIGURATION
642 struct GNUNET_MessageHeader header;
645 * Unique ID for the peer.
647 uint32_t peer_id GNUNET_PACKED;
650 * Operation ID that is used to identify this operation.
652 uint64_t operation_id GNUNET_PACKED;
658 * Peer configuration and identity reply from controller to a client.
660 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
664 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONFIGURATION
666 struct GNUNET_MessageHeader header;
669 * The id of the peer relevant to this information
671 uint32_t peer_id GNUNET_PACKED;
674 * Operation ID of the operation that created this event.
676 uint64_t operation_id GNUNET_PACKED;
679 * Identity of the peer.
681 struct GNUNET_PeerIdentity peer_identity;
684 * The size of configuration when uncompressed
686 uint16_t config_size GNUNET_PACKED;
688 /* followed by gzip-compressed configuration of the peer */
694 * Message to request configuration of a slave controller
696 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
699 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
701 struct GNUNET_MessageHeader header;
704 * The id of the slave host
706 uint32_t slave_id GNUNET_PACKED;
711 uint64_t operation_id GNUNET_PACKED;
717 * Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIG message
719 struct GNUNET_TESTBED_SlaveConfiguration
722 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
724 struct GNUNET_MessageHeader header;
727 * The id of the host where the slave is running
729 uint32_t slave_id GNUNET_PACKED;
734 uint64_t operation_id GNUNET_PACKED;
737 * The size of the configuration when uncompressed
739 uint16_t config_size GNUNET_PACKED;
741 /* followed by gzip-compressed configuration of the peer */
747 * Shutdown peers message
749 struct GNUNET_TESTBED_ShutdownPeersMessage
752 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
754 struct GNUNET_MessageHeader header;
759 uint64_t operation_id GNUNET_PACKED;
764 * Message to start/stop services of a peer
766 struct GNUNET_TESTBED_ManagePeerServiceMessage
769 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
771 struct GNUNET_MessageHeader header;
774 * Unique ID of the peer whose service has to be managed.
776 uint32_t peer_id GNUNET_PACKED;
781 uint64_t operation_id GNUNET_PACKED;
784 * set this to 1 to start the service; 0 to stop the service
789 * The NULL-terminated name of the service to start/stop follows here
794 GNUNET_NETWORK_STRUCT_END
796 /* end of testbed.h */