2 This file is part of GNUnet
3 (C) 2008--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_api_peers.h
23 * @brief internal API to access the 'peers' subsystem
24 * @author Christian Grothoff
25 * @author Sree Harsha Totakura
28 #ifndef NEW_TESTING_API_PEERS_H
29 #define NEW_TESTING_API_PEERS_H
31 #include "gnunet_testbed_service.h"
32 #include "gnunet_helper_lib.h"
36 * Enumeration of possible states a peer could be in
41 * State to signify that this peer is invalid
46 * The peer has been created
63 * A peer controlled by the testing framework. A peer runs
64 * at a particular host.
66 struct GNUNET_TESTBED_Peer
69 * Our controller context (not necessarily the controller
70 * that is responsible for starting/running the peer!).
72 struct GNUNET_TESTBED_Controller *controller;
75 * Which host does this peer run on?
77 struct GNUNET_TESTBED_Host *host;
80 * Globally unique ID of the peer.
92 * Data for the OperationType OP_PEER_CREATE
97 * The host where the peer has to be created
99 struct GNUNET_TESTBED_Host *host;
102 * The template configuration of the peer
104 const struct GNUNET_CONFIGURATION_Handle *cfg;
107 * The call back to call when we receive peer create success message
109 GNUNET_TESTBED_PeerCreateCallback cb;
112 * The closure for the above callback
117 * The peer structure to return when we get success message
119 struct GNUNET_TESTBED_Peer *peer;
125 * Data for OperationType OP_PEER_START and OP_PEER_STOP
130 * The handle of the peer to start
132 struct GNUNET_TESTBED_Peer *peer;
135 * The Peer churn callback to call when this operation is completed
137 GNUNET_TESTBED_PeerChurnCallback pcc;
140 * Closure for the above callback
148 * Data for the OperationType OP_PEER_DESTROY;
150 struct PeerDestroyData
155 struct GNUNET_TESTBED_Peer *peer;
162 * Data for the OperationType OP_PEER_INFO
167 * The peer whose information has been requested
169 struct GNUNET_TESTBED_Peer *peer;
172 * The Peer info callback to call when this operation has completed
174 GNUNET_TESTBED_PeerInfoCallback cb;
177 * The closure for peer info callback
182 * The type of peer information requested
184 enum GNUNET_TESTBED_PeerInformationType pit;
189 * Data structure for OperationType OP_OVERLAY_CONNECT
191 struct OverlayConnectData
195 * Peer A to connect to peer B
197 struct GNUNET_TESTBED_Peer *p1;
202 struct GNUNET_TESTBED_Peer *p2;
205 * The operation completion callback to call once this operation is done
207 GNUNET_TESTBED_OperationCompletionCallback cb;
210 * The closure for the above callback
215 * OperationContext for forwarded operations generated when peer1's controller doesn't have the
216 * configuration of peer2's controller for linking laterally to attemp an
217 * overlay connection between peer 1 and peer 2.
219 struct OperationContext *sub_opc;
222 * The starting time of this operation
224 struct GNUNET_TIME_Absolute tstart;
227 * Has this operation failed
232 * The timing slot index for this operation
234 unsigned int tslot_index;
240 * Generate PeerGetConfigurationMessage
242 * @param peer_id the id of the peer whose information we have to get
243 * @param operation_id the ip of the operation that should be represented in
245 * @return the PeerGetConfigurationMessage
247 struct GNUNET_TESTBED_PeerGetConfigurationMessage *
248 GNUNET_TESTBED_generate_peergetconfig_msg_ (uint32_t peer_id,
249 uint64_t operation_id);
252 /* end of testbed_api_peers.h */