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_Message
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;
62 * Notify the service about a host that we intend to use.
64 struct GNUNET_TESTBED_AddHostMessage
68 * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADDHOST
70 struct GNUNET_MessageHeader header;
73 * Unique ID for the host (in NBO).
75 uint32_t host_id GNUNET_PACKED;
78 * SSH port to use, 0 for default (in NBO).
80 uint16_t ssh_port GNUNET_PACKED;
83 * Number of bytes in the user name that follows;
84 * 0 to use no user name; otherwise 'strlen (username)',
85 * excluding 0-termination!
87 uint16_t user_name_length GNUNET_PACKED;
89 /* followed by 0-terminated user name */
91 /* followed by 0-terminated host name */
97 * Confirmation from the service that adding a host
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 * Is the receiving controller the master controller for
173 * the slave host (and thus responsible for starting it?). NBO.
175 int32_t is_subordinate GNUNET_PACKED;
177 /* followed by serialized slave configuration;
178 gzip'ed configuration file in INI format */
184 * Message sent from client to testing service to
185 * create (configure, but not start) a peer.
187 struct GNUNET_TESTBED_PeerCreateMessage
191 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER
193 struct GNUNET_MessageHeader header;
196 * On which host should the peer be started?
198 uint32_t host_id GNUNET_PACKED;
201 * Unique ID for the peer.
203 uint32_t peer_id GNUNET_PACKED;
205 /* followed by serialized peer configuration;
206 gzip'ed configuration file in INI format */
212 * Message sent from client to testing service to
213 * reconfigure a (stopped) a peer.
215 struct GNUNET_TESTBED_PeerReconfigureMessage
219 * Type is GNUNET_MESSAGE_TYPDE_TESTBED_PEERRECONF
221 struct GNUNET_MessageHeader header;
224 * Unique ID for the peer.
226 uint32_t peer_id GNUNET_PACKED;
229 * Operation ID that is used to identify this operation.
231 uint64_t operation_id GNUNET_PACKED;
233 /* followed by serialized peer configuration;
234 gzip'ed configuration file in INI format */
240 * Message sent from client to testing service to
243 struct GNUNET_TESTBED_PeerStartMessage
247 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STARTPEER
249 struct GNUNET_MessageHeader header;
252 * Unique ID for the peer.
254 uint32_t peer_id GNUNET_PACKED;
257 * Operation ID that is used to identify this operation.
259 uint64_t operation_id GNUNET_PACKED;
265 * Message sent from client to testing service to
268 struct GNUNET_TESTBED_PeerStopMessage
272 * Type is GNUNET_MESSAGE_TYPE_TESTBED_STOPPEER
274 struct GNUNET_MessageHeader header;
277 * Unique ID for the peer.
279 uint32_t peer_id GNUNET_PACKED;
282 * Operation ID that is used to identify this operation.
284 uint64_t operation_id GNUNET_PACKED;
290 * Message sent from client to testing service to
291 * destroy a (stopped) peer.
293 struct GNUNET_TESTBED_PeerDestroyMessage
297 * Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER
299 struct GNUNET_MessageHeader header;
302 * Unique ID for the peer.
304 uint32_t peer_id GNUNET_PACKED;
307 * Operation ID that is used to identify this operation.
309 uint64_t operation_id GNUNET_PACKED;
315 * Message sent from client to testing service to
316 * (re)configure a "physical" link between two peers.
318 struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
322 * Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGULLINK
324 struct GNUNET_MessageHeader header;
327 * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
329 int32_t connect_option GNUNET_PACKED;
332 * Unique ID for the first peer.
334 uint32_t peer1 GNUNET_PACKED;
337 * Unique ID for the second peer.
339 uint32_t peer2 GNUNET_PACKED;
342 * Operation ID that is used to identify this operation.
344 uint64_t operation_id GNUNET_PACKED;
346 /* followed by option-dependent variable-size values */
352 * Message sent from client to testing service to
355 struct GNUNET_TESTBED_OverlayConnectMessage
359 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT
361 struct GNUNET_MessageHeader header;
364 * Unique ID for the first peer.
366 uint32_t peer1 GNUNET_PACKED;
369 * Operation ID that is used to identify this operation.
371 uint64_t operation_id GNUNET_PACKED;
374 * Unique ID for the second peer.
376 uint32_t peer2 GNUNET_PACKED;
382 * Event notification from a controller to a client.
384 struct GNUNET_TESTBED_PeerEventMessage
388 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEEREVENT
390 struct GNUNET_MessageHeader header;
393 * 'enum GNUNET_TESTBED_EventType' (in NBO);
394 * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP.
396 int32_t event_type GNUNET_PACKED;
399 * Host where the peer is running.
401 uint32_t host_id GNUNET_PACKED;
404 * Peer that was started or stopped.
406 uint32_t peer_id GNUNET_PACKED;
409 * Operation ID that is used to identify this operation.
411 uint64_t operation_id GNUNET_PACKED;
417 * Event notification from a controller to a client.
419 struct GNUNET_TESTBED_ConnectionEventMessage
423 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONEVENT
425 struct GNUNET_MessageHeader header;
428 * 'enum GNUNET_TESTBED_EventType' (in NBO);
429 * either GNUNET_TESTBED_ET_PEER_CONNECT or GNUNET_TESTBED_ET_PEER_DISCONNECT.
431 int32_t event_type GNUNET_PACKED;
436 uint32_t peer1 GNUNET_PACKED;
441 uint32_t peer2 GNUNET_PACKED;
444 * Operation ID that is used to identify this operation.
446 uint64_t operation_id GNUNET_PACKED;
452 * Event notification from a controller to a client.
454 struct GNUNET_TESTBED_OperationFailureEventMessage
458 * Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATIONEVENT
460 struct GNUNET_MessageHeader header;
463 * 'enum GNUNET_TESTBED_EventType' (in NBO);
464 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
466 int32_t event_type GNUNET_PACKED;
469 * Operation ID of the operation that created this event.
471 uint64_t operation_id GNUNET_PACKED;
473 /* followed by 0-terminated error message */
479 * Event notification from a controller to a client.
481 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
485 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS
487 struct GNUNET_MessageHeader header;
490 * Peer identity of the peer that was created.
492 uint32_t peer_id GNUNET_PACKED;
495 * Operation ID of the operation that created this event.
497 uint64_t operation_id GNUNET_PACKED;
503 * Event notification from a controller to a client for
504 * a generic operational success where the operation does
505 * not return any data.
507 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
511 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS
513 struct GNUNET_MessageHeader header;
516 * 'enum GNUNET_TESTBED_EventType' (in NBO);
517 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
519 int32_t event_type GNUNET_PACKED;
522 * Operation ID of the operation that created this event.
524 uint64_t operation_id GNUNET_PACKED;
532 * Message sent from client to testing service to
533 * obtain the configuration of a peer.
535 struct GNUNET_TESTBED_PeerGetConfigurationMessage
539 * Type is GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG
541 struct GNUNET_MessageHeader header;
544 * Unique ID for the peer.
546 uint32_t peer_id GNUNET_PACKED;
549 * Operation ID that is used to identify this operation.
551 uint64_t operation_id GNUNET_PACKED;
558 * Event notification from a controller to a client.
560 struct GNUNET_TESTBED_PeerConfigurationInformationMessage
564 * Type is GNUNET_MESSAGE_TYPE_TESTBED_PEERCONFIG
566 struct GNUNET_MessageHeader header;
569 * Peer number of the peer that was created.
571 uint32_t peer_number GNUNET_PACKED;
574 * Operation ID of the operation that created this event.
576 uint64_t operation_id GNUNET_PACKED;
579 * Identity of the peer.
581 struct GNUNET_PeerIdentity peer_id;
583 /* followed by gzip-compressed configuration of the peer */