testbed.h 18 KB

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