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;
61 * Notify the service about a host that we intend to use.
63 struct GNUNET_TESTBED_AddHostMessage
67 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOST
69 struct GNUNET_MessageHeader header;
72 * Unique ID for the host (in NBO).
74 uint32_t host_id GNUNET_PACKED;
77 * SSH port to use, 0 for default (in NBO).
79 uint16_t ssh_port GNUNET_PACKED;
82 * Number of bytes in the user name that follows;
83 * 0 to use no user name; otherwise 'strlen (username)',
84 * excluding 0-termination!
86 uint16_t user_name_length GNUNET_PACKED;
88 /* followed by 0-terminated user name */
90 /* followed by 0-terminated host name */
96 * Confirmation from the service that adding a host
98 * FIXME: Where is this required?
100 struct GNUNET_TESTBED_HostConfirmedMessage
104 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOSTSUCCESS
106 struct GNUNET_MessageHeader header;
109 * Unique ID for the host (in NBO).
111 uint32_t host_id GNUNET_PACKED;
113 /* followed by the 0-terminated error message (on failure)
114 (typical errors include failure to login and
115 host-id already in use) */
121 * Message to testing service: configure service sharing
124 struct GNUNET_TESTBED_ConfigureSharedServiceMessage
128 * Type is GNUNET_MESSAGE_TYPE_TESTBED_SERVICESHARE
130 struct GNUNET_MessageHeader header;
133 * Host that is being configured.
135 uint32_t host_id GNUNET_PACKED;
138 * Number of peers that should share a service instance;
139 * 1 for no sharing, 0 to forcefully disable the service.
141 uint32_t num_peers GNUNET_PACKED;
143 /* followed by 0-terminated name of the service */
149 * Client notifies controller that it should delegate
150 * requests for a particular client to a particular
153 struct GNUNET_TESTBED_ControllerLinkMessage
157 * Type is GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS
159 struct GNUNET_MessageHeader header;
162 * For which host should requests be delegated? NBO.
164 uint32_t delegated_host_id GNUNET_PACKED;
167 * Which host is responsible for managing the delegation? NBO
169 uint32_t slave_host_id GNUNET_PACKED;
172 * The size of the uncompressed configuration
174 uint16_t config_size GNUNET_PACKED;
177 * Set to 1 if the receiving controller is the master controller for
178 * the slave host (and thus responsible for starting it?). 0 if not
180 uint8_t is_subordinate;
182 /* followed by serialized slave configuration;
183 gzip'ed configuration file in INI format */
189 * Message sent from client to testing service to
190 * create (configure, but not start) a peer.
192 struct GNUNET_TESTBED_PeerCreateMessage
196 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
198 struct GNUNET_MessageHeader header;
201 * Unique operation id
203 uint64_t operation_id GNUNET_PACKED;
206 * On which host should the peer be started?
208 uint32_t host_id GNUNET_PACKED;
211 * Unique ID for the peer.
213 uint32_t peer_id GNUNET_PACKED;
216 * Size of the uncompressed configuration
218 uint32_t config_size GNUNET_PACKED;
220 /* followed by serialized peer configuration;
221 gzip'ed configuration file in INI format */
227 * Message sent from client to testing service to
228 * reconfigure a (stopped) a peer.
230 struct GNUNET_TESTBED_PeerReconfigureMessage
234 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
236 struct GNUNET_MessageHeader header;
239 * Unique ID for the peer.
241 uint32_t peer_id GNUNET_PACKED;
244 * Operation ID that is used to identify this operation.
246 uint64_t operation_id GNUNET_PACKED;
248 /* followed by serialized peer configuration;
249 gzip'ed configuration file in INI format */
255 * Message sent from client to testing service to
258 struct GNUNET_TESTBED_PeerStartMessage
262 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
264 struct GNUNET_MessageHeader header;
267 * Unique ID for the peer.
269 uint32_t peer_id GNUNET_PACKED;
272 * Operation ID that is used to identify this operation.
274 uint64_t operation_id GNUNET_PACKED;
280 * Message sent from client to testing service to
283 struct GNUNET_TESTBED_PeerStopMessage
287 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
289 struct GNUNET_MessageHeader header;
292 * Unique ID for the peer.
294 uint32_t peer_id GNUNET_PACKED;
297 * Operation ID that is used to identify this operation.
299 uint64_t operation_id GNUNET_PACKED;
305 * Message sent from client to testing service to
306 * destroy a (stopped) peer.
308 struct GNUNET_TESTBED_PeerDestroyMessage
312 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
314 struct GNUNET_MessageHeader header;
317 * Unique ID for the peer.
319 uint32_t peer_id GNUNET_PACKED;
322 * Operation ID that is used to identify this operation.
324 uint64_t operation_id GNUNET_PACKED;
330 * Message sent from client to testing service to
331 * (re)configure a "physical" link between two peers.
333 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
337 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
339 struct GNUNET_MessageHeader header;
342 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
344 int32_t connect_option GNUNET_PACKED;
347 * Unique ID for the first peer.
349 uint32_t peer1 GNUNET_PACKED;
352 * Unique ID for the second peer.
354 uint32_t peer2 GNUNET_PACKED;
357 * Operation ID that is used to identify this operation.
359 uint64_t operation_id GNUNET_PACKED;
361 /* followed by option-dependent variable-size values */
367 * Message sent from client to testing service to
370 struct GNUNET_TESTBED_OverlayConnectMessage
374 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
376 struct GNUNET_MessageHeader header;
379 * Unique ID for the first peer.
381 uint32_t peer1 GNUNET_PACKED;
384 * Operation ID that is used to identify this operation.
386 uint64_t operation_id GNUNET_PACKED;
389 * Unique ID for the second peer.
391 uint32_t peer2 GNUNET_PACKED;
397 * Event notification from a controller to a client.
399 struct GNUNET_TESTBED_PeerEventMessage
403 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
405 struct GNUNET_MessageHeader header;
408 * 'enum GNUNET_TESTBED_EventType' (in NBO);
409 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
411 int32_t event_type GNUNET_PACKED;
414 * Host where the peer is running.
416 uint32_t host_id GNUNET_PACKED;
419 * Peer that was started or stopped.
421 uint32_t peer_id GNUNET_PACKED;
424 * Operation ID that is used to identify this operation.
426 uint64_t operation_id GNUNET_PACKED;
432 * Event notification from a controller to a client.
434 struct GNUNET_TESTBED_ConnectionEventMessage
438 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
440 struct GNUNET_MessageHeader header;
443 * 'enum GNUNET_TESTBED_EventType' (in NBO);
444 * either GNUNET_TESTBED_ET_PEER_CONNECT or GNUNET_TESTBED_ET_PEER_DISCONNECT.
446 int32_t event_type GNUNET_PACKED;
451 uint32_t peer1 GNUNET_PACKED;
456 uint32_t peer2 GNUNET_PACKED;
459 * Operation ID that is used to identify this operation.
461 uint64_t operation_id GNUNET_PACKED;
467 * Event notification from a controller to a client.
469 struct GNUNET_TESTBED_OperationFailureEventMessage
473 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONEVENT
475 struct GNUNET_MessageHeader header;
478 * 'enum GNUNET_TESTBED_EventType' (in NBO);
479 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
481 int32_t event_type GNUNET_PACKED;
484 * Operation ID of the operation that created this event.
486 uint64_t operation_id GNUNET_PACKED;
488 /* followed by 0-terminated error message */
494 * Event notification from a controller to a client.
496 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
500 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
502 struct GNUNET_MessageHeader header;
505 * Peer identity of the peer that was created.
507 uint32_t peer_id GNUNET_PACKED;
510 * Operation ID of the operation that created this event.
512 uint64_t operation_id GNUNET_PACKED;
518 * Event notification from a controller to a client for
519 * a generic operational success where the operation does
520 * not return any data.
522 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
526 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
528 struct GNUNET_MessageHeader header;
531 * 'enum GNUNET_TESTBED_EventType' (in NBO);
532 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
534 int32_t event_type GNUNET_PACKED;
537 * Operation ID of the operation that created this event.
539 uint64_t operation_id GNUNET_PACKED;
547 * Message sent from client to testing service to
548 * obtain the configuration of a peer.
550 struct GNUNET_TESTBED_PeerGetConfigurationMessage
554 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
556 struct GNUNET_MessageHeader header;
559 * Unique ID for the peer.
561 uint32_t peer_id GNUNET_PACKED;
564 * Operation ID that is used to identify this operation.
566 uint64_t operation_id GNUNET_PACKED;
573 * Event notification from a controller to a client.
575 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
579 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
581 struct GNUNET_MessageHeader header;
584 * The id of the peer relevant to this information
586 uint32_t peer_id GNUNET_PACKED;
589 * Operation ID of the operation that created this event.
591 uint64_t operation_id GNUNET_PACKED;
594 * Identity of the peer.
596 struct GNUNET_PeerIdentity peer_identity;
599 * The size of configuration when uncompressed
601 uint16_t config_size;
603 /* followed by gzip-compressed configuration of the peer */