2 This file is part of GNUnet.
3 (C) 2006 - 2009 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 2, 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 src/dht/plugin_dhtlog_mysql_dump_load.c
23 * @brief MySQL logging plugin to record DHT operations to MySQL server,
24 * but write all queries to file instead of the actual server
25 * so that they can be imported later. Since the first attempt
26 * (writing out SQL queries) seemed rather time consuming on insert,
27 * this plugin writes out tab separated values instead.
29 * @author Nathan Evans
35 #include "gnunet_util_lib.h"
39 #define DEBUG_DHTLOG GNUNET_YES
42 * Maximum number of supported parameters for a prepared
43 * statement. Increase if needed.
48 static unsigned long max_varchar_len;
51 * The configuration the DHT service is running with
53 static const struct GNUNET_CONFIGURATION_Handle *cfg;
55 #define DATE_STR_SIZE 50
57 static unsigned int topology_count;
60 * File(s) to dump all sql statements to.
63 FILE *generic_stat_outfile;
69 FILE *extended_topology_outfile;
74 static char date[DATE_STR_SIZE];
79 memset (date, 0, DATE_STR_SIZE);
80 tmptr = localtime (&timetmp);
82 strftime (date, DATE_STR_SIZE, "%Y-%m-%d %H:%M:%S", tmptr);
90 * Records the current topology (number of connections, time, trial)
92 * @param num_connections how many connections are in the topology
94 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
97 add_topology (int num_connections)
102 return GNUNET_SYSERR;
106 "insert into topology (trialuid, date, connections) values (@temp_trial, \"%s\", %d);\n",
107 get_sql_time (), num_connections);
109 return GNUNET_SYSERR;
112 "select max(topology_uid) from topology into @temp_topology;\n");
115 return GNUNET_SYSERR;
119 * Inserts the specified round into the dhttests.rounds table
121 * @param round_type the type of round that is being started
122 * @param round_count counter for the round (if applicable)
124 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
127 add_round (unsigned int round_type, unsigned int round_count)
132 return GNUNET_SYSERR;
136 "insert into rounds (trialuid, round_type, round_count, starttime) values (@temp_trial, \"%u\", \"%u\", \"%s\");\n",
137 round_type, round_count, get_sql_time ());
141 return GNUNET_SYSERR;
146 * Inserts the specified round results into the
147 * dhttests.processed_round_details table
149 * @param round_type the type of round that is being started
150 * @param round_count counter for the round (if applicable)
151 * @param num_messages the total number of messages initiated
152 * @param num_messages_succeeded the number of messages that succeeded
154 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
157 add_round_details (unsigned int round_type, unsigned int round_count,
158 unsigned int num_messages,
159 unsigned int num_messages_succeeded)
164 return GNUNET_SYSERR;
168 "insert into processed_trial_rounds (trialuid, round_type, round_count, starttime, endtime, num_messages, num_messages_succeeded) values (@temp_trial, \"%u\", \"%u\", \"%s\", \"%s\", \"%u\", \"%u\");\n",
169 round_type, round_count, get_sql_time (), get_sql_time (),
170 num_messages, num_messages_succeeded);
174 return GNUNET_SYSERR;
178 * Records a connection between two peers in the current topology
180 * @param first one side of the connection
181 * @param second other side of the connection
183 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
186 add_extended_topology (const struct GNUNET_PeerIdentity *first,
187 const struct GNUNET_PeerIdentity *second)
192 return GNUNET_SYSERR;
195 fprintf (extended_topology_outfile,
196 "insert into extended_topology (topology_uid, uid_first, uid_second) values (%u, %s,",
197 topology_count, GNUNET_h2s_full (&first->hashPubKey));
199 return GNUNET_SYSERR;
201 fprintf (extended_topology_outfile, "%s);\n",
202 GNUNET_h2s_full (&second->hashPubKey));
206 return GNUNET_SYSERR;
211 * Inserts the specified trial into the dhttests.trials table
213 * @param trial_info struct containing the data to insert about this trial
215 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
218 add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
223 return GNUNET_SYSERR;
227 "INSERT INTO trials "
228 "(starttime, other_trial_identifier, numnodes, topology,"
229 "blacklist_topology, connect_topology, connect_topology_option,"
230 "connect_topology_option_modifier, topology_percentage, topology_probability,"
232 "concurrent, settle_time, num_rounds, malicious_getters,"
233 "malicious_putters, malicious_droppers, malicious_get_frequency,"
234 "malicious_put_frequency, stop_closest, stop_found, strict_kademlia, "
235 "gets_succeeded, message) "
236 "VALUES (\"%s\", %u, %u, %u, %u, %u, %u, %f, %f, %f, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, \"%s\");\n",
237 get_sql_time (), trial_info->other_identifier,
238 trial_info->num_nodes, trial_info->topology,
239 trial_info->blacklist_topology, trial_info->connect_topology,
240 trial_info->connect_topology_option,
241 trial_info->connect_topology_option_modifier,
242 trial_info->topology_percentage,
243 trial_info->topology_probability, trial_info->puts,
244 trial_info->gets, trial_info->concurrent,
245 trial_info->settle_time, trial_info->num_rounds,
246 trial_info->malicious_getters, trial_info->malicious_putters,
247 trial_info->malicious_droppers,
248 trial_info->malicious_get_frequency,
249 trial_info->malicious_put_frequency, trial_info->stop_closest,
250 trial_info->stop_found, trial_info->strict_kademlia,
251 trial_info->gets_succeeded, trial_info->message);
254 return GNUNET_SYSERR;
258 "SELECT MAX( trialuid ) FROM trials into @temp_trial;\n");
263 return GNUNET_SYSERR;
268 * Inserts the specified stats into the dhttests.generic_stats table
270 * @param peer the peer inserting the statistic
271 * @param name the name of the statistic
272 * @param section the section of the statistic
273 * @param value the value of the statistic
275 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
278 add_generic_stat (const struct GNUNET_PeerIdentity *peer, const char *name,
279 const char *section, uint64_t value)
282 return GNUNET_SYSERR;
285 fprintf (generic_stat_outfile, "TRIALUID\t%s\t%s\t%s\t%llu\n",
286 GNUNET_h2s_full (&peer->hashPubKey), section, name,
287 (unsigned long long) value);
294 * Inserts the specified stats into the dhttests.node_statistics table
296 * @param peer the peer inserting the statistic
297 * @param route_requests route requests seen
298 * @param route_forwards route requests forwarded
299 * @param result_requests route result requests seen
300 * @param client_requests client requests initiated
301 * @param result_forwards route results forwarded
302 * @param gets get requests handled
303 * @param puts put requests handle
304 * @param data_inserts data inserted at this node
305 * @param find_peer_requests find peer requests seen
306 * @param find_peers_started find peer requests initiated at this node
307 * @param gets_started get requests initiated at this node
308 * @param puts_started put requests initiated at this node
309 * @param find_peer_responses_received find peer responses received locally
310 * @param get_responses_received get responses received locally
311 * @param find_peer_responses_sent find peer responses sent from this node
312 * @param get_responses_sent get responses sent from this node
314 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
317 add_stat (const struct GNUNET_PeerIdentity *peer, unsigned int route_requests,
318 unsigned int route_forwards, unsigned int result_requests,
319 unsigned int client_requests, unsigned int result_forwards,
320 unsigned int gets, unsigned int puts, unsigned int data_inserts,
321 unsigned int find_peer_requests, unsigned int find_peers_started,
322 unsigned int gets_started, unsigned int puts_started,
323 unsigned int find_peer_responses_received,
324 unsigned int get_responses_received,
325 unsigned int find_peer_responses_sent,
326 unsigned int get_responses_sent)
331 return GNUNET_SYSERR;
335 fprintf (stat_outfile,
336 "TRIALUID\t%s\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\t%u\n",
337 GNUNET_h2s_full (&peer->hashPubKey), route_requests,
338 route_forwards, result_requests, client_requests,
339 result_forwards, gets, puts, data_inserts, find_peer_requests,
340 find_peers_started, gets_started, puts_started,
341 find_peer_responses_received, get_responses_received,
342 find_peer_responses_sent, get_responses_sent);
345 return GNUNET_SYSERR;
350 return GNUNET_SYSERR;
354 * Inserts the specified dhtkey into the dhttests.dhtkeys table,
355 * stores return value of dhttests.dhtkeys.dhtkeyuid into dhtkeyuid
357 * @param dhtkeyuid return value
358 * @param dhtkey hashcode of key to insert
360 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
363 add_dhtkey (unsigned long long *dhtkeyuid, const GNUNET_HashCode * dhtkey)
367 if (dhtkeyuid != NULL)
370 if ((dhtkey_outfile == NULL) || (dhtkey == NULL))
371 return GNUNET_SYSERR;
373 ret = fprintf (dhtkey_outfile, "TRIALUID\t%s\n", GNUNET_h2s_full (dhtkey));
378 return GNUNET_SYSERR;
382 * Inserts the specified node into the dhttests.nodes table
384 * @param nodeuid the inserted node uid
385 * @param node the node to insert
387 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
390 add_node (unsigned long long *nodeuid, struct GNUNET_PeerIdentity *node)
394 if ((node == NULL) || (node_outfile == NULL))
395 return GNUNET_SYSERR;
398 fprintf (node_outfile, "TRIALUID\t%s\n",
399 GNUNET_h2s_full (&node->hashPubKey));
400 fflush (node_outfile);
403 return GNUNET_SYSERR;
407 * Update dhttests.trials table with current server time as end time
409 * @param gets_succeeded how many gets did the testcase report as successful
411 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
414 update_trials (unsigned int gets_succeeded)
419 return GNUNET_SYSERR;
423 "update trials set endtime=\"%s\", gets_succeeded=%u where trialuid = @temp_trial;\n",
424 get_sql_time (), gets_succeeded);
425 fflush (node_outfile);
429 return GNUNET_SYSERR;
434 * Update dhttests.nodes table setting the identified
435 * node as a malicious dropper.
437 * @param peer the peer that was set to be malicious
439 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
442 set_malicious (struct GNUNET_PeerIdentity *peer)
447 return GNUNET_SYSERR;
451 "update nodes set malicious_dropper = 1 where trialuid = @temp_trial and nodeid = \"%s\";\n",
452 GNUNET_h2s_full (&peer->hashPubKey));
453 fflush (node_outfile);
457 return GNUNET_SYSERR;
462 * Update dhttests.trials table with total connections information
464 * @param totalConnections the number of connections
466 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
469 add_connections (unsigned int totalConnections)
474 return GNUNET_SYSERR;
478 "update trials set totalConnections = %u where trialuid = @temp_trial;\n",
480 fflush (node_outfile);
484 return GNUNET_SYSERR;
489 * Update dhttests.topology table with total connections information
491 * @param connections the number of connections
493 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
496 update_topology (unsigned int connections)
501 return GNUNET_SYSERR;
505 "update topology set connections = %u where topology_uid = @temp_topology;\n",
511 return GNUNET_SYSERR;
515 * Inserts the specified query into the dhttests.queries table
517 * @param sqlqueruid inserted query uid
518 * @param queryid dht query id
519 * @param type type of the query
520 * @param hops number of hops query traveled
521 * @param succeeded whether or not query was successful
522 * @param node the node the query hit
523 * @param key the key of the query
525 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
528 add_query (unsigned long long *sqlqueryuid, unsigned long long queryid,
529 unsigned int type, unsigned int hops, int succeeded,
530 const struct GNUNET_PeerIdentity *node, const GNUNET_HashCode * key)
534 if ((outfile == NULL) || (node == NULL) || (key == NULL))
535 return GNUNET_SYSERR;
537 if (sqlqueryuid != NULL)
540 ret = fprintf (query_outfile, "TRIALUID\t%s\t", GNUNET_h2s_full (key));
543 return GNUNET_SYSERR;
546 fprintf (query_outfile, "%s\t%llu\t%u\t%u\t%u\t%s\n",
547 GNUNET_h2s_full (&node->hashPubKey), queryid, type, hops,
548 succeeded, get_sql_time ());
553 return GNUNET_SYSERR;
557 * Inserts the specified route information into the dhttests.routes table
559 * @param sqlqueruid inserted query uid
560 * @param queryid dht query id
561 * @param type type of the query
562 * @param hops number of hops query traveled
563 * @param succeeded whether or not query was successful
564 * @param node the node the query hit
565 * @param key the key of the query
566 * @param from_node the node that sent the message to node
567 * @param to_node next node to forward message to
569 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
572 add_route (unsigned long long *sqlqueryuid, unsigned long long queryid,
573 unsigned int type, unsigned int hops, int succeeded,
574 const struct GNUNET_PeerIdentity *node, const GNUNET_HashCode * key,
575 const struct GNUNET_PeerIdentity *from_node,
576 const struct GNUNET_PeerIdentity *to_node)
580 if ((outfile == NULL) || (node == NULL) || (key == NULL))
581 return GNUNET_SYSERR;
583 if (sqlqueryuid != NULL)
586 ret = fprintf (route_outfile, "TRIALUID\t%s\t", GNUNET_h2s_full (key));
588 return GNUNET_SYSERR;
590 ret = fprintf (route_outfile, "%s\t", GNUNET_h2s_full (&node->hashPubKey));
592 return GNUNET_SYSERR;
593 if (from_node == NULL)
594 ret = fprintf (route_outfile, "0\t");
597 fprintf (route_outfile, "%s\t",
598 GNUNET_h2s_full (&from_node->hashPubKey));
600 return GNUNET_SYSERR;
604 fprintf (route_outfile, "0\t%llu\t%u\t%u\t%d\n", queryid, type, hops,
608 fprintf (route_outfile, "%s\t%llu\t%u\t%u\t%d\n",
609 GNUNET_h2s_full (&to_node->hashPubKey), queryid, type, hops,
615 return GNUNET_SYSERR;
619 * Provides the dhtlog api
621 * @param c the configuration to use to connect to a server
623 * @return the handle to the server, or NULL on error
626 libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls)
628 struct GNUNET_DHTLOG_Plugin *plugin = cls;
635 max_varchar_len = 255;
637 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
638 "MySQL (DUMP) DHT Logger: initializing\n");
641 GNUNET_CONFIGURATION_get_value_string (plugin->cfg, "MYSQLDUMP", "PATH",
644 outfile_path = GNUNET_strdup ("");
647 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump",
650 fn = GNUNET_STRINGS_filename_expand (outfile_name);
654 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
655 _("Failed to get full path for `%s'\n"), outfile_name);
656 GNUNET_free (outfile_path);
657 GNUNET_free (outfile_name);
661 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
662 outfile = FOPEN (fn, "w");
666 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
668 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
669 _("Failed to create or access directory for log file `%s'\n"),
671 GNUNET_free (outfile_path);
672 GNUNET_free (outfile_name);
677 GNUNET_free (outfile_name);
678 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_nodes",
681 fn = GNUNET_STRINGS_filename_expand (outfile_name);
685 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
686 _("Failed to get full path for `%s'\n"), outfile_name);
687 GNUNET_free (outfile_path);
688 GNUNET_free (outfile_name);
692 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
693 node_outfile = FOPEN (fn, "w");
695 if (node_outfile == NULL)
697 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
699 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
700 _("Failed to create or access directory for log file `%s'\n"),
702 GNUNET_free (outfile_path);
703 GNUNET_free (outfile_name);
708 GNUNET_free (outfile_name);
709 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_routes",
713 fn = GNUNET_STRINGS_filename_expand (outfile_name);
717 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
718 _("Failed to get full path for `%s'\n"), outfile_name);
719 GNUNET_free (outfile_path);
720 GNUNET_free (outfile_name);
724 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
725 route_outfile = FOPEN (fn, "w");
727 if (route_outfile == NULL)
729 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
731 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
732 _("Failed to create or access directory for log file `%s'\n"),
734 GNUNET_free (outfile_path);
735 GNUNET_free (outfile_name);
740 GNUNET_free (outfile_name);
741 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_queries",
745 fn = GNUNET_STRINGS_filename_expand (outfile_name);
749 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
750 _("Failed to get full path for `%s'\n"), outfile_name);
751 GNUNET_free (outfile_path);
752 GNUNET_free (outfile_name);
756 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
757 query_outfile = FOPEN (fn, "w");
759 if (query_outfile == NULL)
761 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
763 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
764 _("Failed to create or access directory for log file `%s'\n"),
766 GNUNET_free (outfile_path);
767 GNUNET_free (outfile_name);
772 GNUNET_free (outfile_name);
773 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_stats",
777 fn = GNUNET_STRINGS_filename_expand (outfile_name);
781 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
782 _("Failed to get full path for `%s'\n"), outfile_name);
783 GNUNET_free (outfile_path);
784 GNUNET_free (outfile_name);
788 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
789 stat_outfile = FOPEN (fn, "w");
791 if (stat_outfile == NULL)
793 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
795 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
796 _("Failed to create or access directory for log file `%s'\n"),
798 GNUNET_free (outfile_path);
799 GNUNET_free (outfile_name);
804 GNUNET_free (outfile_name);
805 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path,
806 "mysqldump_generic_stats", getpid ());
808 fn = GNUNET_STRINGS_filename_expand (outfile_name);
812 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
813 _("Failed to get full path for `%s'\n"), outfile_name);
814 GNUNET_free (outfile_path);
815 GNUNET_free (outfile_name);
819 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
820 generic_stat_outfile = FOPEN (fn, "w");
822 if (generic_stat_outfile == NULL)
824 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
826 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
827 _("Failed to create or access directory for log file `%s'\n"),
829 GNUNET_free (outfile_path);
830 GNUNET_free (outfile_name);
835 GNUNET_free (outfile_name);
836 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_dhtkey",
839 fn = GNUNET_STRINGS_filename_expand (outfile_name);
843 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
844 _("Failed to get full path for `%s'\n"), outfile_name);
845 GNUNET_free (outfile_path);
846 GNUNET_free (outfile_name);
850 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
851 dhtkey_outfile = FOPEN (fn, "w");
853 if (dhtkey_outfile == NULL)
855 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
857 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
858 _("Failed to create or access directory for log file `%s'\n"),
860 GNUNET_free (outfile_path);
861 GNUNET_free (outfile_name);
866 GNUNET_free (outfile_name);
867 GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path,
868 "mysqldump_extended_topology", getpid ());
870 fn = GNUNET_STRINGS_filename_expand (outfile_name);
874 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
875 _("Failed to get full path for `%s'\n"), outfile_name);
876 GNUNET_free (outfile_path);
877 GNUNET_free (outfile_name);
881 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
882 extended_topology_outfile = FOPEN (fn, "w");
884 if (extended_topology_outfile == NULL)
886 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
888 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
889 _("Failed to create or access directory for log file `%s'\n"),
891 GNUNET_free (outfile_path);
892 GNUNET_free (outfile_name);
897 GNUNET_free (outfile_path);
898 GNUNET_free (outfile_name);
901 GNUNET_assert (plugin->dhtlog_api == NULL);
902 plugin->dhtlog_api = GNUNET_malloc (sizeof (struct GNUNET_DHTLOG_Handle));
903 plugin->dhtlog_api->insert_trial = &add_trial;
904 plugin->dhtlog_api->insert_stat = &add_stat;
905 plugin->dhtlog_api->insert_round = &add_round;
906 plugin->dhtlog_api->insert_round_details = &add_round_details;
907 plugin->dhtlog_api->insert_query = &add_query;
908 plugin->dhtlog_api->update_trial = &update_trials;
909 plugin->dhtlog_api->insert_route = &add_route;
910 plugin->dhtlog_api->insert_node = &add_node;
911 plugin->dhtlog_api->insert_dhtkey = &add_dhtkey;
912 plugin->dhtlog_api->update_connections = &add_connections;
913 plugin->dhtlog_api->insert_topology = &add_topology;
914 plugin->dhtlog_api->insert_extended_topology = &add_extended_topology;
915 plugin->dhtlog_api->update_topology = &update_topology;
916 plugin->dhtlog_api->set_malicious = &set_malicious;
917 plugin->dhtlog_api->add_generic_stat = &add_generic_stat;
923 * Shutdown the plugin.
926 libgnunet_plugin_dhtlog_mysql_dump_load_done (void *cls)
928 struct GNUNET_DHTLOG_Handle *dhtlog_api = cls;
930 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MySQL DHT Logger: database shutdown\n");
931 GNUNET_assert (dhtlog_api != NULL);
934 fclose (node_outfile);
935 fclose (query_outfile);
936 fclose (route_outfile);
937 fclose (stat_outfile);
938 fclose (generic_stat_outfile);
939 fclose (extended_topology_outfile);
940 GNUNET_free (dhtlog_api);
944 /* end of plugin_dhtlog_mysql_dump_load.c */