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"
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_ADDHOSTSUCCESS
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 failure to login and
117 * 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;
404 * Message sent from host controller of a peer(A) to the host controller of
405 * another peer(B) to request B to connect to A
407 struct GNUNET_TESTBED_RequestConnectMessage
410 * Type is GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT
412 struct GNUNET_MessageHeader header;
417 uint32_t peer GNUNET_PACKED;
420 * The Operation ID that is used to identify this operation
422 uint64_t operation_id GNUNET_PACKED;
427 struct GNUNET_PeerIdentity peer_identity;
430 * To be followed by the HELLO message of A
432 struct GNUNET_MessageHeader hello[0];
438 * Event notification from a controller to a client.
440 struct GNUNET_TESTBED_PeerEventMessage
444 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
446 struct GNUNET_MessageHeader header;
449 * 'enum GNUNET_TESTBED_EventType' (in NBO);
450 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
452 int32_t event_type GNUNET_PACKED;
455 * Host where the peer is running.
457 uint32_t host_id GNUNET_PACKED;
460 * Peer that was started or stopped.
462 uint32_t peer_id GNUNET_PACKED;
465 * Operation ID that is used to identify this operation.
467 uint64_t operation_id GNUNET_PACKED;
473 * Event notification from a controller to a client.
475 struct GNUNET_TESTBED_ConnectionEventMessage
479 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
481 struct GNUNET_MessageHeader header;
484 * 'enum GNUNET_TESTBED_EventType' (in NBO);
485 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
487 int32_t event_type GNUNET_PACKED;
492 uint32_t peer1 GNUNET_PACKED;
497 uint32_t peer2 GNUNET_PACKED;
500 * Operation ID that is used to identify this operation.
502 uint64_t operation_id GNUNET_PACKED;
508 * Event notification from a controller to a client.
510 struct GNUNET_TESTBED_OperationFailureEventMessage
514 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONFAILEVENT
516 struct GNUNET_MessageHeader header;
519 * 'enum GNUNET_TESTBED_EventType' (in NBO);
520 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
522 int32_t event_type GNUNET_PACKED;
525 * Operation ID of the operation that created this event.
527 uint64_t operation_id GNUNET_PACKED;
529 /* followed by 0-terminated error message */
535 * Event notification from a controller to a client.
537 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
541 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
543 struct GNUNET_MessageHeader header;
546 * Peer identity of the peer that was created.
548 uint32_t peer_id GNUNET_PACKED;
551 * Operation ID of the operation that created this event.
553 uint64_t operation_id GNUNET_PACKED;
559 * Event notification from a controller to a client for
560 * a generic operational success where the operation does
561 * not return any data.
563 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
567 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
569 struct GNUNET_MessageHeader header;
572 * 'enum GNUNET_TESTBED_EventType' (in NBO);
573 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
575 int32_t event_type GNUNET_PACKED;
578 * Operation ID of the operation that created this event.
580 uint64_t operation_id GNUNET_PACKED;
586 * Message sent from client to testing service to
587 * obtain the configuration of a peer.
589 struct GNUNET_TESTBED_PeerGetConfigurationMessage
593 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
595 struct GNUNET_MessageHeader header;
598 * Unique ID for the peer.
600 uint32_t peer_id GNUNET_PACKED;
603 * Operation ID that is used to identify this operation.
605 uint64_t operation_id GNUNET_PACKED;
611 * Peer configuration and identity reply from controller to a client.
613 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
617 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
619 struct GNUNET_MessageHeader header;
622 * The id of the peer relevant to this information
624 uint32_t peer_id GNUNET_PACKED;
627 * Operation ID of the operation that created this event.
629 uint64_t operation_id GNUNET_PACKED;
632 * Identity of the peer.
634 struct GNUNET_PeerIdentity peer_identity;
637 * The size of configuration when uncompressed
639 uint16_t config_size;
641 /* followed by gzip-compressed configuration of the peer */
647 /* end of testbed.h */