2 This file is part of GNUnet.
3 (C) 2013 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.
21 * @file scalarproduct/scalarproduct_testing.h
22 * @brief VectorProduct testcase common declarations
23 * @author Gaurav Kukreja
24 * @author Christian Fuchs
26 * Created on June 29, 2013, 7:39 PM
29 #ifndef SCALARPRODUCT_TESTING_H
30 #define SCALARPRODUCT_TESTING_H
36 struct GNUNET_SCALARPRODUCT_TESTING_handle
39 * Testing library system handle
41 struct GNUNET_TESTING_System *tl_system;
46 struct PeerContext *p_head;
51 struct PeerContext *p_tail;
57 * Next element in the DLL
59 struct PeerContext *next;
62 * Previous element in the DLL
64 struct PeerContext *prev;
67 * Peer's testing handle
69 struct GNUNET_TESTING_Peer *peer;
74 struct GNUNET_PeerIdentity id;
77 * Handle for the peer's ARM process
79 struct GNUNET_OS_Process *arm_proc;
82 * Pointer to Vector Product Handle
84 struct GNUNET_SCALARPRODUCT_Handle *vh;
87 * Closure for the callbacks
92 * An unique number to identify the peer
97 * Peer's configuration
99 struct GNUNET_CONFIGURATION_Handle *cfg;
102 * Pointer to the master testing handle
104 struct GNUNET_SCALARPRODUCT_TESTING_handle * vth;
107 * Callback when two peers are connected and both have called the connect callback
108 * to notify clients about a new peer
110 void (*start_cb) (struct PeerContext * p, void *cls);
113 // * Pointer to function where the test occurs
115 // GNUNET_SCALARPRODUCT_TESTING_start_cb start_cb;
119 * Callback when two peers are connected and both have called the connect callback
120 * to notify clients about a new peer
122 typedef void (*GNUNET_SCALARPRODUCT_TESTING_start_cb) (struct PeerContext * p,
125 struct GNUNET_SCALARPRODUCT_TESTING_handle *
126 GNUNET_SCALARPRODUCT_TESTING_init();
129 GNUNET_SCALARPRODUCT_TESTING_done(struct GNUNET_SCALARPRODUCT_TESTING_handle * vth);
132 GNUNET_SCALARPRODUCT_TESTING_start_peer (struct GNUNET_SCALARPRODUCT_TESTING_handle * vth,
133 const char *cfgname, int peer_id,
134 GNUNET_SCALARPRODUCT_TESTING_start_cb start_cb,
138 GNUNET_SCALARPRODUCT_TESTING_stop_peer
139 (struct GNUNET_SCALARPRODUCT_TESTING_handle * vth,
140 struct PeerContext *p);
149 #endif /* SCALARPRODUCT_TESTING_H */