GNUnet  0.19.4
testbed_api_peers.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 
28 #ifndef NEW_TESTING_API_PEERS_H
29 #define NEW_TESTING_API_PEERS_H
30 
31 #include "gnunet_testbed_service.h"
32 #include "gnunet_util_lib.h"
33 
34 
39 {
44 
49 
54 
59 };
60 
61 
67 {
72 
77 
83 
88 
92  uint32_t unique_id;
93 
97  enum PeerState state;
98 
103 };
104 
105 
110 {
115 
120 
125 
129  void *cls;
130 
135 };
136 
137 
142 {
147 
152 
156  void *pcc_cls;
157 };
158 
159 
164 {
169 
170  // PEERDESTROYDATA
171 };
172 
173 
178 {
183 
188 
192  void *cb_cls;
193 
198 };
199 
200 
205 {
210 
214  char *config;
215 
219  uint16_t cfg_size;
220 };
221 
222 
227 {
232 
237 
242 
246  void *cb_cls;
247 
254 };
255 
256 
258 {
260 
261  void *cb_cls;
262 
264 
266 
267  unsigned int start;
268 
269  uint16_t msize;
270 };
271 
272 
283  uint64_t operation_id);
284 
285 
291 void
293 
294 
300 void
302 
303 
307 void
309 
310 #endif
311 /* end of testbed_api_peers.h */
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
API for writing tests and creating large-scale emulation testbeds for GNUnet.
void(* GNUNET_TESTBED_PeerChurnCallback)(void *cls, const char *emsg)
Functions of this signature are called when a peer has been successfully started or stopped.
GNUNET_TESTBED_PeerInformationType
Types of information that can be requested about a peer.
void(* GNUNET_TESTBED_OperationCompletionCallback)(void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
Callback to be called when an operation is completed.
void(* GNUNET_TESTBED_PeerCreateCallback)(void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
Functions of this signature are called when a peer has been successfully created.
void(* GNUNET_TESTBED_PeerInfoCallback)(void *cb_cls, struct GNUNET_TESTBED_Operation *op, const struct GNUNET_TESTBED_PeerInformation *pinfo, const char *emsg)
Callback to be called when the requested peer information is available The peer information in the ca...
Handle to interact with a GNUnet testbed controller.
Definition: testbed_api.h:194
Opaque handle to a host running experiments managed by the testing framework.
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
A peer controlled by the testing framework.
enum PeerState state
Peer's state.
struct GNUNET_TESTBED_Controller * controller
Our controller context (not necessarily the controller that is responsible for starting/running the p...
struct GNUNET_TESTBED_Peer * next
peer list DLL
uint8_t underlay_model_exists
Has an underlay model already set for this peer?
struct GNUNET_TESTBED_Peer * prev
peer list DLL
uint32_t unique_id
Globally unique ID of the peer.
struct GNUNET_TESTBED_Host * host
Which host does this peer run on?
struct GNUNET_TESTBED_Peer * peer
GNUNET_TESTBED_OperationCompletionCallback cb
Context information for GNUNET_TESTBED_Operation.
Definition: testbed_api.h:137
Data structure for OperationType OP_OVERLAY_CONNECT.
void * cb_cls
The closure for the above callback.
struct GNUNET_TESTBED_Peer * p2
Peer B.
GNUNET_TESTBED_OperationCompletionCallback cb
The operation completion callback to call once this operation is done.
struct OperationContext * sub_opc
OperationContext for forwarded operations generated when peer1's controller doesn't have the configur...
struct GNUNET_TESTBED_Peer * p1
Peer A to connect to peer B.
Data for the OperationType OP_PEER_CREATE.
const struct GNUNET_CONFIGURATION_Handle * cfg
The template configuration of the peer.
struct GNUNET_TESTBED_Host * host
The host where the peer has to be created.
struct GNUNET_TESTBED_Peer * peer
The peer structure to return when we get success message.
void * cls
The closure for the above callback.
GNUNET_TESTBED_PeerCreateCallback cb
The call back to call when we receive peer create success message.
Data for the OperationType OP_PEER_DESTROY;.
struct GNUNET_TESTBED_Peer * peer
The peer structure.
Data for OperationType OP_PEER_START and OP_PEER_STOP.
struct GNUNET_TESTBED_Peer * peer
The handle of the peer to start.
GNUNET_TESTBED_PeerChurnCallback pcc
The Peer churn callback to call when this operation is completed.
void * pcc_cls
Closure for the above callback.
Data for the OperationType OP_PEER_INFO.
GNUNET_TESTBED_PeerInfoCallback cb
The Peer info callback to call when this operation has completed.
struct GNUNET_TESTBED_Peer * peer
The peer whose information has been requested.
void * cb_cls
The closure for peer info callback.
enum GNUNET_TESTBED_PeerInformationType pit
The type of peer information requested.
Data for the operations of type OP_PEER_RECONFIGURE.
struct GNUNET_TESTBED_Peer * peer
The peer whose information has been requested.
uint16_t cfg_size
the size of the serialized configuration
char * config
The serialized new configuration template.
void GNUNET_TESTBED_peer_deregister_(struct GNUNET_TESTBED_Peer *peer)
Removes a peer from the peer list.
void GNUNET_TESTBED_cleanup_peers_(void)
Frees all peers.
struct GNUNET_TESTBED_PeerGetConfigurationMessage * GNUNET_TESTBED_generate_peergetconfig_msg_(uint32_t peer_id, uint64_t operation_id)
Generate PeerGetConfigurationMessage.
PeerState
Enumeration of possible states a peer could be in.
@ TESTBED_PS_INVALID
State to signify that this peer is invalid.
@ TESTBED_PS_STOPPED
The peer is stopped.
@ TESTBED_PS_CREATED
The peer has been created.
@ TESTBED_PS_STARTED
The peer is running.
void GNUNET_TESTBED_peer_register_(struct GNUNET_TESTBED_Peer *peer)
Adds a peer to the peer list.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.