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 * Which host is responsible for managing the delegation? NBO
171 uint32_t slave_host_id GNUNET_PACKED;
174 * The size of the uncompressed configuration
176 uint16_t config_size GNUNET_PACKED;
179 * Set to 1 if the receiving controller is the master controller for
180 * the slave host (and thus responsible for starting it?). 0 if not
182 uint8_t is_subordinate;
184 /* followed by serialized slave configuration;
185 gzip'ed configuration file in INI format */
191 * Message sent from client to testing service to
192 * create (configure, but not start) a peer.
194 struct GNUNET_TESTBED_PeerCreateMessage
198 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
200 struct GNUNET_MessageHeader header;
203 * Unique operation id
205 uint64_t operation_id GNUNET_PACKED;
208 * On which host should the peer be started?
210 uint32_t host_id GNUNET_PACKED;
213 * Unique ID for the peer.
215 uint32_t peer_id GNUNET_PACKED;
218 * Size of the uncompressed configuration
220 uint32_t config_size GNUNET_PACKED;
222 /* followed by serialized peer configuration;
223 gzip'ed configuration file in INI format */
229 * Message sent from client to testing service to
230 * reconfigure a (stopped) a peer.
232 struct GNUNET_TESTBED_PeerReconfigureMessage
236 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
238 struct GNUNET_MessageHeader header;
241 * Unique ID for the peer.
243 uint32_t peer_id GNUNET_PACKED;
246 * Operation ID that is used to identify this operation.
248 uint64_t operation_id GNUNET_PACKED;
250 /* followed by serialized peer configuration;
251 gzip'ed configuration file in INI format */
257 * Message sent from client to testing service to
260 struct GNUNET_TESTBED_PeerStartMessage
264 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
266 struct GNUNET_MessageHeader header;
269 * Unique ID for the peer.
271 uint32_t peer_id GNUNET_PACKED;
274 * Operation ID that is used to identify this operation.
276 uint64_t operation_id GNUNET_PACKED;
282 * Message sent from client to testing service to
285 struct GNUNET_TESTBED_PeerStopMessage
289 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
291 struct GNUNET_MessageHeader header;
294 * Unique ID for the peer.
296 uint32_t peer_id GNUNET_PACKED;
299 * Operation ID that is used to identify this operation.
301 uint64_t operation_id GNUNET_PACKED;
307 * Message sent from client to testing service to
308 * destroy a (stopped) peer.
310 struct GNUNET_TESTBED_PeerDestroyMessage
314 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
316 struct GNUNET_MessageHeader header;
319 * Unique ID for the peer.
321 uint32_t peer_id GNUNET_PACKED;
324 * Operation ID that is used to identify this operation.
326 uint64_t operation_id GNUNET_PACKED;
332 * Message sent from client to testing service to
333 * (re)configure a "physical" link between two peers.
335 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
339 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
341 struct GNUNET_MessageHeader header;
344 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
346 int32_t connect_option GNUNET_PACKED;
349 * Unique ID for the first peer.
351 uint32_t peer1 GNUNET_PACKED;
354 * Unique ID for the second peer.
356 uint32_t peer2 GNUNET_PACKED;
359 * Operation ID that is used to identify this operation.
361 uint64_t operation_id GNUNET_PACKED;
363 /* followed by option-dependent variable-size values */
369 * Message sent from client to testing service to
372 struct GNUNET_TESTBED_OverlayConnectMessage
376 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
378 struct GNUNET_MessageHeader header;
381 * Unique ID for the first peer.
383 uint32_t peer1 GNUNET_PACKED;
386 * Operation ID that is used to identify this operation.
388 uint64_t operation_id GNUNET_PACKED;
391 * Unique ID for the second peer.
393 uint32_t peer2 GNUNET_PACKED;
399 * Event notification from a controller to a client.
401 struct GNUNET_TESTBED_PeerEventMessage
405 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
407 struct GNUNET_MessageHeader header;
410 * 'enum GNUNET_TESTBED_EventType' (in NBO);
411 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
413 int32_t event_type GNUNET_PACKED;
416 * Host where the peer is running.
418 uint32_t host_id GNUNET_PACKED;
421 * Peer that was started or stopped.
423 uint32_t peer_id GNUNET_PACKED;
426 * Operation ID that is used to identify this operation.
428 uint64_t operation_id GNUNET_PACKED;
434 * Event notification from a controller to a client.
436 struct GNUNET_TESTBED_ConnectionEventMessage
440 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
442 struct GNUNET_MessageHeader header;
445 * 'enum GNUNET_TESTBED_EventType' (in NBO);
446 * either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCONNECT.
448 int32_t event_type GNUNET_PACKED;
453 uint32_t peer1 GNUNET_PACKED;
458 uint32_t peer2 GNUNET_PACKED;
461 * Operation ID that is used to identify this operation.
463 uint64_t operation_id GNUNET_PACKED;
469 * Event notification from a controller to a client.
471 struct GNUNET_TESTBED_OperationFailureEventMessage
475 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONEVENT
477 struct GNUNET_MessageHeader header;
480 * 'enum GNUNET_TESTBED_EventType' (in NBO);
481 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
483 int32_t event_type GNUNET_PACKED;
486 * Operation ID of the operation that created this event.
488 uint64_t operation_id GNUNET_PACKED;
490 /* followed by 0-terminated error message */
496 * Event notification from a controller to a client.
498 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
502 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
504 struct GNUNET_MessageHeader header;
507 * Peer identity of the peer that was created.
509 uint32_t peer_id GNUNET_PACKED;
512 * Operation ID of the operation that created this event.
514 uint64_t operation_id GNUNET_PACKED;
520 * Event notification from a controller to a client for
521 * a generic operational success where the operation does
522 * not return any data.
524 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
528 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
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;
549 * Message sent from client to testing service to
550 * obtain the configuration of a peer.
552 struct GNUNET_TESTBED_PeerGetConfigurationMessage
556 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
558 struct GNUNET_MessageHeader header;
561 * Unique ID for the peer.
563 uint32_t peer_id GNUNET_PACKED;
566 * Operation ID that is used to identify this operation.
568 uint64_t operation_id GNUNET_PACKED;
575 * Event notification from a controller to a client.
577 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
581 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
583 struct GNUNET_MessageHeader header;
586 * The id of the peer relevant to this information
588 uint32_t peer_id GNUNET_PACKED;
591 * Operation ID of the operation that created this event.
593 uint64_t operation_id GNUNET_PACKED;
596 * Identity of the peer.
598 struct GNUNET_PeerIdentity peer_identity;
601 * The size of configuration when uncompressed
603 uint16_t config_size;
605 /* followed by gzip-compressed configuration of the peer */