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
35 * Initial message from a client to a testing control service.
37 struct GNUNET_TESTBED_InitMessage
41 * Type is GNUNET_MESSAGE_TYPE_TESTBED_INIT
43 struct GNUNET_MessageHeader header;
46 * Host ID that the controller is either given (if this is the
47 * dominating client) or assumed to have (for peer-connections
48 * between controllers). A controller must check that all
49 * connections make consistent claims...
51 uint32_t host_id GNUNET_PACKED;
54 * Event mask that specifies which events this client
55 * is interested in. In NBO.
57 uint64_t event_mask GNUNET_PACKED;
59 /* Followed by 0-terminated hostname of the controller */
64 * Notify the service about a host that we intend to use.
66 struct GNUNET_TESTBED_AddHostMessage
70 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOST
72 struct GNUNET_MessageHeader header;
75 * Unique ID for the host (in NBO).
77 uint32_t host_id GNUNET_PACKED;
80 * SSH port to use, 0 for default (in NBO).
82 uint16_t ssh_port GNUNET_PACKED;
85 * Number of bytes in the user name that follows;
86 * 0 to use no user name; otherwise 'strlen (username)',
87 * excluding 0-termination!
89 uint16_t user_name_length GNUNET_PACKED;
91 /* followed by 0-terminated user name */
93 /* followed by 0-terminated host name */
99 * Confirmation from the service that adding a host
100 * worked (or failed).
101 * FIXME: Where is this required?
103 struct GNUNET_TESTBED_HostConfirmedMessage
107 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTSUCCESS
109 struct GNUNET_MessageHeader header;
112 * Unique ID for the host (in NBO).
114 uint32_t host_id GNUNET_PACKED;
116 /* followed by the 0-terminated error message (on failure)
117 * (typical errors include failure to login and
118 * host-id already in use) */
124 * Message to testing service: configure service sharing
127 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
131 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SERVICESHARE
133 struct GNUNET_MessageHeader header;
136 * Host that is being configured.
138 uint32_t host_id GNUNET_PACKED;
141 * Number of peers that should share a service instance;
142 * 1 for no sharing, 0 to forcefully disable the service.
144 uint32_t num_peers GNUNET_PACKED;
146 /* followed by 0-terminated name of the service */
152 * Client notifies controller that it should delegate
153 * requests for a particular client to a particular
156 struct GNUNET_TESTBED_ControllerLinkMessage
160 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS
162 struct GNUNET_MessageHeader header;
165 * For which host should requests be delegated? NBO.
167 uint32_t delegated_host_id GNUNET_PACKED;
170 * The id of the operation which created this message
172 uint64_t operation_id GNUNET_PACKED;
175 * Which host is responsible for managing the delegation? NBO
177 uint32_t slave_host_id GNUNET_PACKED;
180 * The size of the uncompressed configuration
182 uint16_t config_size GNUNET_PACKED;
185 * Set to 1 if the receiving controller is the master controller for
186 * the slave host (and thus responsible for starting it?). 0 if not
188 uint8_t is_subordinate;
190 /* followed by serialized slave configuration;
191 * gzip'ed configuration file in INI format */
197 * Message sent from client to testing service to
198 * create (configure, but not start) a peer.
200 struct GNUNET_TESTBED_PeerCreateMessage
204 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
206 struct GNUNET_MessageHeader header;
209 * Unique operation id
211 uint64_t operation_id GNUNET_PACKED;
214 * On which host should the peer be started?
216 uint32_t host_id GNUNET_PACKED;
219 * Unique ID for the peer.
221 uint32_t peer_id GNUNET_PACKED;
224 * Size of the uncompressed configuration
226 uint32_t config_size GNUNET_PACKED;
228 /* followed by serialized peer configuration;
229 * gzip'ed configuration file in INI format */
235 * Message sent from client to testing service to
236 * reconfigure a (stopped) a peer.
238 struct GNUNET_TESTBED_PeerReconfigureMessage
242 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
244 struct GNUNET_MessageHeader header;
247 * Unique ID for the peer.
249 uint32_t peer_id GNUNET_PACKED;
252 * Operation ID that is used to identify this operation.
254 uint64_t operation_id GNUNET_PACKED;
256 /* followed by serialized peer configuration;
257 * gzip'ed configuration file in INI format */
263 * Message sent from client to testing service to
266 struct GNUNET_TESTBED_PeerStartMessage
270 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
272 struct GNUNET_MessageHeader header;
275 * Unique ID for the peer.
277 uint32_t peer_id GNUNET_PACKED;
280 * Operation ID that is used to identify this operation.
282 uint64_t operation_id GNUNET_PACKED;
288 * Message sent from client to testing service to
291 struct GNUNET_TESTBED_PeerStopMessage
295 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
297 struct GNUNET_MessageHeader header;
300 * Unique ID for the peer.
302 uint32_t peer_id GNUNET_PACKED;
305 * Operation ID that is used to identify this operation.
307 uint64_t operation_id GNUNET_PACKED;
313 * Message sent from client to testing service to
314 * destroy a (stopped) peer.
316 struct GNUNET_TESTBED_PeerDestroyMessage
320 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
322 struct GNUNET_MessageHeader header;
325 * Unique ID for the peer.
327 uint32_t peer_id GNUNET_PACKED;
330 * Operation ID that is used to identify this operation.
332 uint64_t operation_id GNUNET_PACKED;
338 * Message sent from client to testing service to
339 * (re)configure a "physical" link between two peers.
341 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
345 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
347 struct GNUNET_MessageHeader header;
350 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
352 int32_t connect_option GNUNET_PACKED;
355 * Unique ID for the first peer.
357 uint32_t peer1 GNUNET_PACKED;
360 * Unique ID for the second peer.
362 uint32_t peer2 GNUNET_PACKED;
365 * Operation ID that is used to identify this operation.
367 uint64_t operation_id GNUNET_PACKED;
369 /* followed by option-dependent variable-size values */
375 * Message sent from client to testing service to
378 struct GNUNET_TESTBED_OverlayConnectMessage
382 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
384 struct GNUNET_MessageHeader header;
387 * Unique ID for the first peer.
389 uint32_t peer1 GNUNET_PACKED;
392 * Operation ID that is used to identify this operation.
394 uint64_t operation_id GNUNET_PACKED;
397 * Unique ID for the second peer.
399 uint32_t peer2 GNUNET_PACKED;
402 * The ID of the host which runs peer2
404 uint32_t peer2_host_id GNUNET_PACKED;
410 * Message sent from host controller of a peer(A) to the host controller of
411 * another peer(B) to request B to connect to A
413 struct GNUNET_TESTBED_RequestConnectMessage
416 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT
418 struct GNUNET_MessageHeader header;
423 uint32_t peer GNUNET_PACKED;
426 * The Operation ID that is used to identify this operation
428 uint64_t operation_id GNUNET_PACKED;
433 struct GNUNET_PeerIdentity peer_identity;
436 * To be followed by the HELLO message of A
438 struct GNUNET_MessageHeader hello[0];
444 * Event notification from a controller to a client.
446 struct GNUNET_TESTBED_PeerEventMessage
450 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
452 struct GNUNET_MessageHeader header;
455 * 'enum GNUNET_TESTBED_EventType' (in NBO);
456 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
458 int32_t event_type GNUNET_PACKED;
461 * Host where the peer is running.
463 uint32_t host_id GNUNET_PACKED;
466 * Peer that was started or stopped.
468 uint32_t peer_id GNUNET_PACKED;
471 * Operation ID that is used to identify this operation.
473 uint64_t operation_id GNUNET_PACKED;
479 * Event notification from a controller to a client.
481 struct GNUNET_TESTBED_ConnectionEventMessage
485 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
487 struct GNUNET_MessageHeader header;
490 * 'enum GNUNET_TESTBED_EventType' (in NBO);
491 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
493 int32_t event_type GNUNET_PACKED;
498 uint32_t peer1 GNUNET_PACKED;
503 uint32_t peer2 GNUNET_PACKED;
506 * Operation ID that is used to identify this operation.
508 uint64_t operation_id GNUNET_PACKED;
514 * Event notification from a controller to a client.
516 struct GNUNET_TESTBED_OperationFailureEventMessage
520 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT
522 struct GNUNET_MessageHeader header;
525 * 'enum GNUNET_TESTBED_EventType' (in NBO);
526 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
528 int32_t event_type GNUNET_PACKED;
531 * Operation ID of the operation that created this event.
533 uint64_t operation_id GNUNET_PACKED;
535 /* followed by 0-terminated error message */
541 * Event notification from a controller to a client.
543 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
547 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
549 struct GNUNET_MessageHeader header;
552 * Peer identity of the peer that was created.
554 uint32_t peer_id GNUNET_PACKED;
557 * Operation ID of the operation that created this event.
559 uint64_t operation_id GNUNET_PACKED;
565 * Event notification from a controller to a client for
566 * a generic operational success where the operation does
567 * not return any data.
569 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
573 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
575 struct GNUNET_MessageHeader header;
578 * 'enum GNUNET_TESTBED_EventType' (in NBO);
579 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
581 int32_t event_type GNUNET_PACKED;
584 * Operation ID of the operation that created this event.
586 uint64_t operation_id GNUNET_PACKED;
592 * Message sent from client to testing service to
593 * obtain the configuration of a peer.
595 struct GNUNET_TESTBED_PeerGetConfigurationMessage
599 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
601 struct GNUNET_MessageHeader header;
604 * Unique ID for the peer.
606 uint32_t peer_id GNUNET_PACKED;
609 * Operation ID that is used to identify this operation.
611 uint64_t operation_id GNUNET_PACKED;
617 * Peer configuration and identity reply from controller to a client.
619 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
623 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
625 struct GNUNET_MessageHeader header;
628 * The id of the peer relevant to this information
630 uint32_t peer_id GNUNET_PACKED;
633 * Operation ID of the operation that created this event.
635 uint64_t operation_id GNUNET_PACKED;
638 * Identity of the peer.
640 struct GNUNET_PeerIdentity peer_identity;
643 * The size of configuration when uncompressed
645 uint16_t config_size GNUNET_PACKED;
647 /* followed by gzip-compressed configuration of the peer */
653 * Message to request configuration of a slave controller
655 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
658 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETSLAVECONFIG
660 struct GNUNET_MessageHeader header;
663 * The id of the slave host
665 uint32_t slave_id GNUNET_PACKED;
670 uint64_t operation_id GNUNET_PACKED;
676 * Reply to GETSLAVECONFIG message
678 struct GNUNET_TESTBED_SlaveConfiguration
681 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVECONFIG
683 struct GNUNET_MessageHeader header;
686 * The id of the host where the slave is running
688 uint32_t slave_id GNUNET_PACKED;
693 uint64_t operation_id GNUNET_PACKED;
696 * The size of the configuration when uncompressed
698 uint16_t config_size GNUNET_PACKED;
700 /* followed by gzip-compressed configuration of the peer */
706 * Message sent from a controller to the testbed API seeking the configuration
707 * of the host whose id is contained in the message.
709 struct GNUNET_TESTBED_NeedControllerConfig
712 * Type is GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG
714 struct GNUNET_MessageHeader header;
717 * The id of the controller host
719 uint32_t controller_host_id GNUNET_PACKED;
724 uint64_t operation_id GNUNET_PACKED;
728 GNUNET_NETWORK_STRUCT_END
731 /* end of testbed.h */