GNUnet  0.19.4
testbed.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2008--2013 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
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  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #ifndef TESTBED_H
28 #define TESTBED_H
29 
30 #include "gnunet_util_lib.h"
31 
37 {
42 
50 
56 
57  /* Followed by 0-terminated hostname of the controller */
58 };
59 
60 
65 {
70 
75 
80 
87 
93 
98 
99  /* followed by non 0-terminated user name */
100 
101  /* followed by non 0-terminated host name */
102 
103  /* followed by gzip compressed configuration to start or connect to a
104  controller on this host. While starting the controller this configuration
105  is used as a template */
106 };
107 
108 
115 {
120 
125 
126  /* followed by the 0-terminated error message (on failure)
127  * (typical errors include host-id already in use) */
128 };
129 
130 
137 {
142 
147 
152 
157 
162  uint8_t is_subordinate;
163 };
164 
165 
170 {
175 
181 
186 
191 
192  /* If controller linking is successful and configuration is present, then here
193  * comes the serialized gzip configuration with which the controller is
194  * running at the delegate host */
195 
196  /* In case of failure, here comes the error message (without \0 termination)*/
197 };
198 
199 
205 {
210 
215 
220 
225 
230 
231  /* followed by serialized peer configuration;
232  * gzip'ed configuration file in INI format */
233 };
234 
235 
241 {
246 
251 
256 
261 
262  /* followed by serialized peer configuration;
263  * gzip'ed configuration file in INI format */
264 };
265 
266 
272 {
277 
282 
287 };
288 
289 
295 {
300 
305 
310 };
311 
312 
318 {
323 
328 
333 };
334 
335 
341 {
346 
351 
356 
361 
366 
367  /* followed by option-dependent variable-size values */
368 };
369 
370 
376 {
381 
386 
391 
396 
401 };
402 
403 
409 {
414 
418  uint32_t peer GNUNET_PACKED;
419 
424 
429 
433  struct GNUNET_MessageHeader hello[0];
434  // FIXME: we usually do not use this gcc-hack as some
435  // compilers / tools really get messed up by it...
436 };
437 
438 
443 {
448 
454 
459 
464 
469 };
470 
471 
476 {
481 
487 
492 
497 
502 };
503 
504 
509 {
514 
520 
525 
526  /* followed by 0-terminated error message */
527 };
528 
529 
534 {
539 
544 
549 };
550 
551 
558 {
563 
569 
574 };
575 
576 
582 {
587 
592 
597 };
598 
599 
604 {
609 
614 
619 
624 
629 
630  /* followed by gzip-compressed configuration of the peer */
631 };
632 
633 
638 {
643 
648 
653 };
654 
655 
660 {
665 
670 
675 
680 
681  /* followed by gzip-compressed configuration of the peer */
682 };
683 
684 
689 {
694 
699 };
700 
701 
706 {
711 
716 
721 
725  uint8_t start;
726 
730 };
731 
732 
738 {
743 
748 
753 
764 };
765 
766 
767 /**************************************/
768 /* Barriers IPC messages and protocol */
769 /**************************************/
770 
771 
776 #define ENV_TESTBED_CONFIG "GNUNET_TESTBED_CONTROLLER_CONFIG"
777 
778 
783 {
788 
792  uint8_t quorum;
793 
797  char name[0];
798 };
799 
800 
805 {
810 
814  char name[0];
815 };
816 
817 
822 {
827 
832 
837 
842  char data[0];
843 };
844 
845 
851 {
856 
860  char name[0];
861 };
862 
863 
865 #endif
866 /* end of testbed.h */
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Notify the service about a host that we intend to use.
Definition: testbed.h:65
uint16_t username_length
Number of bytes in the user name that follows; 0 to use no user name; otherwise 'strlen (username)',...
Definition: testbed.h:86
uint16_t ssh_port
SSH port to use, 0 for default (in NBO).
Definition: testbed.h:79
uint16_t hostname_length
Number of bytes in the host name (excluding 0-termination) that follows the user name; cannot be 0.
Definition: testbed.h:92
uint32_t host_id
Unique ID for the host (in NBO).
Definition: testbed.h:74
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST.
Definition: testbed.h:69
uint16_t config_size
The length of the uncompressed configuration.
Definition: testbed.h:97
Message to cancel a barrier.
Definition: testbed.h:805
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL.
Definition: testbed.h:809
char name[0]
The barrier name.
Definition: testbed.h:814
Message to initialise a barrier.
Definition: testbed.h:783
uint8_t quorum
The quorum percentage needed for crossing the barrier.
Definition: testbed.h:792
char name[0]
name of the barrier.
Definition: testbed.h:797
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT.
Definition: testbed.h:787
Message for signalling status changes of a barrier.
Definition: testbed.h:822
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS.
Definition: testbed.h:826
char data[0]
the barrier name (0-terminated) concatenated with an error message (0-terminated) if the status were ...
Definition: testbed.h:842
uint16_t name_len
strlen of the barrier name
Definition: testbed.h:836
Message sent from peers to the testbed-barrier service to indicate that they have reached a barrier a...
Definition: testbed.h:851
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_WAIT.
Definition: testbed.h:855
char name[0]
The name of the barrier they have reached.
Definition: testbed.h:860
Message sent from client to testing service to (re)configure a "physical" link between two peers.
Definition: testbed.h:341
uint32_t peer2
Unique ID for the second peer.
Definition: testbed.h:360
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:365
uint32_t peer1
Unique ID for the first peer.
Definition: testbed.h:355
int32_t connect_option
'enum GNUNET_TESTBED_ConnectOption' of the option to change
Definition: testbed.h:350
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK.
Definition: testbed.h:345
Event notification from a controller to a client.
Definition: testbed.h:476
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT.
Definition: testbed.h:480
int32_t event_type
'enum GNUNET_TESTBED_EventType' (in NBO); either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCO...
Definition: testbed.h:486
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:501
uint32_t peer2
Second peer.
Definition: testbed.h:496
Client notifies controller that it should delegate requests for a particular client to a particular s...
Definition: testbed.h:137
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS.
Definition: testbed.h:141
uint32_t slave_host_id
Which host is responsible for managing the delegation? NBO.
Definition: testbed.h:156
uint64_t operation_id
The id of the operation which created this message.
Definition: testbed.h:151
uint32_t delegated_host_id
For which host should requests be delegated? NBO.
Definition: testbed.h:146
uint8_t is_subordinate
Set to 1 if the receiving controller is the master controller for the slave host (and thus responsibl...
Definition: testbed.h:162
Response message for ControllerLinkRequest message.
Definition: testbed.h:170
uint64_t operation_id
The id of the operation which created this message.
Definition: testbed.h:190
uint16_t config_size
The size of the compressed configuration.
Definition: testbed.h:180
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT.
Definition: testbed.h:174
uint16_t success
Set to GNUNET_YES to signify SUCCESS; GNUNET_NO to signify failure.
Definition: testbed.h:185
Event notification from a controller to a client for a generic operational success where the operatio...
Definition: testbed.h:558
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS.
Definition: testbed.h:562
int32_t event_type
'enum GNUNET_TESTBED_EventType' (in NBO); GNUNET_TESTBED_ET_OPERATION_FINISHED.
Definition: testbed.h:568
uint64_t operation_id
Operation ID of the operation that created this event.
Definition: testbed.h:573
Confirmation from the service that adding a host worked (or failed).
Definition: testbed.h:115
uint32_t host_id
Unique ID for the host (in NBO).
Definition: testbed.h:124
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS.
Definition: testbed.h:119
Initial message from a client to a testing control service.
Definition: testbed.h:37
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_INIT.
Definition: testbed.h:41
uint64_t event_mask
Event mask that specifies which events this client is interested in.
Definition: testbed.h:55
uint32_t host_id
Host ID that the controller is either given (if this is the dominating client) or assumed to have (fo...
Definition: testbed.h:49
Message to start/stop services of a peer.
Definition: testbed.h:706
uint64_t operation_id
Operation ID.
Definition: testbed.h:720
uint32_t peer_id
Unique ID of the peer whose service has to be managed.
Definition: testbed.h:715
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS.
Definition: testbed.h:710
uint8_t start
set this to 1 to start the service; 0 to stop the service
Definition: testbed.h:725
Event notification from a controller to a client.
Definition: testbed.h:509
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT.
Definition: testbed.h:513
int32_t event_type
'enum GNUNET_TESTBED_EventType' (in NBO); GNUNET_TESTBED_ET_OPERATION_FINISHED.
Definition: testbed.h:519
uint64_t operation_id
Operation ID of the operation that created this event.
Definition: testbed.h:524
Message sent from client to testing service to connect two peers.
Definition: testbed.h:376
uint32_t peer1
Unique ID for the first peer.
Definition: testbed.h:385
uint32_t peer2
Unique ID for the second peer.
Definition: testbed.h:395
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT.
Definition: testbed.h:380
uint32_t peer2_host_id
The ID of the host which runs peer2.
Definition: testbed.h:400
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:390
Peer configuration and identity reply from controller to a client.
Definition: testbed.h:604
uint64_t operation_id
Operation ID of the operation that created this event.
Definition: testbed.h:618
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION.
Definition: testbed.h:608
struct GNUNET_PeerIdentity peer_identity
Identity of the peer.
Definition: testbed.h:623
uint16_t config_size
The size of configuration when uncompressed.
Definition: testbed.h:628
uint32_t peer_id
The id of the peer relevant to this information.
Definition: testbed.h:613
Message sent from client to testing service to create (configure, but not start) a peer.
Definition: testbed.h:205
uint32_t host_id
On which host should the peer be started?
Definition: testbed.h:214
uint32_t peer_id
Unique ID for the peer.
Definition: testbed.h:224
uint64_t operation_id
Unique operation id.
Definition: testbed.h:219
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER.
Definition: testbed.h:209
uint16_t config_size
Size of the uncompressed configuration.
Definition: testbed.h:229
Event notification from a controller to a client.
Definition: testbed.h:534
uint32_t peer_id
Peer identity of the peer that was created.
Definition: testbed.h:543
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS.
Definition: testbed.h:538
uint64_t operation_id
Operation ID of the operation that created this event.
Definition: testbed.h:548
Message sent from client to testing service to destroy a (stopped) peer.
Definition: testbed.h:318
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER.
Definition: testbed.h:322
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:332
uint32_t peer_id
Unique ID for the peer.
Definition: testbed.h:327
Event notification from a controller to a client.
Definition: testbed.h:443
uint32_t peer_id
Peer that was started or stopped.
Definition: testbed.h:463
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT.
Definition: testbed.h:447
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:468
int32_t event_type
enum GNUNET_TESTBED_EventType (in NBO); either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER...
Definition: testbed.h:453
uint32_t host_id
Host where the peer is running.
Definition: testbed.h:458
Message sent from client to testing service to obtain the configuration of a peer.
Definition: testbed.h:582
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:596
uint32_t peer_id
Unique ID for the peer.
Definition: testbed.h:591
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_INFORMATION.
Definition: testbed.h:586
Message sent from client to testing service to reconfigure a (stopped) a peer.
Definition: testbed.h:241
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER.
Definition: testbed.h:245
uint16_t config_size
The length of the serialized configuration when uncompressed.
Definition: testbed.h:260
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:255
uint32_t peer_id
Unique ID for the peer.
Definition: testbed.h:250
Message sent from client to testing service to start a peer.
Definition: testbed.h:272
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_START_PEER.
Definition: testbed.h:276
uint32_t peer_id
Unique ID for the peer.
Definition: testbed.h:281
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:286
Message sent from client to testing service to stop a peer.
Definition: testbed.h:295
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER.
Definition: testbed.h:299
uint32_t peer_id
Unique ID for the peer.
Definition: testbed.h:304
uint64_t operation_id
Operation ID that is used to identify this operation.
Definition: testbed.h:309
Message sent from host controller of a peer(A) to the host controller of another peer(B) to request B...
Definition: testbed.h:409
struct GNUNET_PeerIdentity peer_identity
Identity of A.
Definition: testbed.h:428
struct GNUNET_MessageHeader hello[0]
To be followed by the HELLO message of A.
Definition: testbed.h:433
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT.
Definition: testbed.h:413
uint32_t peer
The Unique ID of B.
Definition: testbed.h:418
uint64_t operation_id
The Operation ID that is used to identify this operation.
Definition: testbed.h:423
Shutdown peers message.
Definition: testbed.h:689
uint64_t operation_id
Operation ID.
Definition: testbed.h:698
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS.
Definition: testbed.h:693
Reply to GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION message.
Definition: testbed.h:660
uint64_t operation_id
Operation ID.
Definition: testbed.h:674
uint16_t config_size
The size of the configuration when uncompressed.
Definition: testbed.h:679
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION.
Definition: testbed.h:664
uint32_t slave_id
The id of the host where the slave is running.
Definition: testbed.h:669
Message to request configuration of a slave controller.
Definition: testbed.h:638
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION.
Definition: testbed.h:642
uint32_t slave_id
The id of the slave host.
Definition: testbed.h:647
Message to send underlay link model of a peer.
Definition: testbed.h:738
struct GNUNET_MessageHeader header
Type is #GNUNET_MESSAGE_TYPE_UNDERLAYLINKMODELMSG.
Definition: testbed.h:742
uint32_t nprops
The number of link properties contained in this message.
Definition: testbed.h:752
uint32_t nentries
The number of peer entries contained in this message.
Definition: testbed.h:747