aboutsummaryrefslogtreecommitdiff
path: root/src/dht/plugin_dhtlog_dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/plugin_dhtlog_dummy.c')
-rw-r--r--src/dht/plugin_dhtlog_dummy.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/src/dht/plugin_dhtlog_dummy.c b/src/dht/plugin_dhtlog_dummy.c
index 0a7091030..2250c0330 100644
--- a/src/dht/plugin_dhtlog_dummy.c
+++ b/src/dht/plugin_dhtlog_dummy.c
@@ -39,7 +39,8 @@
39 * 39 *
40 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 40 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
41 */ 41 */
42int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info) 42int
43add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
43{ 44{
44 return GNUNET_OK; 45 return GNUNET_OK;
45} 46}
@@ -52,7 +53,8 @@ int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
52 * 53 *
53 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 54 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
54 */ 55 */
55int add_round (unsigned int round_type, unsigned int round_count) 56int
57add_round (unsigned int round_type, unsigned int round_count)
56{ 58{
57 return GNUNET_OK; 59 return GNUNET_OK;
58} 60}
@@ -68,8 +70,10 @@ int add_round (unsigned int round_type, unsigned int round_count)
68 * 70 *
69 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 71 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
70 */ 72 */
71int add_round_details (unsigned int round_type, unsigned int round_count, 73int
72 unsigned int num_messages, unsigned int num_messages_succeded) 74add_round_details (unsigned int round_type, unsigned int round_count,
75 unsigned int num_messages,
76 unsigned int num_messages_succeded)
73{ 77{
74 return GNUNET_OK; 78 return GNUNET_OK;
75} 79}
@@ -100,7 +104,7 @@ add_dhtkey (unsigned long long *dhtkeyuid, const GNUNET_HashCode * dhtkey)
100 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 104 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
101 */ 105 */
102int 106int
103add_node (unsigned long long *nodeuid, struct GNUNET_PeerIdentity * node) 107add_node (unsigned long long *nodeuid, struct GNUNET_PeerIdentity *node)
104{ 108{
105 *nodeuid = 1337; 109 *nodeuid = 1337;
106 return GNUNET_OK; 110 return GNUNET_OK;
@@ -132,8 +136,7 @@ update_trials (unsigned int gets_succeeded)
132 */ 136 */
133int 137int
134add_generic_stat (const struct GNUNET_PeerIdentity *peer, 138add_generic_stat (const struct GNUNET_PeerIdentity *peer,
135 const char *name, 139 const char *name, const char *section, uint64_t value)
136 const char *section, uint64_t value)
137{ 140{
138 return GNUNET_OK; 141 return GNUNET_OK;
139} 142}
@@ -167,7 +170,7 @@ add_connections (unsigned int totalConnections)
167int 170int
168add_query (unsigned long long *sqlqueryuid, unsigned long long queryid, 171add_query (unsigned long long *sqlqueryuid, unsigned long long queryid,
169 unsigned int type, unsigned int hops, int succeeded, 172 unsigned int type, unsigned int hops, int succeeded,
170 const struct GNUNET_PeerIdentity * node, const GNUNET_HashCode * key) 173 const struct GNUNET_PeerIdentity *node, const GNUNET_HashCode * key)
171{ 174{
172 *sqlqueryuid = 17; 175 *sqlqueryuid = 17;
173 return GNUNET_OK; 176 return GNUNET_OK;
@@ -191,9 +194,10 @@ add_query (unsigned long long *sqlqueryuid, unsigned long long queryid,
191int 194int
192add_route (unsigned long long *sqlqueryuid, unsigned long long queryid, 195add_route (unsigned long long *sqlqueryuid, unsigned long long queryid,
193 unsigned int type, unsigned int hops, 196 unsigned int type, unsigned int hops,
194 int succeeded, const struct GNUNET_PeerIdentity * node, 197 int succeeded, const struct GNUNET_PeerIdentity *node,
195 const GNUNET_HashCode * key, const struct GNUNET_PeerIdentity * from_node, 198 const GNUNET_HashCode * key,
196 const struct GNUNET_PeerIdentity * to_node) 199 const struct GNUNET_PeerIdentity *from_node,
200 const struct GNUNET_PeerIdentity *to_node)
197{ 201{
198 *sqlqueryuid = 18; 202 *sqlqueryuid = 18;
199 return GNUNET_OK; 203 return GNUNET_OK;
@@ -222,7 +226,8 @@ add_topology (int num_connections)
222 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 226 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
223 */ 227 */
224int 228int
225add_extended_topology (const struct GNUNET_PeerIdentity *first, const struct GNUNET_PeerIdentity *second) 229add_extended_topology (const struct GNUNET_PeerIdentity *first,
230 const struct GNUNET_PeerIdentity *second)
226{ 231{
227 return GNUNET_OK; 232 return GNUNET_OK;
228} 233}
@@ -278,15 +283,15 @@ set_malicious (struct GNUNET_PeerIdentity *peer)
278 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 283 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
279 */ 284 */
280int insert_stat 285int insert_stat
281 (const struct GNUNET_PeerIdentity *peer, unsigned int route_requests, 286 (const struct GNUNET_PeerIdentity *peer, unsigned int route_requests,
282 unsigned int route_forwards, unsigned int result_requests, 287 unsigned int route_forwards, unsigned int result_requests,
283 unsigned int client_requests, unsigned int result_forwards, 288 unsigned int client_requests, unsigned int result_forwards,
284 unsigned int gets, unsigned int puts, 289 unsigned int gets, unsigned int puts,
285 unsigned int data_inserts, unsigned int find_peer_requests, 290 unsigned int data_inserts, unsigned int find_peer_requests,
286 unsigned int find_peers_started, unsigned int gets_started, 291 unsigned int find_peers_started, unsigned int gets_started,
287 unsigned int puts_started, unsigned int find_peer_responses_received, 292 unsigned int puts_started, unsigned int find_peer_responses_received,
288 unsigned int get_responses_received, unsigned int find_peer_responses_sent, 293 unsigned int get_responses_received, unsigned int find_peer_responses_sent,
289 unsigned int get_responses_sent) 294 unsigned int get_responses_sent)
290{ 295{
291 return GNUNET_OK; 296 return GNUNET_OK;
292} 297}
@@ -299,14 +304,15 @@ int insert_stat
299 * @return the handle to the server, or NULL on error 304 * @return the handle to the server, or NULL on error
300 */ 305 */
301void * 306void *
302libgnunet_plugin_dhtlog_dummy_init (void * cls) 307libgnunet_plugin_dhtlog_dummy_init (void *cls)
303{ 308{
304 struct GNUNET_DHTLOG_Plugin *plugin = cls; 309 struct GNUNET_DHTLOG_Plugin *plugin = cls;
310
305#if DEBUG_DHTLOG 311#if DEBUG_DHTLOG
306 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DUMMY DHT Logger: initializing.\n"); 312 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DUMMY DHT Logger: initializing.\n");
307#endif 313#endif
308 GNUNET_assert(plugin->dhtlog_api == NULL); 314 GNUNET_assert (plugin->dhtlog_api == NULL);
309 plugin->dhtlog_api = GNUNET_malloc(sizeof(struct GNUNET_DHTLOG_Handle)); 315 plugin->dhtlog_api = GNUNET_malloc (sizeof (struct GNUNET_DHTLOG_Handle));
310 plugin->dhtlog_api->add_generic_stat = &add_generic_stat; 316 plugin->dhtlog_api->add_generic_stat = &add_generic_stat;
311 plugin->dhtlog_api->insert_round = &add_round; 317 plugin->dhtlog_api->insert_round = &add_round;
312 plugin->dhtlog_api->insert_round_details = &add_round_details; 318 plugin->dhtlog_api->insert_round_details = &add_round_details;
@@ -329,11 +335,10 @@ libgnunet_plugin_dhtlog_dummy_init (void * cls)
329 * Shutdown the plugin. 335 * Shutdown the plugin.
330 */ 336 */
331void * 337void *
332libgnunet_plugin_dhtlog_dummy_done (void * cls) 338libgnunet_plugin_dhtlog_dummy_done (void *cls)
333{ 339{
334#if DEBUG_DHTLOG 340#if DEBUG_DHTLOG
335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 341 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DUMMY DHT Logger: shutdown\n");
336 "DUMMY DHT Logger: shutdown\n");
337#endif 342#endif
338 return NULL; 343 return NULL;
339} 344}