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_ADDHOSTCONFIRMED
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 host-id already in use) */
123 * Message to testing service: configure service sharing
126 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
130 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SERVICESHARE
132 struct GNUNET_MessageHeader header;
135 * Host that is being configured.
137 uint32_t host_id GNUNET_PACKED;
140 * Number of peers that should share a service instance;
141 * 1 for no sharing, 0 to forcefully disable the service.
143 uint32_t num_peers GNUNET_PACKED;
145 /* followed by 0-terminated name of the service */
151 * Client notifies controller that it should delegate
152 * requests for a particular client to a particular
155 struct GNUNET_TESTBED_ControllerLinkMessage
159 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS
161 struct GNUNET_MessageHeader header;
164 * For which host should requests be delegated? NBO.
166 uint32_t delegated_host_id GNUNET_PACKED;
169 * The id of the operation which created this message
171 uint64_t operation_id GNUNET_PACKED;
174 * Which host is responsible for managing the delegation? NBO
176 uint32_t slave_host_id GNUNET_PACKED;
179 * The size of the uncompressed configuration
181 uint16_t config_size GNUNET_PACKED;
184 * Set to 1 if the receiving controller is the master controller for
185 * the slave host (and thus responsible for starting it?). 0 if not
187 uint8_t is_subordinate;
189 /* followed by serialized slave configuration;
190 * gzip'ed configuration file in INI format */
196 * Message sent from client to testing service to
197 * create (configure, but not start) a peer.
199 struct GNUNET_TESTBED_PeerCreateMessage
203 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
205 struct GNUNET_MessageHeader header;
208 * Unique operation id
210 uint64_t operation_id GNUNET_PACKED;
213 * On which host should the peer be started?
215 uint32_t host_id GNUNET_PACKED;
218 * Unique ID for the peer.
220 uint32_t peer_id GNUNET_PACKED;
223 * Size of the uncompressed configuration
225 uint32_t config_size GNUNET_PACKED;
227 /* followed by serialized peer configuration;
228 * gzip'ed configuration file in INI format */
234 * Message sent from client to testing service to
235 * reconfigure a (stopped) a peer.
237 struct GNUNET_TESTBED_PeerReconfigureMessage
241 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
243 struct GNUNET_MessageHeader header;
246 * Unique ID for the peer.
248 uint32_t peer_id GNUNET_PACKED;
251 * Operation ID that is used to identify this operation.
253 uint64_t operation_id GNUNET_PACKED;
255 /* followed by serialized peer configuration;
256 * gzip'ed configuration file in INI format */
262 * Message sent from client to testing service to
265 struct GNUNET_TESTBED_PeerStartMessage
269 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
271 struct GNUNET_MessageHeader header;
274 * Unique ID for the peer.
276 uint32_t peer_id GNUNET_PACKED;
279 * Operation ID that is used to identify this operation.
281 uint64_t operation_id GNUNET_PACKED;
287 * Message sent from client to testing service to
290 struct GNUNET_TESTBED_PeerStopMessage
294 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
296 struct GNUNET_MessageHeader header;
299 * Unique ID for the peer.
301 uint32_t peer_id GNUNET_PACKED;
304 * Operation ID that is used to identify this operation.
306 uint64_t operation_id GNUNET_PACKED;
312 * Message sent from client to testing service to
313 * destroy a (stopped) peer.
315 struct GNUNET_TESTBED_PeerDestroyMessage
319 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
321 struct GNUNET_MessageHeader header;
324 * Unique ID for the peer.
326 uint32_t peer_id GNUNET_PACKED;
329 * Operation ID that is used to identify this operation.
331 uint64_t operation_id GNUNET_PACKED;
337 * Message sent from client to testing service to
338 * (re)configure a "physical" link between two peers.
340 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
344 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
346 struct GNUNET_MessageHeader header;
349 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
351 int32_t connect_option GNUNET_PACKED;
354 * Unique ID for the first peer.
356 uint32_t peer1 GNUNET_PACKED;
359 * Unique ID for the second peer.
361 uint32_t peer2 GNUNET_PACKED;
364 * Operation ID that is used to identify this operation.
366 uint64_t operation_id GNUNET_PACKED;
368 /* followed by option-dependent variable-size values */
374 * Message sent from client to testing service to
377 struct GNUNET_TESTBED_OverlayConnectMessage
381 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
383 struct GNUNET_MessageHeader header;
386 * Unique ID for the first peer.
388 uint32_t peer1 GNUNET_PACKED;
391 * Operation ID that is used to identify this operation.
393 uint64_t operation_id GNUNET_PACKED;
396 * Unique ID for the second peer.
398 uint32_t peer2 GNUNET_PACKED;
401 * The ID of the host which runs peer2
403 uint32_t peer2_host_id GNUNET_PACKED;
409 * Message sent from host controller of a peer(A) to the host controller of
410 * another peer(B) to request B to connect to A
412 struct GNUNET_TESTBED_RequestConnectMessage
415 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT
417 struct GNUNET_MessageHeader header;
422 uint32_t peer GNUNET_PACKED;
425 * The Operation ID that is used to identify this operation
427 uint64_t operation_id GNUNET_PACKED;
432 struct GNUNET_PeerIdentity peer_identity;
435 * To be followed by the HELLO message of A
437 struct GNUNET_MessageHeader hello[0];
443 * Event notification from a controller to a client.
445 struct GNUNET_TESTBED_PeerEventMessage
449 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
451 struct GNUNET_MessageHeader header;
454 * 'enum GNUNET_TESTBED_EventType' (in NBO);
455 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
457 int32_t event_type GNUNET_PACKED;
460 * Host where the peer is running.
462 uint32_t host_id GNUNET_PACKED;
465 * Peer that was started or stopped.
467 uint32_t peer_id GNUNET_PACKED;
470 * Operation ID that is used to identify this operation.
472 uint64_t operation_id GNUNET_PACKED;
478 * Event notification from a controller to a client.
480 struct GNUNET_TESTBED_ConnectionEventMessage
484 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
486 struct GNUNET_MessageHeader header;
489 * 'enum GNUNET_TESTBED_EventType' (in NBO);
490 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
492 int32_t event_type GNUNET_PACKED;
497 uint32_t peer1 GNUNET_PACKED;
502 uint32_t peer2 GNUNET_PACKED;
505 * Operation ID that is used to identify this operation.
507 uint64_t operation_id GNUNET_PACKED;
513 * Event notification from a controller to a client.
515 struct GNUNET_TESTBED_OperationFailureEventMessage
519 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT
521 struct GNUNET_MessageHeader header;
524 * 'enum GNUNET_TESTBED_EventType' (in NBO);
525 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
527 int32_t event_type GNUNET_PACKED;
530 * Operation ID of the operation that created this event.
532 uint64_t operation_id GNUNET_PACKED;
534 /* followed by 0-terminated error message */
540 * Event notification from a controller to a client.
542 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
546 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
548 struct GNUNET_MessageHeader header;
551 * Peer identity of the peer that was created.
553 uint32_t peer_id GNUNET_PACKED;
556 * Operation ID of the operation that created this event.
558 uint64_t operation_id GNUNET_PACKED;
564 * Event notification from a controller to a client for
565 * a generic operational success where the operation does
566 * not return any data.
568 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
572 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
574 struct GNUNET_MessageHeader header;
577 * 'enum GNUNET_TESTBED_EventType' (in NBO);
578 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
580 int32_t event_type GNUNET_PACKED;
583 * Operation ID of the operation that created this event.
585 uint64_t operation_id GNUNET_PACKED;
591 * Message sent from client to testing service to
592 * obtain the configuration of a peer.
594 struct GNUNET_TESTBED_PeerGetConfigurationMessage
598 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
600 struct GNUNET_MessageHeader header;
603 * Unique ID for the peer.
605 uint32_t peer_id GNUNET_PACKED;
608 * Operation ID that is used to identify this operation.
610 uint64_t operation_id GNUNET_PACKED;
616 * Peer configuration and identity reply from controller to a client.
618 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
622 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
624 struct GNUNET_MessageHeader header;
627 * The id of the peer relevant to this information
629 uint32_t peer_id GNUNET_PACKED;
632 * Operation ID of the operation that created this event.
634 uint64_t operation_id GNUNET_PACKED;
637 * Identity of the peer.
639 struct GNUNET_PeerIdentity peer_identity;
642 * The size of configuration when uncompressed
644 uint16_t config_size GNUNET_PACKED;
646 /* followed by gzip-compressed configuration of the peer */
652 * Message to request configuration of a slave controller
654 struct GNUNET_TESTBED_SlaveGetConfigurationMessage
657 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETSLAVECONFIG
659 struct GNUNET_MessageHeader header;
662 * The id of the slave host
664 uint32_t slave_id GNUNET_PACKED;
669 uint64_t operation_id GNUNET_PACKED;
675 * Reply to GETSLAVECONFIG message
677 struct GNUNET_TESTBED_SlaveConfiguration
680 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVECONFIG
682 struct GNUNET_MessageHeader header;
685 * The id of the host where the slave is running
687 uint32_t slave_id GNUNET_PACKED;
692 uint64_t operation_id GNUNET_PACKED;
695 * The size of the configuration when uncompressed
697 uint16_t config_size GNUNET_PACKED;
699 /* followed by gzip-compressed configuration of the peer */
704 GNUNET_NETWORK_STRUCT_END
707 /* end of testbed.h */