testbed.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. /*
  2. This file is part of GNUnet
  3. Copyright (C) 2008--2013 GNUnet e.V.
  4. GNUnet is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License,
  7. or (at your option) any later version.
  8. GNUnet is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. SPDX-License-Identifier: AGPL3.0-or-later
  15. */
  16. /**
  17. * @file testbed/testbed.h
  18. * @brief IPC messages between testing API and service ("controller")
  19. * @author Christian Grothoff
  20. */
  21. #ifndef TESTBED_H
  22. #define TESTBED_H
  23. #include "gnunet_util_lib.h"
  24. GNUNET_NETWORK_STRUCT_BEGIN
  25. /**
  26. * Initial message from a client to a testing control service.
  27. */
  28. struct GNUNET_TESTBED_InitMessage
  29. {
  30. /**
  31. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_INIT
  32. */
  33. struct GNUNET_MessageHeader header;
  34. /**
  35. * Host ID that the controller is either given (if this is the
  36. * dominating client) or assumed to have (for peer-connections
  37. * between controllers). A controller must check that all
  38. * connections make consistent claims...
  39. */
  40. uint32_t host_id GNUNET_PACKED;
  41. /**
  42. * Event mask that specifies which events this client
  43. * is interested in. In NBO.
  44. */
  45. uint64_t event_mask GNUNET_PACKED;
  46. /* Followed by 0-terminated hostname of the controller */
  47. };
  48. /**
  49. * Notify the service about a host that we intend to use.
  50. */
  51. struct GNUNET_TESTBED_AddHostMessage
  52. {
  53. /**
  54. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST
  55. */
  56. struct GNUNET_MessageHeader header;
  57. /**
  58. * Unique ID for the host (in NBO).
  59. */
  60. uint32_t host_id GNUNET_PACKED;
  61. /**
  62. * SSH port to use, 0 for default (in NBO).
  63. */
  64. uint16_t ssh_port GNUNET_PACKED;
  65. /**
  66. * Number of bytes in the user name that follows;
  67. * 0 to use no user name; otherwise 'strlen (username)',
  68. * excluding 0-termination!
  69. */
  70. uint16_t username_length GNUNET_PACKED;
  71. /**
  72. * Number of bytes in the host name (excluding 0-termination) that follows the
  73. * user name; cannot be 0
  74. */
  75. uint16_t hostname_length GNUNET_PACKED;
  76. /**
  77. * The length of the uncompressed configuration
  78. */
  79. uint16_t config_size GNUNET_PACKED;
  80. /* followed by non 0-terminated user name */
  81. /* followed by non 0-terminated host name */
  82. /* followed by gzip compressed configuration to start or connect to a
  83. controller on this host. While starting the controller this configuration
  84. is used as a template */
  85. };
  86. /**
  87. * Confirmation from the service that adding a host
  88. * worked (or failed).
  89. * FIXME: Where is this required?
  90. */
  91. struct GNUNET_TESTBED_HostConfirmedMessage
  92. {
  93. /**
  94. * Type is GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS
  95. */
  96. struct GNUNET_MessageHeader header;
  97. /**
  98. * Unique ID for the host (in NBO).
  99. */
  100. uint32_t host_id GNUNET_PACKED;
  101. /* followed by the 0-terminated error message (on failure)
  102. * (typical errors include host-id already in use) */
  103. };
  104. /**
  105. * Client notifies controller that it should delegate
  106. * requests for a particular client to a particular
  107. * sub-controller.
  108. */
  109. struct GNUNET_TESTBED_ControllerLinkRequest
  110. {
  111. /**
  112. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS
  113. */
  114. struct GNUNET_MessageHeader header;
  115. /**
  116. * For which host should requests be delegated? NBO.
  117. */
  118. uint32_t delegated_host_id GNUNET_PACKED;
  119. /**
  120. * The id of the operation which created this message
  121. */
  122. uint64_t operation_id GNUNET_PACKED;
  123. /**
  124. * Which host is responsible for managing the delegation? NBO
  125. */
  126. uint32_t slave_host_id GNUNET_PACKED;
  127. /**
  128. * Set to 1 if the receiving controller is the master controller for
  129. * the slave host (and thus responsible for starting it?). 0 if not
  130. */
  131. uint8_t is_subordinate;
  132. };
  133. /**
  134. * Response message for ControllerLinkRequest message
  135. */
  136. struct GNUNET_TESTBED_ControllerLinkResponse
  137. {
  138. /**
  139. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT
  140. */
  141. struct GNUNET_MessageHeader header;
  142. /**
  143. * The size of the compressed configuration. Can be ZERO if the controller is
  144. * not started (depends on the ControllerLinkRequest). NBO.
  145. */
  146. uint16_t config_size GNUNET_PACKED;
  147. /**
  148. * Set to #GNUNET_YES to signify SUCCESS; #GNUNET_NO to signify failure
  149. */
  150. uint16_t success GNUNET_PACKED;
  151. /**
  152. * The id of the operation which created this message. NBO
  153. */
  154. uint64_t operation_id GNUNET_PACKED;
  155. /* If controller linking is successful and configuration is present, then here
  156. * comes the serialized gzip configuration with which the controller is
  157. * running at the delegate host */
  158. /* In case of failure, here comes the error message (without \0 termination)*/
  159. };
  160. /**
  161. * Message sent from client to testing service to
  162. * create (configure, but not start) a peer.
  163. */
  164. struct GNUNET_TESTBED_PeerCreateMessage
  165. {
  166. /**
  167. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER
  168. */
  169. struct GNUNET_MessageHeader header;
  170. /**
  171. * On which host should the peer be started?
  172. */
  173. uint32_t host_id GNUNET_PACKED;
  174. /**
  175. * Unique operation id
  176. */
  177. uint64_t operation_id GNUNET_PACKED;
  178. /**
  179. * Unique ID for the peer.
  180. */
  181. uint32_t peer_id GNUNET_PACKED;
  182. /**
  183. * Size of the uncompressed configuration
  184. */
  185. uint16_t config_size GNUNET_PACKED;
  186. /* followed by serialized peer configuration;
  187. * gzip'ed configuration file in INI format */
  188. };
  189. /**
  190. * Message sent from client to testing service to
  191. * reconfigure a (stopped) a peer.
  192. */
  193. struct GNUNET_TESTBED_PeerReconfigureMessage
  194. {
  195. /**
  196. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER
  197. */
  198. struct GNUNET_MessageHeader header;
  199. /**
  200. * Unique ID for the peer.
  201. */
  202. uint32_t peer_id GNUNET_PACKED;
  203. /**
  204. * Operation ID that is used to identify this operation.
  205. */
  206. uint64_t operation_id GNUNET_PACKED;
  207. /**
  208. * The length of the serialized configuration when uncompressed
  209. */
  210. uint16_t config_size GNUNET_PACKED;
  211. /* followed by serialized peer configuration;
  212. * gzip'ed configuration file in INI format */
  213. };
  214. /**
  215. * Message sent from client to testing service to
  216. * start a peer.
  217. */
  218. struct GNUNET_TESTBED_PeerStartMessage
  219. {
  220. /**
  221. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_START_PEER
  222. */
  223. struct GNUNET_MessageHeader header;
  224. /**
  225. * Unique ID for the peer.
  226. */
  227. uint32_t peer_id GNUNET_PACKED;
  228. /**
  229. * Operation ID that is used to identify this operation.
  230. */
  231. uint64_t operation_id GNUNET_PACKED;
  232. };
  233. /**
  234. * Message sent from client to testing service to
  235. * stop a peer.
  236. */
  237. struct GNUNET_TESTBED_PeerStopMessage
  238. {
  239. /**
  240. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER
  241. */
  242. struct GNUNET_MessageHeader header;
  243. /**
  244. * Unique ID for the peer.
  245. */
  246. uint32_t peer_id GNUNET_PACKED;
  247. /**
  248. * Operation ID that is used to identify this operation.
  249. */
  250. uint64_t operation_id GNUNET_PACKED;
  251. };
  252. /**
  253. * Message sent from client to testing service to
  254. * destroy a (stopped) peer.
  255. */
  256. struct GNUNET_TESTBED_PeerDestroyMessage
  257. {
  258. /**
  259. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER
  260. */
  261. struct GNUNET_MessageHeader header;
  262. /**
  263. * Unique ID for the peer.
  264. */
  265. uint32_t peer_id GNUNET_PACKED;
  266. /**
  267. * Operation ID that is used to identify this operation.
  268. */
  269. uint64_t operation_id GNUNET_PACKED;
  270. };
  271. /**
  272. * Message sent from client to testing service to
  273. * (re)configure a "physical" link between two peers.
  274. */
  275. struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage
  276. {
  277. /**
  278. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_CONFIGURE_UNDERLAY_LINK
  279. */
  280. struct GNUNET_MessageHeader header;
  281. /**
  282. * 'enum GNUNET_TESTBED_ConnectOption' of the option to change
  283. */
  284. int32_t connect_option GNUNET_PACKED;
  285. /**
  286. * Unique ID for the first peer.
  287. */
  288. uint32_t peer1 GNUNET_PACKED;
  289. /**
  290. * Unique ID for the second peer.
  291. */
  292. uint32_t peer2 GNUNET_PACKED;
  293. /**
  294. * Operation ID that is used to identify this operation.
  295. */
  296. uint64_t operation_id GNUNET_PACKED;
  297. /* followed by option-dependent variable-size values */
  298. };
  299. /**
  300. * Message sent from client to testing service to
  301. * connect two peers.
  302. */
  303. struct GNUNET_TESTBED_OverlayConnectMessage
  304. {
  305. /**
  306. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT
  307. */
  308. struct GNUNET_MessageHeader header;
  309. /**
  310. * Unique ID for the first peer.
  311. */
  312. uint32_t peer1 GNUNET_PACKED;
  313. /**
  314. * Operation ID that is used to identify this operation.
  315. */
  316. uint64_t operation_id GNUNET_PACKED;
  317. /**
  318. * Unique ID for the second peer.
  319. */
  320. uint32_t peer2 GNUNET_PACKED;
  321. /**
  322. * The ID of the host which runs peer2
  323. */
  324. uint32_t peer2_host_id GNUNET_PACKED;
  325. };
  326. /**
  327. * Message sent from host controller of a peer(A) to the host controller of
  328. * another peer(B) to request B to connect to A
  329. */
  330. struct GNUNET_TESTBED_RemoteOverlayConnectMessage
  331. {
  332. /**
  333. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
  334. */
  335. struct GNUNET_MessageHeader header;
  336. /**
  337. * The Unique ID of B
  338. */
  339. uint32_t peer GNUNET_PACKED;
  340. /**
  341. * The Operation ID that is used to identify this operation
  342. */
  343. uint64_t operation_id GNUNET_PACKED;
  344. /**
  345. * Identity of A
  346. */
  347. struct GNUNET_PeerIdentity peer_identity;
  348. /**
  349. * To be followed by the HELLO message of A
  350. */
  351. struct GNUNET_MessageHeader hello[0];
  352. // FIXME: we usually do not use this gcc-hack as some
  353. // compilers / tools really get messed up by it...
  354. };
  355. /**
  356. * Event notification from a controller to a client.
  357. */
  358. struct GNUNET_TESTBED_PeerEventMessage
  359. {
  360. /**
  361. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT
  362. */
  363. struct GNUNET_MessageHeader header;
  364. /**
  365. * `enum GNUNET_TESTBED_EventType` (in NBO);
  366. * either #GNUNET_TESTBED_ET_PEER_START or #GNUNET_TESTBED_ET_PEER_STOP.
  367. */
  368. int32_t event_type GNUNET_PACKED;
  369. /**
  370. * Host where the peer is running.
  371. */
  372. uint32_t host_id GNUNET_PACKED;
  373. /**
  374. * Peer that was started or stopped.
  375. */
  376. uint32_t peer_id GNUNET_PACKED;
  377. /**
  378. * Operation ID that is used to identify this operation.
  379. */
  380. uint64_t operation_id GNUNET_PACKED;
  381. };
  382. /**
  383. * Event notification from a controller to a client.
  384. */
  385. struct GNUNET_TESTBED_ConnectionEventMessage
  386. {
  387. /**
  388. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
  389. */
  390. struct GNUNET_MessageHeader header;
  391. /**
  392. * 'enum GNUNET_TESTBED_EventType' (in NBO);
  393. * either #GNUNET_TESTBED_ET_CONNECT or #GNUNET_TESTBED_ET_DISCONNECT.
  394. */
  395. int32_t event_type GNUNET_PACKED;
  396. /**
  397. * First peer.
  398. */
  399. uint32_t peer1 GNUNET_PACKED;
  400. /**
  401. * Second peer.
  402. */
  403. uint32_t peer2 GNUNET_PACKED;
  404. /**
  405. * Operation ID that is used to identify this operation.
  406. */
  407. uint64_t operation_id GNUNET_PACKED;
  408. };
  409. /**
  410. * Event notification from a controller to a client.
  411. */
  412. struct GNUNET_TESTBED_OperationFailureEventMessage
  413. {
  414. /**
  415. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT
  416. */
  417. struct GNUNET_MessageHeader header;
  418. /**
  419. * 'enum GNUNET_TESTBED_EventType' (in NBO);
  420. * #GNUNET_TESTBED_ET_OPERATION_FINISHED.
  421. */
  422. int32_t event_type GNUNET_PACKED;
  423. /**
  424. * Operation ID of the operation that created this event.
  425. */
  426. uint64_t operation_id GNUNET_PACKED;
  427. /* followed by 0-terminated error message */
  428. };
  429. /**
  430. * Event notification from a controller to a client.
  431. */
  432. struct GNUNET_TESTBED_PeerCreateSuccessEventMessage
  433. {
  434. /**
  435. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS
  436. */
  437. struct GNUNET_MessageHeader header;
  438. /**
  439. * Peer identity of the peer that was created.
  440. */
  441. uint32_t peer_id GNUNET_PACKED;
  442. /**
  443. * Operation ID of the operation that created this event.
  444. */
  445. uint64_t operation_id GNUNET_PACKED;
  446. };
  447. /**
  448. * Event notification from a controller to a client for
  449. * a generic operational success where the operation does
  450. * not return any data.
  451. */
  452. struct GNUNET_TESTBED_GenericOperationSuccessEventMessage
  453. {
  454. /**
  455. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS
  456. */
  457. struct GNUNET_MessageHeader header;
  458. /**
  459. * 'enum GNUNET_TESTBED_EventType' (in NBO);
  460. * #GNUNET_TESTBED_ET_OPERATION_FINISHED.
  461. */
  462. int32_t event_type GNUNET_PACKED;
  463. /**
  464. * Operation ID of the operation that created this event.
  465. */
  466. uint64_t operation_id GNUNET_PACKED;
  467. };
  468. /**
  469. * Message sent from client to testing service to
  470. * obtain the configuration of a peer.
  471. */
  472. struct GNUNET_TESTBED_PeerGetConfigurationMessage
  473. {
  474. /**
  475. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_INFORMATION
  476. */
  477. struct GNUNET_MessageHeader header;
  478. /**
  479. * Unique ID for the peer.
  480. */
  481. uint32_t peer_id GNUNET_PACKED;
  482. /**
  483. * Operation ID that is used to identify this operation.
  484. */
  485. uint64_t operation_id GNUNET_PACKED;
  486. };
  487. /**
  488. * Peer configuration and identity reply from controller to a client.
  489. */
  490. struct GNUNET_TESTBED_PeerConfigurationInformationMessage
  491. {
  492. /**
  493. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION
  494. */
  495. struct GNUNET_MessageHeader header;
  496. /**
  497. * The id of the peer relevant to this information
  498. */
  499. uint32_t peer_id GNUNET_PACKED;
  500. /**
  501. * Operation ID of the operation that created this event.
  502. */
  503. uint64_t operation_id GNUNET_PACKED;
  504. /**
  505. * Identity of the peer.
  506. */
  507. struct GNUNET_PeerIdentity peer_identity;
  508. /**
  509. * The size of configuration when uncompressed
  510. */
  511. uint16_t config_size GNUNET_PACKED;
  512. /* followed by gzip-compressed configuration of the peer */
  513. };
  514. /**
  515. * Message to request configuration of a slave controller
  516. */
  517. struct GNUNET_TESTBED_SlaveGetConfigurationMessage
  518. {
  519. /**
  520. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION
  521. */
  522. struct GNUNET_MessageHeader header;
  523. /**
  524. * The id of the slave host
  525. */
  526. uint32_t slave_id GNUNET_PACKED;
  527. /**
  528. * Operation ID
  529. */
  530. uint64_t operation_id GNUNET_PACKED;
  531. };
  532. /**
  533. * Reply to #GNUNET_MESSAGE_TYPE_TESTBED_GET_SLAVE_CONFIGURATION message
  534. */
  535. struct GNUNET_TESTBED_SlaveConfiguration
  536. {
  537. /**
  538. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION
  539. */
  540. struct GNUNET_MessageHeader header;
  541. /**
  542. * The id of the host where the slave is running
  543. */
  544. uint32_t slave_id GNUNET_PACKED;
  545. /**
  546. * Operation ID
  547. */
  548. uint64_t operation_id GNUNET_PACKED;
  549. /**
  550. * The size of the configuration when uncompressed
  551. */
  552. uint16_t config_size GNUNET_PACKED;
  553. /* followed by gzip-compressed configuration of the peer */
  554. };
  555. /**
  556. * Shutdown peers message
  557. */
  558. struct GNUNET_TESTBED_ShutdownPeersMessage
  559. {
  560. /**
  561. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
  562. */
  563. struct GNUNET_MessageHeader header;
  564. /**
  565. * Operation ID
  566. */
  567. uint64_t operation_id GNUNET_PACKED;
  568. };
  569. /**
  570. * Message to start/stop services of a peer
  571. */
  572. struct GNUNET_TESTBED_ManagePeerServiceMessage
  573. {
  574. /**
  575. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS
  576. */
  577. struct GNUNET_MessageHeader header;
  578. /**
  579. * Unique ID of the peer whose service has to be managed.
  580. */
  581. uint32_t peer_id GNUNET_PACKED;
  582. /**
  583. * Operation ID
  584. */
  585. uint64_t operation_id GNUNET_PACKED;
  586. /**
  587. * set this to 1 to start the service; 0 to stop the service
  588. */
  589. uint8_t start;
  590. /**
  591. * The NULL-terminated name of the service to start/stop follows here
  592. */
  593. };
  594. /**
  595. * Message to send underlay link model of a peer. This message will be
  596. * forwarded to the controller running the peer.
  597. */
  598. struct GNUNET_TESTBED_UnderlayLinkModelMsg
  599. {
  600. /**
  601. * Type is #GNUNET_MESSAGE_TYPE_UNDERLAYLINKMODELMSG
  602. */
  603. struct GNUNET_MessageHeader header;
  604. /**
  605. * The number of peer entries contained in this message
  606. */
  607. uint32_t nentries GNUNET_PACKED;
  608. /**
  609. * The number of link properties contained in this message
  610. */
  611. uint32_t nprops GNUNET_PACKED;
  612. /**
  613. * Array of ids of peers to be in the blacklist/whitelist. Each id is of type
  614. * uint32_t. Number of ids should be equal to nentries.
  615. */
  616. /**
  617. * Array of link properties. Each link property is to be arraged in a
  618. * sequence of four integers of type uint32_t: peer_id, latency, loss and
  619. * bandwidth.
  620. */
  621. };
  622. /**************************************/
  623. /* Barriers IPC messages and protocol */
  624. /**************************************/
  625. /**
  626. * The environmental variable which when available refers to the configuration
  627. * file the local testbed controller is using
  628. */
  629. #define ENV_TESTBED_CONFIG "GNUNET_TESTBED_CONTROLLER_CONFIG"
  630. /**
  631. * Message to initialise a barrier
  632. */
  633. struct GNUNET_TESTBED_BarrierInit
  634. {
  635. /**
  636. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT
  637. */
  638. struct GNUNET_MessageHeader header;
  639. /**
  640. * The quorum percentage needed for crossing the barrier
  641. */
  642. uint8_t quorum;
  643. /**
  644. * name of the barrier. Non NULL-terminated.
  645. */
  646. char name[0];
  647. };
  648. /**
  649. * Message to cancel a barrier
  650. */
  651. struct GNUNET_TESTBED_BarrierCancel
  652. {
  653. /**
  654. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL
  655. */
  656. struct GNUNET_MessageHeader header;
  657. /**
  658. * The barrier name. Non NULL terminated
  659. */
  660. char name[0];
  661. };
  662. /**
  663. * Message for signalling status changes of a barrier
  664. */
  665. struct GNUNET_TESTBED_BarrierStatusMsg
  666. {
  667. /**
  668. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS
  669. */
  670. struct GNUNET_MessageHeader header;
  671. /**
  672. * status. Use enumerated values of enum BarrierStatus
  673. */
  674. uint16_t status GNUNET_PACKED;
  675. /**
  676. * strlen of the barrier name
  677. */
  678. uint16_t name_len GNUNET_PACKED;
  679. /**
  680. * the barrier name (0-terminated) concatenated with an error message
  681. * (0-terminated) if the status were to indicate an error
  682. */
  683. char data[0];
  684. };
  685. /**
  686. * Message sent from peers to the testbed-barrier service to indicate that they
  687. * have reached a barrier and are waiting for it to be crossed
  688. */
  689. struct GNUNET_TESTBED_BarrierWait
  690. {
  691. /**
  692. * Type is #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_WAIT
  693. */
  694. struct GNUNET_MessageHeader header;
  695. /**
  696. * The name of the barrier they have reached. Non-NULL terminated.
  697. */
  698. char name[0];
  699. };
  700. GNUNET_NETWORK_STRUCT_END
  701. #endif
  702. /* end of testbed.h */