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_ADDHOST
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;
90 /* followed by 0-terminated user name */
92 /* followed by 0-terminated host name */
98 * Confirmation from the service that adding a host
100 * FIXME: Where is this required?
102 struct GNUNET_TESTBED_HostConfirmedMessage
106 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTCONFIRMED
108 struct GNUNET_MessageHeader header;
111 * Unique ID for the host (in NBO).
113 uint32_t host_id GNUNET_PACKED;
115 /* followed by the 0-terminated error message (on failure)
116 * (typical errors include host-id already in use) */
122 * Message to testing service: configure service sharing
125 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
129 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SERVICESHARE
131 struct GNUNET_MessageHeader header;
134 * Host that is being configured.
136 uint32_t host_id GNUNET_PACKED;
139 * Number of peers that should share a service instance;
140 * 1 for no sharing, 0 to forcefully disable the service.
142 uint32_t num_peers GNUNET_PACKED;
144 /* followed by 0-terminated name of the service */
150 * Client notifies controller that it should delegate
151 * requests for a particular client to a particular
154 struct GNUNET_TESTBED_ControllerLinkMessage
158 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS
160 struct GNUNET_MessageHeader header;
163 * For which host should requests be delegated? NBO.
165 uint32_t delegated_host_id GNUNET_PACKED;
168 * The id of the operation which created this message
170 uint64_t operation_id GNUNET_PACKED;
173 * Which host is responsible for managing the delegation? NBO
175 uint32_t slave_host_id GNUNET_PACKED;
178 * The size of the uncompressed configuration
180 uint16_t config_size GNUNET_PACKED;
183 * Set to 1 if the receiving controller is the master controller for
184 * the slave host (and thus responsible for starting it?). 0 if not
186 uint8_t is_subordinate;
188 /* followed by serialized slave configuration;
189 * gzip'ed configuration file in INI format */
195 * Message sent from client to testing service to
196 * create (configure, but not start) a peer.
198 struct GNUNET_TESTBED_PeerCreateMessage
202 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
204 struct GNUNET_MessageHeader header;
207 * Unique operation id
209 uint64_t operation_id GNUNET_PACKED;
212 * On which host should the peer be started?
214 uint32_t host_id GNUNET_PACKED;
217 * Unique ID for the peer.
219 uint32_t peer_id GNUNET_PACKED;
222 * Size of the uncompressed configuration
224 uint32_t config_size GNUNET_PACKED;
226 /* followed by serialized peer configuration;
227 * gzip'ed configuration file in INI format */
233 * Message sent from client to testing service to
234 * reconfigure a (stopped) a peer.
236 struct GNUNET_TESTBED_PeerReconfigureMessage
240 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
242 struct GNUNET_MessageHeader header;
245 * Unique ID for the peer.
247 uint32_t peer_id GNUNET_PACKED;
250 * Operation ID that is used to identify this operation.
252 uint64_t operation_id GNUNET_PACKED;
254 /* followed by serialized peer configuration;
255 * gzip'ed configuration file in INI format */
261 * Message sent from client to testing service to
264 struct GNUNET_TESTBED_PeerStartMessage
268 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
270 struct GNUNET_MessageHeader header;
273 * Unique ID for the peer.
275 uint32_t peer_id GNUNET_PACKED;
278 * Operation ID that is used to identify this operation.
280 uint64_t operation_id GNUNET_PACKED;
286 * Message sent from client to testing service to
289 struct GNUNET_TESTBED_PeerStopMessage
293 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
295 struct GNUNET_MessageHeader header;
298 * Unique ID for the peer.
300 uint32_t peer_id GNUNET_PACKED;
303 * Operation ID that is used to identify this operation.
305 uint64_t operation_id GNUNET_PACKED;
311 * Message sent from client to testing service to
312 * destroy a (stopped) peer.
314 struct GNUNET_TESTBED_PeerDestroyMessage
318 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
320 struct GNUNET_MessageHeader header;
323 * Unique ID for the peer.
325 uint32_t peer_id GNUNET_PACKED;
328 * Operation ID that is used to identify this operation.
330 uint64_t operation_id GNUNET_PACKED;
336 * Message sent from client to testing service to
337 * (re)configure a "physical" link between two peers.
339 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
343 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
345 struct GNUNET_MessageHeader header;
348 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
350 int32_t connect_option GNUNET_PACKED;
353 * Unique ID for the first peer.
355 uint32_t peer1 GNUNET_PACKED;
358 * Unique ID for the second peer.
360 uint32_t peer2 GNUNET_PACKED;
363 * Operation ID that is used to identify this operation.
365 uint64_t operation_id GNUNET_PACKED;
367 /* followed by option-dependent variable-size values */
373 * Message sent from client to testing service to
376 struct GNUNET_TESTBED_OverlayConnectMessage
380 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
382 struct GNUNET_MessageHeader header;
385 * Unique ID for the first peer.
387 uint32_t peer1 GNUNET_PACKED;
390 * Operation ID that is used to identify this operation.
392 uint64_t operation_id GNUNET_PACKED;
395 * Unique ID for the second peer.
397 uint32_t peer2 GNUNET_PACKED;
400 * The ID of the host which runs peer2
402 uint32_t peer2_host_id GNUNET_PACKED;
408 * Message sent from host controller of a peer(A) to the host controller of
409 * another peer(B) to request B to connect to A
411 struct GNUNET_TESTBED_RequestConnectMessage
414 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT
416 struct GNUNET_MessageHeader header;
421 uint32_t peer GNUNET_PACKED;
424 * The Operation ID that is used to identify this operation
426 uint64_t operation_id GNUNET_PACKED;
431 struct GNUNET_PeerIdentity peer_identity;
434 * To be followed by the HELLO message of A
436 struct GNUNET_MessageHeader hello[0];
442 * Event notification from a controller to a client.
444 struct GNUNET_TESTBED_PeerEventMessage
448 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
450 struct GNUNET_MessageHeader header;
453 * 'enum GNUNET_TESTBED_EventType' (in NBO);
454 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
456 int32_t event_type GNUNET_PACKED;
459 * Host where the peer is running.
461 uint32_t host_id GNUNET_PACKED;
464 * Peer that was started or stopped.
466 uint32_t peer_id GNUNET_PACKED;
469 * Operation ID that is used to identify this operation.
471 uint64_t operation_id GNUNET_PACKED;
477 * Event notification from a controller to a client.
479 struct GNUNET_TESTBED_ConnectionEventMessage
483 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
485 struct GNUNET_MessageHeader header;
488 * 'enum GNUNET_TESTBED_EventType' (in NBO);
489 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
491 int32_t event_type GNUNET_PACKED;
496 uint32_t peer1 GNUNET_PACKED;
501 uint32_t peer2 GNUNET_PACKED;
504 * Operation ID that is used to identify this operation.
506 uint64_t operation_id GNUNET_PACKED;
512 * Event notification from a controller to a client.
514 struct GNUNET_TESTBED_OperationFailureEventMessage
518 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT
520 struct GNUNET_MessageHeader header;
523 * 'enum GNUNET_TESTBED_EventType' (in NBO);
524 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
526 int32_t event_type GNUNET_PACKED;
529 * Operation ID of the operation that created this event.
531 uint64_t operation_id GNUNET_PACKED;
533 /* followed by 0-terminated error message */
539 * Event notification from a controller to a client.
541 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
545 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
547 struct GNUNET_MessageHeader header;
550 * Peer identity of the peer that was created.
552 uint32_t peer_id GNUNET_PACKED;
555 * Operation ID of the operation that created this event.
557 uint64_t operation_id GNUNET_PACKED;
563 * Event notification from a controller to a client for
564 * a generic operational success where the operation does
565 * not return any data.
567 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
571 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
573 struct GNUNET_MessageHeader header;
576 * 'enum GNUNET_TESTBED_EventType' (in NBO);
577 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
579 int32_t event_type GNUNET_PACKED;
582 * Operation ID of the operation that created this event.
584 uint64_t operation_id GNUNET_PACKED;
590 * Message sent from client to testing service to
591 * obtain the configuration of a peer.
593 struct GNUNET_TESTBED_PeerGetConfigurationMessage
597 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
599 struct GNUNET_MessageHeader header;
602 * Unique ID for the peer.
604 uint32_t peer_id GNUNET_PACKED;
607 * Operation ID that is used to identify this operation.
609 uint64_t operation_id GNUNET_PACKED;
615 * Peer configuration and identity reply from controller to a client.
617 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
621 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
623 struct GNUNET_MessageHeader header;
626 * The id of the peer relevant to this information
628 uint32_t peer_id GNUNET_PACKED;
631 * Operation ID of the operation that created this event.
633 uint64_t operation_id GNUNET_PACKED;
636 * Identity of the peer.
638 struct GNUNET_PeerIdentity peer_identity;
641 * The size of configuration when uncompressed
643 uint16_t config_size GNUNET_PACKED;
645 /* followed by gzip-compressed configuration of the peer */
651 * Message to request configuration of a slave controller
653 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
656 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETSLAVECONFIG
658 struct GNUNET_MessageHeader header;
661 * The id of the slave host
663 uint32_t slave_id GNUNET_PACKED;
668 uint64_t operation_id GNUNET_PACKED;
674 * Reply to GETSLAVECONFIG message
676 struct GNUNET_TESTBED_SlaveConfiguration
679 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVECONFIG
681 struct GNUNET_MessageHeader header;
684 * The id of the host where the slave is running
686 uint32_t slave_id GNUNET_PACKED;
691 uint64_t operation_id GNUNET_PACKED;
694 * The size of the configuration when uncompressed
696 uint16_t config_size GNUNET_PACKED;
698 /* followed by gzip-compressed configuration of the peer */
703 GNUNET_NETWORK_STRUCT_END
705 /* end of testbed.h */