2 This file is part of GNUnet
3 (C) 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.h
23 * @brief Interface for functions internally exported from testbed_api.c
24 * @author Sree Harsha Totakura
32 * Enumeration of operations
37 * Peer destroy operation
44 * Testbed operation structure
46 struct GNUNET_TESTBED_Operation
49 * next pointer for DLL
51 struct GNUNET_TESTBED_Operation *next;
54 * prev pointer for DLL
56 struct GNUNET_TESTBED_Operation *prev;
59 * The ID for the operation;
61 uint64_t operation_id;
64 * The type of operation
66 enum OperationType type;
69 * Data specific to OperationType
76 * The message queue for sending messages to the controller service
82 * Structure for a controller link
84 struct ControllerLink;
88 * Handle to interact with a GNUnet testbed controller. Each
89 * controller has at least one master handle which is created when the
90 * controller is created; this master handle interacts with the
91 * controller process, destroying it destroys the controller (by
92 * closing stdin of the controller process). Additionally,
93 * controllers can interact with each other (in a P2P fashion); those
94 * links are established via TCP/IP on the controller's service port.
96 struct GNUNET_TESTBED_Controller
100 * The host where the controller is running
102 struct GNUNET_TESTBED_Host *host;
105 * The controller callback
107 GNUNET_TESTBED_ControllerCallback cc;
110 * The closure for controller callback
115 * The configuration to use while connecting to controller
117 struct GNUNET_CONFIGURATION_Handle *cfg;
120 * The client connection handle to the controller service
122 struct GNUNET_CLIENT_Connection *client;
125 * The head of the message queue
127 struct MessageQueue *mq_head;
130 * The tail of the message queue
132 struct MessageQueue *mq_tail;
135 * The head of the ControllerLink list
137 struct ControllerLink *cl_head;
140 * The tail of the ControllerLink list
142 struct ControllerLink *cl_tail;
145 * The client transmit handle
147 struct GNUNET_CLIENT_TransmitHandle *th;
150 * The host registration handle; NULL if no current registration requests are
153 struct GNUNET_TESTBED_HostRegistrationHandle *rh;
156 * The head of the operation queue
158 struct GNUNET_TESTBED_Operation *op_head;
161 * The tail of the operation queue
163 struct GNUNET_TESTBED_Operation *op_tail;
166 * The operation id counter. use current value and increment
168 uint64_t operation_counter;
171 * The controller event mask
176 * Did we start the receive loop yet?
181 * Did we create the host for this?
188 * Queues a message in send queue for sending to the service
190 * @param controller the handle to the controller
191 * @param msg the message to queue
194 GNUNET_TESTBED_queue_message (struct GNUNET_TESTBED_Controller *controller,
195 struct GNUNET_MessageHeader *msg);
199 * Compresses given configuration using zlib compress
201 * @param config the serialized configuration
202 * @param size the size of config
203 * @param xconfig will be set to the compressed configuration (memory is fresly
205 * @return the size of the xconfig
208 GNUNET_TESTBED_compress_config (const char *config, size_t size,
213 * Adds an operation to the queue of operations
215 * @param op the operation to add
218 GNUNET_TESTBED_operation_add (struct GNUNET_TESTBED_Operation *op);