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 user_name_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;
96 /* followed by non 0-terminated user name */
98 /* followed by non 0-terminated host name */
100 /* followed by gzip compressed configuration to start or connect to a
101 controller on this host. While starting the controller this configration
102 is used as a template */
108 * Confirmation from the service that adding a host
109 * worked (or failed).
110 * FIXME: Where is this required?
112 struct GNUNET_TESTBED_HostConfirmedMessage
116 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS
118 struct GNUNET_MessageHeader header;
121 * Unique ID for the host (in NBO).
123 uint32_t host_id GNUNET_PACKED;
125 /* followed by the 0-terminated error message (on failure)
126 * (typical errors include host-id already in use) */
132 * Message to testing service: configure service sharing
135 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
139 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SHARE_SERVICE
141 struct GNUNET_MessageHeader header;
144 * Host that is being configured.
146 uint32_t host_id GNUNET_PACKED;
149 * Number of peers that should share a service instance;
150 * 1 for no sharing, 0 to forcefully disable the service.
152 uint32_t num_peers GNUNET_PACKED;
154 /* followed by 0-terminated name of the service */
160 * Client notifies controller that it should delegate
161 * requests for a particular client to a particular
164 struct GNUNET_TESTBED_ControllerLinkMessage
168 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
170 struct GNUNET_MessageHeader header;
173 * For which host should requests be delegated? NBO.
175 uint32_t delegated_host_id GNUNET_PACKED;
178 * The id of the operation which created this message
180 uint64_t operation_id GNUNET_PACKED;
183 * Which host is responsible for managing the delegation? NBO
185 uint32_t slave_host_id GNUNET_PACKED;
188 * The size of the uncompressed configuration
190 uint16_t config_size 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;
198 /* followed by serialized slave configuration;
199 * gzip'ed configuration file in INI format */
205 * Message sent from client to testing service to
206 * create (configure, but not start) a peer.
208 struct GNUNET_TESTBED_PeerCreateMessage
212 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
214 struct GNUNET_MessageHeader header;
217 * Unique operation id
219 uint64_t operation_id GNUNET_PACKED;
222 * On which host should the peer be started?
224 uint32_t host_id GNUNET_PACKED;
227 * Unique ID for the peer.
229 uint32_t peer_id GNUNET_PACKED;
232 * Size of the uncompressed configuration
234 uint32_t config_size GNUNET_PACKED;
236 /* followed by serialized peer configuration;
237 * gzip'ed configuration file in INI format */
243 * Message sent from client to testing service to
244 * reconfigure a (stopped) a peer.
246 struct GNUNET_TESTBED_PeerReconfigureMessage
250 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER
252 struct GNUNET_MessageHeader header;
255 * Unique ID for the peer.
257 uint32_t peer_id GNUNET_PACKED;
260 * Operation ID that is used to identify this operation.
262 uint64_t operation_id GNUNET_PACKED;
264 /* followed by serialized peer configuration;
265 * gzip'ed configuration file in INI format */
271 * Message sent from client to testing service to
274 struct GNUNET_TESTBED_PeerStartMessage
278 * Type is GNUNET_MESSAGE_TYPE_TESTBED_START_PEER
280 struct GNUNET_MessageHeader header;
283 * Unique ID for the peer.
285 uint32_t peer_id GNUNET_PACKED;
288 * Operation ID that is used to identify this operation.
290 uint64_t operation_id GNUNET_PACKED;
296 * Message sent from client to testing service to
299 struct GNUNET_TESTBED_PeerStopMessage
303 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
305 struct GNUNET_MessageHeader header;
308 * Unique ID for the peer.
310 uint32_t peer_id GNUNET_PACKED;
313 * Operation ID that is used to identify this operation.
315 uint64_t operation_id GNUNET_PACKED;
321 * Message sent from client to testing service to
322 * destroy a (stopped) peer.
324 struct GNUNET_TESTBED_PeerDestroyMessage
328 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
330 struct GNUNET_MessageHeader header;
333 * Unique ID for the peer.
335 uint32_t peer_id GNUNET_PACKED;
338 * Operation ID that is used to identify this operation.
340 uint64_t operation_id GNUNET_PACKED;
346 * Message sent from client to testing service to
347 * (re)configure a "physical" link between two peers.
349 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
353 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
355 struct GNUNET_MessageHeader header;
358 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
360 int32_t connect_option GNUNET_PACKED;
363 * Unique ID for the first peer.
365 uint32_t peer1 GNUNET_PACKED;
368 * Unique ID for the second peer.
370 uint32_t peer2 GNUNET_PACKED;
373 * Operation ID that is used to identify this operation.
375 uint64_t operation_id GNUNET_PACKED;
377 /* followed by option-dependent variable-size values */
383 * Message sent from client to testing service to
386 struct GNUNET_TESTBED_OverlayConnectMessage
390 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
392 struct GNUNET_MessageHeader header;
395 * Unique ID for the first peer.
397 uint32_t peer1 GNUNET_PACKED;
400 * Operation ID that is used to identify this operation.
402 uint64_t operation_id GNUNET_PACKED;
405 * Unique ID for the second peer.
407 uint32_t peer2 GNUNET_PACKED;
410 * The ID of the host which runs peer2
412 uint32_t peer2_host_id GNUNET_PACKED;
418 * Message sent from host controller of a peer(A) to the host controller of
419 * another peer(B) to request B to connect to A
421 struct GNUNET_TESTBED_RemoteOverlayConnectMessage
424 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
426 struct GNUNET_MessageHeader header;
431 uint32_t peer GNUNET_PACKED;
434 * The Operation ID that is used to identify this operation
436 uint64_t operation_id GNUNET_PACKED;
441 struct GNUNET_PeerIdentity peer_identity;
444 * To be followed by the HELLO message of A
446 struct GNUNET_MessageHeader hello[0];
452 * Event notification from a controller to a client.
454 struct GNUNET_TESTBED_PeerEventMessage
458 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
460 struct GNUNET_MessageHeader header;
463 * 'enum GNUNET_TESTBED_EventType' (in NBO);
464 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
466 int32_t event_type GNUNET_PACKED;
469 * Host where the peer is running.
471 uint32_t host_id GNUNET_PACKED;
474 * Peer that was started or stopped.
476 uint32_t peer_id GNUNET_PACKED;
479 * Operation ID that is used to identify this operation.
481 uint64_t operation_id GNUNET_PACKED;
487 * Event notification from a controller to a client.
489 struct GNUNET_TESTBED_ConnectionEventMessage
493 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
495 struct GNUNET_MessageHeader header;
498 * 'enum GNUNET_TESTBED_EventType' (in NBO);
499 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
501 int32_t event_type GNUNET_PACKED;
506 uint32_t peer1 GNUNET_PACKED;
511 uint32_t peer2 GNUNET_PACKED;
514 * Operation ID that is used to identify this operation.
516 uint64_t operation_id GNUNET_PACKED;
522 * Event notification from a controller to a client.
524 struct GNUNET_TESTBED_OperationFailureEventMessage
528 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
530 struct GNUNET_MessageHeader header;
533 * 'enum GNUNET_TESTBED_EventType' (in NBO);
534 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
536 int32_t event_type GNUNET_PACKED;
539 * Operation ID of the operation that created this event.
541 uint64_t operation_id GNUNET_PACKED;
543 /* followed by 0-terminated error message */
549 * Event notification from a controller to a client.
551 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
555 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
557 struct GNUNET_MessageHeader header;
560 * Peer identity of the peer that was created.
562 uint32_t peer_id GNUNET_PACKED;
565 * Operation ID of the operation that created this event.
567 uint64_t operation_id GNUNET_PACKED;
573 * Event notification from a controller to a client for
574 * a generic operational success where the operation does
575 * not return any data.
577 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
581 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
583 struct GNUNET_MessageHeader header;
586 * 'enum GNUNET_TESTBED_EventType' (in NBO);
587 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
589 int32_t event_type GNUNET_PACKED;
592 * Operation ID of the operation that created this event.
594 uint64_t operation_id GNUNET_PACKED;
600 * Message sent from client to testing service to
601 * obtain the configuration of a peer.
603 struct GNUNET_TESTBED_PeerGetConfigurationMessage
607 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_CONFIGURATION
609 struct GNUNET_MessageHeader header;
612 * Unique ID for the peer.
614 uint32_t peer_id GNUNET_PACKED;
617 * Operation ID that is used to identify this operation.
619 uint64_t operation_id GNUNET_PACKED;
625 * Peer configuration and identity reply from controller to a client.
627 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
631 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONFIGURATION
633 struct GNUNET_MessageHeader header;
636 * The id of the peer relevant to this information
638 uint32_t peer_id GNUNET_PACKED;
641 * Operation ID of the operation that created this event.
643 uint64_t operation_id GNUNET_PACKED;
646 * Identity of the peer.
648 struct GNUNET_PeerIdentity peer_identity;
651 * The size of configuration when uncompressed
653 uint16_t config_size GNUNET_PACKED;
655 /* followed by gzip-compressed configuration of the peer */
661 * Message to request configuration of a slave controller
663 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
666 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
668 struct GNUNET_MessageHeader header;
671 * The id of the slave host
673 uint32_t slave_id GNUNET_PACKED;
678 uint64_t operation_id GNUNET_PACKED;
684 * Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIG message
686 struct GNUNET_TESTBED_SlaveConfiguration
689 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
691 struct GNUNET_MessageHeader header;
694 * The id of the host where the slave is running
696 uint32_t slave_id GNUNET_PACKED;
701 uint64_t operation_id GNUNET_PACKED;
704 * The size of the configuration when uncompressed
706 uint16_t config_size GNUNET_PACKED;
708 /* followed by gzip-compressed configuration of the peer */
713 GNUNET_NETWORK_STRUCT_END
715 /* end of testbed.h */