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"
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_ControllerLinkMessage
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 * The size of the uncompressed configuration
195 uint16_t config_size GNUNET_PACKED;
198 * Set to 1 if the receiving controller is the master controller for
199 * the slave host (and thus responsible for starting it?). 0 if not
201 uint8_t is_subordinate;
203 /* followed by serialized slave configuration;
204 * gzip'ed configuration file in INI format */
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 * Unique operation id
224 uint64_t operation_id GNUNET_PACKED;
227 * On which host should the peer be started?
229 uint32_t host_id GNUNET_PACKED;
232 * Unique ID for the peer.
234 uint32_t peer_id GNUNET_PACKED;
237 * Size of the uncompressed configuration
239 uint32_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_TYPDE_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;
269 /* followed by serialized peer configuration;
270 * gzip'ed configuration file in INI format */
276 * Message sent from client to testing service to
279 struct GNUNET_TESTBED_PeerStartMessage
283 * Type is GNUNET_MESSAGE_TYPE_TESTBED_START_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;
301 * Message sent from client to testing service to
304 struct GNUNET_TESTBED_PeerStopMessage
308 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
310 struct GNUNET_MessageHeader header;
313 * Unique ID for the peer.
315 uint32_t peer_id GNUNET_PACKED;
318 * Operation ID that is used to identify this operation.
320 uint64_t operation_id GNUNET_PACKED;
326 * Message sent from client to testing service to
327 * destroy a (stopped) peer.
329 struct GNUNET_TESTBED_PeerDestroyMessage
333 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
335 struct GNUNET_MessageHeader header;
338 * Unique ID for the peer.
340 uint32_t peer_id GNUNET_PACKED;
343 * Operation ID that is used to identify this operation.
345 uint64_t operation_id GNUNET_PACKED;
351 * Message sent from client to testing service to
352 * (re)configure a "physical" link between two peers.
354 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
358 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
360 struct GNUNET_MessageHeader header;
363 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
365 int32_t connect_option GNUNET_PACKED;
368 * Unique ID for the first peer.
370 uint32_t peer1 GNUNET_PACKED;
373 * Unique ID for the second peer.
375 uint32_t peer2 GNUNET_PACKED;
378 * Operation ID that is used to identify this operation.
380 uint64_t operation_id GNUNET_PACKED;
382 /* followed by option-dependent variable-size values */
388 * Message sent from client to testing service to
391 struct GNUNET_TESTBED_OverlayConnectMessage
395 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
397 struct GNUNET_MessageHeader header;
400 * Unique ID for the first peer.
402 uint32_t peer1 GNUNET_PACKED;
405 * Operation ID that is used to identify this operation.
407 uint64_t operation_id GNUNET_PACKED;
410 * Unique ID for the second peer.
412 uint32_t peer2 GNUNET_PACKED;
415 * The ID of the host which runs peer2
417 uint32_t peer2_host_id GNUNET_PACKED;
423 * Message sent from host controller of a peer(A) to the host controller of
424 * another peer(B) to request B to connect to A
426 struct GNUNET_TESTBED_RemoteOverlayConnectMessage
429 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
431 struct GNUNET_MessageHeader header;
436 uint32_t peer GNUNET_PACKED;
439 * The Operation ID that is used to identify this operation
441 uint64_t operation_id GNUNET_PACKED;
446 struct GNUNET_PeerIdentity peer_identity;
449 * To be followed by the HELLO message of A
451 struct GNUNET_MessageHeader hello[0];
457 * Event notification from a controller to a client.
459 struct GNUNET_TESTBED_PeerEventMessage
463 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
465 struct GNUNET_MessageHeader header;
468 * 'enum GNUNET_TESTBED_EventType' (in NBO);
469 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
471 int32_t event_type GNUNET_PACKED;
474 * Host where the peer is running.
476 uint32_t host_id GNUNET_PACKED;
479 * Peer that was started or stopped.
481 uint32_t peer_id GNUNET_PACKED;
484 * Operation ID that is used to identify this operation.
486 uint64_t operation_id GNUNET_PACKED;
492 * Event notification from a controller to a client.
494 struct GNUNET_TESTBED_ConnectionEventMessage
498 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
500 struct GNUNET_MessageHeader header;
503 * 'enum GNUNET_TESTBED_EventType' (in NBO);
504 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
506 int32_t event_type GNUNET_PACKED;
511 uint32_t peer1 GNUNET_PACKED;
516 uint32_t peer2 GNUNET_PACKED;
519 * Operation ID that is used to identify this operation.
521 uint64_t operation_id GNUNET_PACKED;
527 * Event notification from a controller to a client.
529 struct GNUNET_TESTBED_OperationFailureEventMessage
533 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
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;
548 /* followed by 0-terminated error message */
554 * Event notification from a controller to a client.
556 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
560 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
562 struct GNUNET_MessageHeader header;
565 * Peer identity of the peer that was created.
567 uint32_t peer_id GNUNET_PACKED;
570 * Operation ID of the operation that created this event.
572 uint64_t operation_id GNUNET_PACKED;
578 * Event notification from a controller to a client for
579 * a generic operational success where the operation does
580 * not return any data.
582 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
586 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
588 struct GNUNET_MessageHeader header;
591 * 'enum GNUNET_TESTBED_EventType' (in NBO);
592 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
594 int32_t event_type GNUNET_PACKED;
597 * Operation ID of the operation that created this event.
599 uint64_t operation_id GNUNET_PACKED;
605 * Message sent from client to testing service to
606 * obtain the configuration of a peer.
608 struct GNUNET_TESTBED_PeerGetConfigurationMessage
612 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_CONFIGURATION
614 struct GNUNET_MessageHeader header;
617 * Unique ID for the peer.
619 uint32_t peer_id GNUNET_PACKED;
622 * Operation ID that is used to identify this operation.
624 uint64_t operation_id GNUNET_PACKED;
630 * Peer configuration and identity reply from controller to a client.
632 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
636 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONFIGURATION
638 struct GNUNET_MessageHeader header;
641 * The id of the peer relevant to this information
643 uint32_t peer_id GNUNET_PACKED;
646 * Operation ID of the operation that created this event.
648 uint64_t operation_id GNUNET_PACKED;
651 * Identity of the peer.
653 struct GNUNET_PeerIdentity peer_identity;
656 * The size of configuration when uncompressed
658 uint16_t config_size GNUNET_PACKED;
660 /* followed by gzip-compressed configuration of the peer */
666 * Message to request configuration of a slave controller
668 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
671 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
673 struct GNUNET_MessageHeader header;
676 * The id of the slave host
678 uint32_t slave_id GNUNET_PACKED;
683 uint64_t operation_id GNUNET_PACKED;
689 * Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIG message
691 struct GNUNET_TESTBED_SlaveConfiguration
694 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
696 struct GNUNET_MessageHeader header;
699 * The id of the host where the slave is running
701 uint32_t slave_id GNUNET_PACKED;
706 uint64_t operation_id GNUNET_PACKED;
709 * The size of the configuration when uncompressed
711 uint16_t config_size GNUNET_PACKED;
713 /* followed by gzip-compressed configuration of the peer */
718 GNUNET_NETWORK_STRUCT_END
720 /* end of testbed.h */