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
42 struct GNUNET_MessageHeader header;
45 * Host ID that the controller is either given
46 * (if this is the dominating client communicating
47 * via stdin) or assumed to have (for peer-connections
48 * between controllers).
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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;
500 * Identity of the peer.
502 struct GNUNET_PeerIdentity peer_id;
504 /* followed by gzip-compressed configuration of the peer */
510 * Event notification from a controller to a client for
511 * a generic operational success where the operation does
512 * not return any data.
514 struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
520 struct GNUNET_MessageHeader header;
523 * 'enum GNUNET_TESTBED_EventType' (in NBO);
524 * GNUNET_TESTBED_ET_OPERATION_FINISHED.
526 int32_t event_type GNUNET_PACKED;
529 * Operation ID of the operation that created this event.
531 uint64_t operation_id GNUNET_PACKED;