[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13571 - in gnunet/src: block datacache datastore dv includ
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13571 - in gnunet/src: block datacache datastore dv include transport |
Date: |
Fri, 5 Nov 2010 22:54:44 +0100 |
Author: grothoff
Date: 2010-11-05 22:54:44 +0100 (Fri, 05 Nov 2010)
New Revision: 13571
Added:
gnunet/src/include/gnunet_block_plugin.h
gnunet/src/include/gnunet_datacache_plugin.h
gnunet/src/include/gnunet_datastore_plugin.h
gnunet/src/include/gnunet_transport_plugin.h
Removed:
gnunet/src/block/plugin_block.h
gnunet/src/datacache/plugin_datacache.h
gnunet/src/datastore/plugin_datastore.h
gnunet/src/transport/plugin_transport.h
Modified:
gnunet/src/block/Makefile.am
gnunet/src/block/block.c
gnunet/src/block/plugin_block_dht.c
gnunet/src/block/plugin_block_dns.c
gnunet/src/block/plugin_block_fs.c
gnunet/src/block/plugin_block_template.c
gnunet/src/block/plugin_block_test.c
gnunet/src/datacache/datacache.c
gnunet/src/datacache/plugin_datacache_mysql.c
gnunet/src/datacache/plugin_datacache_postgres.c
gnunet/src/datacache/plugin_datacache_sqlite.c
gnunet/src/datacache/plugin_datacache_template.c
gnunet/src/datastore/gnunet-service-datastore.c
gnunet/src/datastore/perf_plugin_datastore.c
gnunet/src/datastore/plugin_datastore_mysql.c
gnunet/src/datastore/plugin_datastore_postgres.c
gnunet/src/datastore/plugin_datastore_sqlite.c
gnunet/src/datastore/plugin_datastore_template.c
gnunet/src/dv/dv_api.c
gnunet/src/dv/plugin_transport_dv.c
gnunet/src/include/Makefile.am
gnunet/src/include/gnunet_dv_service.h
gnunet/src/transport/Makefile.am
gnunet/src/transport/gnunet-service-transport.c
gnunet/src/transport/plugin_transport_http.c
gnunet/src/transport/plugin_transport_tcp.c
gnunet/src/transport/plugin_transport_template.c
gnunet/src/transport/plugin_transport_udp.c
gnunet/src/transport/plugin_transport_wlan.c
gnunet/src/transport/test_plugin_transport.c
gnunet/src/transport/test_plugin_transport_http.c
gnunet/src/transport/test_plugin_transport_https.c
gnunet/src/transport/test_plugin_transport_udp.c
Log:
moving plugin headers
Modified: gnunet/src/block/Makefile.am
===================================================================
--- gnunet/src/block/Makefile.am 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/block/Makefile.am 2010-11-05 21:54:44 UTC (rev 13571)
@@ -60,7 +60,7 @@
libgnunetblock_la_SOURCES = \
- block.c plugin_block.h
+ block.c
libgnunetblock_la_LIBADD = \
$(top_builddir)/src/util/libgnunetutil.la
Modified: gnunet/src/block/block.c
===================================================================
--- gnunet/src/block/block.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/block/block.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -27,7 +27,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_signatures.h"
#include "gnunet_block_lib.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
/**
Deleted: gnunet/src/block/plugin_block.h
===================================================================
--- gnunet/src/block/plugin_block.h 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/block/plugin_block.h 2010-11-05 21:54:44 UTC (rev 13571)
@@ -1,118 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2010 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file block/plugin_block.h
- * @brief API for block plugins. Each block plugin must conform to
- * the API specified by this header.
- * @author Christian Grothoff
- */
-#ifndef PLUGIN_BLOCK_H
-#define PLUGIN_BLOCK_H
-
-#include "gnunet_util_lib.h"
-#include "gnunet_container_lib.h"
-#include "gnunet_block_lib.h"
-
-
-/**
- * Function called to validate a reply or a request. For
- * request evaluation, simply pass "NULL" for the reply_block.
- * Note that it is assumed that the reply has already been
- * matched to the key (and signatures checked) as it would
- * be done with the "get_key" function.
- *
- * @param cls closure
- * @param type block type
- * @param query original query (hash)
- * @param bf pointer to bloom filter associated with query; possibly updated
(!)
- * @param bf_mutator mutation value for bf
- * @param xquery extrended query data (can be NULL, depending on type)
- * @param xquery_size number of bytes in xquery
- * @param reply_block response to validate
- * @param reply_block_size number of bytes in reply block
- * @return characterization of result
- */
-typedef enum GNUNET_BLOCK_EvaluationResult
- (*GNUNET_BLOCK_EvaluationFunction) (void *cls,
- enum GNUNET_BLOCK_Type type,
- const GNUNET_HashCode *query,
- struct GNUNET_CONTAINER_BloomFilter **bf,
- int32_t bf_mutator,
- const void *xquery,
- size_t xquery_size,
- const void *reply_block,
- size_t reply_block_size);
-
-
-/**
- * Function called to obtain the key for a block.
- *
- * @param cls closure
- * @param type block type
- * @param block block to get the key for
- * @param block_size number of bytes in block
- * @param key set to the key (query) for the given block
- * @return GNUNET_YES on success,
- * GNUNET_NO if the block is malformed
- * GNUNET_SYSERR if type not supported
- * (or if extracting a key from a block of this type does not work)
- */
-typedef int
- (*GNUNET_BLOCK_GetKeyFunction) (void *cls,
- enum GNUNET_BLOCK_Type type,
- const void *block,
- size_t block_size,
- GNUNET_HashCode *key);
-
-
-
-/**
- * Each plugin is required to return a pointer to a struct of this
- * type as the return value from its entry point.
- */
-struct GNUNET_BLOCK_PluginFunctions
-{
-
- /**
- * Closure for all of the callbacks.
- */
- void *cls;
-
- /**
- * 0-terminated array of block types supported by this plugin.
- */
- const enum GNUNET_BLOCK_Type *types;
-
- /**
- * Main function of a block plugin. Allows us to check if a
- * block matches a query.
- */
- GNUNET_BLOCK_EvaluationFunction evaluate;
-
- /**
- * Obtain the key for a given block (if possible).
- */
- GNUNET_BLOCK_GetKeyFunction get_key;
-
-};
-
-
-#endif
Modified: gnunet/src/block/plugin_block_dht.c
===================================================================
--- gnunet/src/block/plugin_block_dht.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/block/plugin_block_dht.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -28,7 +28,7 @@
#include "platform.h"
#include "gnunet_hello_lib.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
#define DEBUG_DHT GNUNET_NO
Modified: gnunet/src/block/plugin_block_dns.c
===================================================================
--- gnunet/src/block/plugin_block_dns.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/block/plugin_block_dns.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
#include "block_dns.h"
#include "gnunet_signatures.h"
Modified: gnunet/src/block/plugin_block_fs.c
===================================================================
--- gnunet/src/block/plugin_block_fs.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/block/plugin_block_fs.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
#include "block_fs.h"
#include "gnunet_signatures.h"
Modified: gnunet/src/block/plugin_block_template.c
===================================================================
--- gnunet/src/block/plugin_block_template.c 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/block/plugin_block_template.c 2010-11-05 21:54:44 UTC (rev
13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
#define DEBUG_TEMPLATE GNUNET_NO
Modified: gnunet/src/block/plugin_block_test.c
===================================================================
--- gnunet/src/block/plugin_block_test.c 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/block/plugin_block_test.c 2010-11-05 21:54:44 UTC (rev
13571)
@@ -26,7 +26,7 @@
*/
#include "platform.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
#define DEBUG_TEST GNUNET_NO
Modified: gnunet/src/datacache/datacache.c
===================================================================
--- gnunet/src/datacache/datacache.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/datacache/datacache.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -27,7 +27,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_datacache_lib.h"
#include "gnunet_statistics_service.h"
-#include "plugin_datacache.h"
+#include "gnunet_datacache_plugin.h"
/**
* Internal state of the datacache library.
Deleted: gnunet/src/datacache/plugin_datacache.h
===================================================================
--- gnunet/src/datacache/plugin_datacache.h 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/datacache/plugin_datacache.h 2010-11-05 21:54:44 UTC (rev
13571)
@@ -1,158 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2006, 2009 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file datacache/plugin_datacache.h
- * @brief API for database backends for the datacache
- * @author Christian Grothoff
- */
-#ifndef PLUGIN_DATACACHE_H
-#define PLUGIN_DATACACHE_H
-
-#include "gnunet_datacache_lib.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0 /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-
-/**
- * Function called by plugins to notify the datacache
- * about content deletions.
- *
- * @param cls closure
- * @param key key of the content that was deleted
- * @param size number of bytes that were made available
- */
-typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls,
- const GNUNET_HashCode
*key,
- size_t size);
-
-
-/**
- * The datastore service will pass a pointer to a struct
- * of this type as the first and only argument to the
- * entry point of each datastore plugin.
- */
-struct GNUNET_DATACACHE_PluginEnvironment
-{
-
-
- /**
- * Configuration to use.
- */
- const struct GNUNET_CONFIGURATION_Handle *cfg;
-
- /**
- * Configuration section to use.
- */
- const char *section;
-
- /**
- * Closure to use for callbacks.
- */
- void *cls;
-
- /**
- * Function to call whenever the plugin needs to
- * discard content that it was asked to store.
- */
- GNUNET_DATACACHE_DeleteNotifyCallback delete_notify;
-
- /**
- * How much space are we allowed to use?
- */
- unsigned long long quota;
-
-};
-
-
-/**
- * @brief struct returned by the initialization function of the plugin
- */
-struct GNUNET_DATACACHE_PluginFunctions {
-
- /**
- * Closure to pass to all plugin functions.
- */
- void *cls;
-
- /**
- * Store an item in the datastore.
- *
- * @param cls closure (internal context for the plugin)
- * @param size number of bytes in data
- * @param data data to store
- * @param type type of the value
- * @param discard_time when to discard the value in any case
- * @return 0 on error, number of bytes used otherwise
- */
- size_t (*put) (void *cls,
- const GNUNET_HashCode * key,
- size_t size,
- const char *data,
- enum GNUNET_BLOCK_Type type,
- struct GNUNET_TIME_Absolute discard_time);
-
-
- /**
- * Iterate over the results for a particular key
- * in the datastore.
- *
- * @param cls closure (internal context for the plugin)
- * @param key
- * @param type entries of which type are relevant?
- * @param iter maybe NULL (to just count)
- * @param iter_cls closure for iter
- * @return the number of results found
- */
- unsigned int (*get) (void *cls,
- const GNUNET_HashCode * key,
- enum GNUNET_BLOCK_Type type,
- GNUNET_DATACACHE_Iterator iter,
- void *iter_cls);
-
-
- /**
- * Delete the entry with the lowest expiration value
- * from the datacache right now.
- *
- * @param cls closure (internal context for the plugin)
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
- */
- int (*del) (void *cls);
-
-
-};
-
-
-#if 0 /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-/* end of plugin_datacache.h */
-#endif
Modified: gnunet/src/datacache/plugin_datacache_mysql.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_mysql.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datacache/plugin_datacache_mysql.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -79,7 +79,7 @@
*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "plugin_datacache.h"
+#include "gnunet_datacache_plugin.h"
#include <mysql/mysql.h>
#define DEBUG_DATACACHE_MYSQL GNUNET_NO
Modified: gnunet/src/datacache/plugin_datacache_postgres.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_postgres.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datacache/plugin_datacache_postgres.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "plugin_datacache.h"
+#include "gnunet_datacache_plugin.h"
#include <postgresql/libpq-fe.h>
#define DEBUG_POSTGRES GNUNET_NO
Modified: gnunet/src/datacache/plugin_datacache_sqlite.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_sqlite.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datacache/plugin_datacache_sqlite.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "plugin_datacache.h"
+#include "gnunet_datacache_plugin.h"
#include <sqlite3.h>
#define DEBUG_DATACACHE_SQLITE GNUNET_NO
Modified: gnunet/src/datacache/plugin_datacache_template.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_template.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datacache/plugin_datacache_template.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "plugin_datacache.h"
+#include "gnunet_datacache_plugin.h"
/**
Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datastore/gnunet-service-datastore.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -28,7 +28,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_statistics_service.h"
-#include "plugin_datastore.h"
+#include "gnunet_datastore_plugin.h"
#include "datastore.h"
/**
Modified: gnunet/src/datastore/perf_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/perf_plugin_datastore.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datastore/perf_plugin_datastore.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
-#include "plugin_datastore.h"
+#include "gnunet_datastore_plugin.h"
#define VERBOSE GNUNET_NO
Deleted: gnunet/src/datastore/plugin_datastore.h
===================================================================
--- gnunet/src/datastore/plugin_datastore.h 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/datastore/plugin_datastore.h 2010-11-05 21:54:44 UTC (rev
13571)
@@ -1,343 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2009 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file datastore/plugin_datastore.h
- * @brief API for the database backend plugins.
- * @author Christian Grothoff
- */
-#ifndef PLUGIN_DATASTORE_H
-#define PLUGIN_DATASTORE_H
-
-#include "gnunet_block_lib.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_datastore_service.h"
-#include "gnunet_statistics_service.h"
-#include "gnunet_scheduler_lib.h"
-
-
-/**
- * How many bytes of overhead will we assume per entry
- * in any DB (for reservations)?
- */
-#define GNUNET_DATASTORE_ENTRY_OVERHEAD 256
-
-
-/**
- * Function invoked to notify service of disk utilization
- * changes.
- *
- * @param cls closure
- * @param delta change in disk utilization,
- * 0 for "reset to empty"
- */
-typedef void (*DiskUtilizationChange)(void *cls,
- int delta);
-
-
-/**
- * The datastore service will pass a pointer to a struct
- * of this type as the first and only argument to the
- * entry point of each datastore plugin.
- */
-struct GNUNET_DATASTORE_PluginEnvironment
-{
- /**
- * Configuration to use.
- */
- const struct GNUNET_CONFIGURATION_Handle *cfg;
-
-
- /**
- * Function to call on disk utilization change.
- */
- DiskUtilizationChange duc;
-
- /**
- * Closure.
- */
- void *cls;
-
-};
-
-
-/**
- * Function invoked on behalf of a "PluginIterator"
- * asking the database plugin to call the iterator
- * with the next item.
- *
- * @param next_cls whatever argument was given
- * to the PluginIterator as "next_cls".
- * @param end_it set to GNUNET_YES if we
- * should terminate the iteration early
- * (iterator should be still called once more
- * to signal the end of the iteration).
- */
-typedef void (*PluginNextRequest)(void *next_cls,
- int end_it);
-
-
-/**
- * An iterator over a set of items stored in the datastore.
- *
- * @param cls closure
- * @param next_cls closure to pass to the "next" function.
- * @param key key for the content
- * @param size number of bytes in data
- * @param data content stored
- * @param type type of the content
- * @param priority priority of the content
- * @param anonymity anonymity-level for the content
- * @param expiration expiration time for the content
- * @param uid unique identifier for the datum;
- * maybe 0 if no unique identifier is available
- *
- * @return GNUNET_SYSERR to abort the iteration, GNUNET_OK to continue
- * (continue on call to "next", of course),
- * GNUNET_NO to delete the item and continue (if supported)
- */
-typedef int (*PluginIterator) (void *cls,
- void *next_cls,
- const GNUNET_HashCode * key,
- uint32_t size,
- const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
- uint32_t anonymity,
- struct GNUNET_TIME_Absolute
- expiration,
- uint64_t uid);
-
-/**
- * Get an estimate of how much space the database is
- * currently using.
- *
- * @param cls closure
- * @return number of bytes used on disk
- */
-typedef unsigned long long (*PluginGetSize) (void *cls);
-
-
-/**
- * Store an item in the datastore. If the item is already present,
- * the priorities are summed up and the higher expiration time and
- * lower anonymity level is used.
- *
- * @param cls closure
- * @param key key for the item
- * @param size number of bytes in data
- * @param data content stored
- * @param type type of the content
- * @param priority priority of the content
- * @param anonymity anonymity-level for the content
- * @param expiration expiration time for the content
- * @param msg set to an error message (on failure)
- * @return GNUNET_OK on success, GNUNET_NO if the content
- * was already present (and may have been updated);
- * GNUNET_SYSERR on failure
- */
-typedef int (*PluginPut) (void *cls,
- const GNUNET_HashCode * key,
- uint32_t size,
- const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
- uint32_t anonymity,
- struct GNUNET_TIME_Absolute expiration,
- char **msg);
-
-
-/**
- * Iterate over the results for a particular key
- * in the datastore.
- *
- * @param cls closure
- * @param key maybe NULL (to match all entries)
- * @param vhash hash of the value, maybe NULL (to
- * match all values that have the right key).
- * Note that for DBlocks there is no difference
- * betwen key and vhash, but for other blocks
- * there may be!
- * @param type entries of which type are relevant?
- * Use 0 for any type.
- * @param iter function to call on each matching value; however,
- * after the first call to "iter", the plugin must wait
- * until "NextRequest" was called before giving the iterator
- * the next item; finally, the "iter" should be called once
- * once with a NULL value at the end ("next_cls" should be NULL
- * for that last call)
- * @param iter_cls closure for iter
- */
-typedef void (*PluginGet) (void *cls,
- const GNUNET_HashCode * key,
- const GNUNET_HashCode * vhash,
- enum GNUNET_BLOCK_Type type,
- PluginIterator iter, void *iter_cls);
-
-
-/**
- * Update the priority for a particular key in the datastore. If
- * the expiration time in value is different than the time found in
- * the datastore, the higher value should be kept. For the
- * anonymity level, the lower value is to be used. The specified
- * priority should be added to the existing priority, ignoring the
- * priority in value.
- *
- * Note that it is possible for multiple values to match this put.
- * In that case, all of the respective values are updated.
- *
- * @param cls closure
- * @param uid unique identifier of the datum
- * @param delta by how much should the priority
- * change? If priority + delta < 0 the
- * priority should be set to 0 (never go
- * negative).
- * @param expire new expiration time should be the
- * MAX of any existing expiration time and
- * this value
- * @param msg set to an error message (on error)
- * @return GNUNET_OK on success
- */
-typedef int (*PluginUpdate) (void *cls,
- uint64_t uid,
- int delta, struct GNUNET_TIME_Absolute expire,
- char **msg);
-
-
-/**
- * Select a subset of the items in the datastore and call
- * the given iterator for each of them.
- *
- * @param cls closure
- * @param type entries of which type should be considered?
- * Use 0 for any type.
- * @param iter function to call on each matching value; however,
- * after the first call to "iter", the plugin must wait
- * until "NextRequest" was called before giving the iterator
- * the next item; finally, the "iter" should be called once
- * once with a NULL value at the end ("next_cls" should be NULL
- * for that last call)
- * @param iter_cls closure for iter
- */
-typedef void (*PluginSelector) (void *cls,
- enum GNUNET_BLOCK_Type type,
- PluginIterator iter,
- void *iter_cls);
-
-/**
- * Drop database.
- *
- * @param cls closure
- */
-typedef void (*PluginDrop) (void *cls);
-
-
-
-/**
- * Each plugin is required to return a pointer to a struct of this
- * type as the return value from its entry point.
- */
-struct GNUNET_DATASTORE_PluginFunctions
-{
-
- /**
- * Closure to use for all of the following callbacks
- * (except "next_request").
- */
- void *cls;
-
- /**
- * Get the current on-disk size of the SQ store. Estimates are
- * fine, if that's the only thing available.
- */
- PluginGetSize get_size;
-
- /**
- * Function to store an item in the datastore.
- */
- PluginPut put;
-
- /**
- * Function called by iterators whenever they want the next value;
- * note that unlike all of the other callbacks, this one does get a
- * the "next_cls" closure which is usually different from the "cls"
- * member of this struct!
- */
- PluginNextRequest next_request;
-
- /**
- * Function to iterate over the results for a particular key
- * in the datastore.
- */
- PluginGet get;
-
- /**
- * Update the priority for a particular key in the datastore. If
- * the expiration time in value is different than the time found in
- * the datastore, the higher value should be kept. For the
- * anonymity level, the lower value is to be used. The specified
- * priority should be added to the existing priority, ignoring the
- * priority in value.
- */
- PluginUpdate update;
-
- /**
- * Iterate over the items in the datastore in ascending
- * order of priority.
- */
- PluginSelector iter_low_priority;
-
- /**
- * Iterate over content with anonymity zero.
- */
- PluginSelector iter_zero_anonymity;
-
- /**
- * Iterate over the items in the datastore in ascending order of
- * expiration time.
- */
- PluginSelector iter_ascending_expiration;
-
- /**
- * Iterate over the items in the datastore in migration
- * order. Call the given function on the next item only
- * (and then signal 'end' with a second call). This is
- * a significant difference from all the other iterators!
- */
- PluginSelector iter_migration_order;
-
- /**
- * Iterate over all the items in the datastore
- * as fast as possible in a single transaction
- * (can lock datastore while this happens, focus
- * is on doing it fast).
- */
- PluginSelector iter_all_now;
-
- /**
- * Delete the database. The next operation is
- * guaranteed to be unloading of the module.
- */
- PluginDrop drop;
-
-};
-
-
-#endif
Modified: gnunet/src/datastore/plugin_datastore_mysql.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_mysql.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datastore/plugin_datastore_mysql.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -122,7 +122,7 @@
*/
#include "platform.h"
-#include "plugin_datastore.h"
+#include "gnunet_datastore_plugin.h"
#include "gnunet_util_lib.h"
#include <mysql/mysql.h>
Modified: gnunet/src/datastore/plugin_datastore_postgres.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_postgres.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datastore/plugin_datastore_postgres.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
-#include "plugin_datastore.h"
+#include "gnunet_datastore_plugin.h"
#include <postgresql/libpq-fe.h>
#define DEBUG_POSTGRES GNUNET_NO
Modified: gnunet/src/datastore/plugin_datastore_sqlite.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_sqlite.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datastore/plugin_datastore_sqlite.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
-#include "plugin_datastore.h"
+#include "gnunet_datastore_plugin.h"
#include <sqlite3.h>
#define DEBUG_SQLITE GNUNET_YES
Modified: gnunet/src/datastore/plugin_datastore_template.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_template.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/datastore/plugin_datastore_template.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -25,7 +25,7 @@
*/
#include "platform.h"
-#include "plugin_datastore.h"
+#include "gnunet_datastore_plugin.h"
/**
Modified: gnunet/src/dv/dv_api.c
===================================================================
--- gnunet/src/dv/dv_api.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/dv/dv_api.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -36,7 +36,7 @@
#include "gnunet_time_lib.h"
#include "gnunet_dv_service.h"
#include "dv.h"
-#include "../transport/plugin_transport.h"
+#include "../transport/gnunet_transport_plugin.h"
/**
* Store ready to send messages
Modified: gnunet/src/dv/plugin_transport_dv.c
===================================================================
--- gnunet/src/dv/plugin_transport_dv.c 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/dv/plugin_transport_dv.c 2010-11-05 21:54:44 UTC (rev 13571)
@@ -34,7 +34,7 @@
#include "gnunet_statistics_service.h"
#include "gnunet_dv_service.h"
#include "gnunet_transport_service.h"
-#include "../transport/plugin_transport.h"
+#include "../transport/gnunet_transport_plugin.h"
#include "dv.h"
#define DEBUG_TEMPLATE GNUNET_NO
Modified: gnunet/src/include/Makefile.am
===================================================================
--- gnunet/src/include/Makefile.am 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/include/Makefile.am 2010-11-05 21:54:44 UTC (rev 13571)
@@ -19,6 +19,7 @@
gnunet_bandwidth_lib.h \
gnunet_bio_lib.h \
gnunet_block_lib.h \
+ gnunet_block_plugin.h \
gnunet_client_lib.h \
gnunet_common.h \
gnunet_constants.h \
@@ -28,7 +29,9 @@
gnunet_core_service.h \
gnunet_crypto_lib.h \
gnunet_datacache_lib.h \
+ gnunet_datacache_plugin.h \
gnunet_datastore_service.h \
+ gnunet_datastore_plugin.h \
gnunet_dht_service.h \
gnunet_disk_lib.h \
gnunet_dv_service.h \
@@ -57,5 +60,6 @@
gnunet_testing_lib.h \
gnunet_time_lib.h \
gnunet_transport_service.h \
+ gnunet_transport_plugin.h \
gnunet_upnp_service.h \
gnunet_util_lib.h
Copied: gnunet/src/include/gnunet_block_plugin.h (from rev 13565,
gnunet/src/block/plugin_block.h)
===================================================================
--- gnunet/src/include/gnunet_block_plugin.h (rev 0)
+++ gnunet/src/include/gnunet_block_plugin.h 2010-11-05 21:54:44 UTC (rev
13571)
@@ -0,0 +1,118 @@
+/*
+ This file is part of GNUnet
+ (C) 2010 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file block/gnunet_block_plugin.h
+ * @brief API for block plugins. Each block plugin must conform to
+ * the API specified by this header.
+ * @author Christian Grothoff
+ */
+#ifndef PLUGIN_BLOCK_H
+#define PLUGIN_BLOCK_H
+
+#include "gnunet_util_lib.h"
+#include "gnunet_container_lib.h"
+#include "gnunet_block_lib.h"
+
+
+/**
+ * Function called to validate a reply or a request. For
+ * request evaluation, simply pass "NULL" for the reply_block.
+ * Note that it is assumed that the reply has already been
+ * matched to the key (and signatures checked) as it would
+ * be done with the "get_key" function.
+ *
+ * @param cls closure
+ * @param type block type
+ * @param query original query (hash)
+ * @param bf pointer to bloom filter associated with query; possibly updated
(!)
+ * @param bf_mutator mutation value for bf
+ * @param xquery extrended query data (can be NULL, depending on type)
+ * @param xquery_size number of bytes in xquery
+ * @param reply_block response to validate
+ * @param reply_block_size number of bytes in reply block
+ * @return characterization of result
+ */
+typedef enum GNUNET_BLOCK_EvaluationResult
+ (*GNUNET_BLOCK_EvaluationFunction) (void *cls,
+ enum GNUNET_BLOCK_Type type,
+ const GNUNET_HashCode *query,
+ struct GNUNET_CONTAINER_BloomFilter **bf,
+ int32_t bf_mutator,
+ const void *xquery,
+ size_t xquery_size,
+ const void *reply_block,
+ size_t reply_block_size);
+
+
+/**
+ * Function called to obtain the key for a block.
+ *
+ * @param cls closure
+ * @param type block type
+ * @param block block to get the key for
+ * @param block_size number of bytes in block
+ * @param key set to the key (query) for the given block
+ * @return GNUNET_YES on success,
+ * GNUNET_NO if the block is malformed
+ * GNUNET_SYSERR if type not supported
+ * (or if extracting a key from a block of this type does not work)
+ */
+typedef int
+ (*GNUNET_BLOCK_GetKeyFunction) (void *cls,
+ enum GNUNET_BLOCK_Type type,
+ const void *block,
+ size_t block_size,
+ GNUNET_HashCode *key);
+
+
+
+/**
+ * Each plugin is required to return a pointer to a struct of this
+ * type as the return value from its entry point.
+ */
+struct GNUNET_BLOCK_PluginFunctions
+{
+
+ /**
+ * Closure for all of the callbacks.
+ */
+ void *cls;
+
+ /**
+ * 0-terminated array of block types supported by this plugin.
+ */
+ const enum GNUNET_BLOCK_Type *types;
+
+ /**
+ * Main function of a block plugin. Allows us to check if a
+ * block matches a query.
+ */
+ GNUNET_BLOCK_EvaluationFunction evaluate;
+
+ /**
+ * Obtain the key for a given block (if possible).
+ */
+ GNUNET_BLOCK_GetKeyFunction get_key;
+
+};
+
+
+#endif
Copied: gnunet/src/include/gnunet_datacache_plugin.h (from rev 13565,
gnunet/src/datacache/plugin_datacache.h)
===================================================================
--- gnunet/src/include/gnunet_datacache_plugin.h
(rev 0)
+++ gnunet/src/include/gnunet_datacache_plugin.h 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -0,0 +1,158 @@
+/*
+ This file is part of GNUnet
+ (C) 2006, 2009 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file datacache/gnunet_datacache_plugin.h
+ * @brief API for database backends for the datacache
+ * @author Christian Grothoff
+ */
+#ifndef PLUGIN_DATACACHE_H
+#define PLUGIN_DATACACHE_H
+
+#include "gnunet_datacache_lib.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0 /* keep Emacsens' auto-indent happy */
+}
+#endif
+#endif
+
+
+/**
+ * Function called by plugins to notify the datacache
+ * about content deletions.
+ *
+ * @param cls closure
+ * @param key key of the content that was deleted
+ * @param size number of bytes that were made available
+ */
+typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls,
+ const GNUNET_HashCode
*key,
+ size_t size);
+
+
+/**
+ * The datastore service will pass a pointer to a struct
+ * of this type as the first and only argument to the
+ * entry point of each datastore plugin.
+ */
+struct GNUNET_DATACACHE_PluginEnvironment
+{
+
+
+ /**
+ * Configuration to use.
+ */
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
+
+ /**
+ * Configuration section to use.
+ */
+ const char *section;
+
+ /**
+ * Closure to use for callbacks.
+ */
+ void *cls;
+
+ /**
+ * Function to call whenever the plugin needs to
+ * discard content that it was asked to store.
+ */
+ GNUNET_DATACACHE_DeleteNotifyCallback delete_notify;
+
+ /**
+ * How much space are we allowed to use?
+ */
+ unsigned long long quota;
+
+};
+
+
+/**
+ * @brief struct returned by the initialization function of the plugin
+ */
+struct GNUNET_DATACACHE_PluginFunctions {
+
+ /**
+ * Closure to pass to all plugin functions.
+ */
+ void *cls;
+
+ /**
+ * Store an item in the datastore.
+ *
+ * @param cls closure (internal context for the plugin)
+ * @param size number of bytes in data
+ * @param data data to store
+ * @param type type of the value
+ * @param discard_time when to discard the value in any case
+ * @return 0 on error, number of bytes used otherwise
+ */
+ size_t (*put) (void *cls,
+ const GNUNET_HashCode * key,
+ size_t size,
+ const char *data,
+ enum GNUNET_BLOCK_Type type,
+ struct GNUNET_TIME_Absolute discard_time);
+
+
+ /**
+ * Iterate over the results for a particular key
+ * in the datastore.
+ *
+ * @param cls closure (internal context for the plugin)
+ * @param key
+ * @param type entries of which type are relevant?
+ * @param iter maybe NULL (to just count)
+ * @param iter_cls closure for iter
+ * @return the number of results found
+ */
+ unsigned int (*get) (void *cls,
+ const GNUNET_HashCode * key,
+ enum GNUNET_BLOCK_Type type,
+ GNUNET_DATACACHE_Iterator iter,
+ void *iter_cls);
+
+
+ /**
+ * Delete the entry with the lowest expiration value
+ * from the datacache right now.
+ *
+ * @param cls closure (internal context for the plugin)
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ */
+ int (*del) (void *cls);
+
+
+};
+
+
+#if 0 /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+/* end of gnunet_datacache_plugin.h */
+#endif
Copied: gnunet/src/include/gnunet_datastore_plugin.h (from rev 13565,
gnunet/src/datastore/plugin_datastore.h)
===================================================================
--- gnunet/src/include/gnunet_datastore_plugin.h
(rev 0)
+++ gnunet/src/include/gnunet_datastore_plugin.h 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -0,0 +1,342 @@
+/*
+ This file is part of GNUnet
+ (C) 2009 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file datastore/gnunet_datastore_plugin.h
+ * @brief API for the database backend plugins.
+ * @author Christian Grothoff
+ */
+#ifndef PLUGIN_DATASTORE_H
+#define PLUGIN_DATASTORE_H
+
+#include "gnunet_block_lib.h"
+#include "gnunet_configuration_lib.h"
+#include "gnunet_datastore_service.h"
+#include "gnunet_statistics_service.h"
+#include "gnunet_scheduler_lib.h"
+
+
+/**
+ * How many bytes of overhead will we assume per entry
+ * in any DB (for reservations)?
+ */
+#define GNUNET_DATASTORE_ENTRY_OVERHEAD 256
+
+
+/**
+ * Function invoked to notify service of disk utilization
+ * changes.
+ *
+ * @param cls closure
+ * @param delta change in disk utilization,
+ * 0 for "reset to empty"
+ */
+typedef void (*DiskUtilizationChange)(void *cls,
+ int delta);
+
+
+/**
+ * The datastore service will pass a pointer to a struct
+ * of this type as the first and only argument to the
+ * entry point of each datastore plugin.
+ */
+struct GNUNET_DATASTORE_PluginEnvironment
+{
+ /**
+ * Configuration to use.
+ */
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
+
+ /**
+ * Function to call on disk utilization change.
+ */
+ DiskUtilizationChange duc;
+
+ /**
+ * Closure.
+ */
+ void *cls;
+
+};
+
+
+/**
+ * Function invoked on behalf of a "PluginIterator"
+ * asking the database plugin to call the iterator
+ * with the next item.
+ *
+ * @param next_cls whatever argument was given
+ * to the PluginIterator as "next_cls".
+ * @param end_it set to GNUNET_YES if we
+ * should terminate the iteration early
+ * (iterator should be still called once more
+ * to signal the end of the iteration).
+ */
+typedef void (*PluginNextRequest)(void *next_cls,
+ int end_it);
+
+
+/**
+ * An iterator over a set of items stored in the datastore.
+ *
+ * @param cls closure
+ * @param next_cls closure to pass to the "next" function.
+ * @param key key for the content
+ * @param size number of bytes in data
+ * @param data content stored
+ * @param type type of the content
+ * @param priority priority of the content
+ * @param anonymity anonymity-level for the content
+ * @param expiration expiration time for the content
+ * @param uid unique identifier for the datum;
+ * maybe 0 if no unique identifier is available
+ *
+ * @return GNUNET_SYSERR to abort the iteration, GNUNET_OK to continue
+ * (continue on call to "next", of course),
+ * GNUNET_NO to delete the item and continue (if supported)
+ */
+typedef int (*PluginIterator) (void *cls,
+ void *next_cls,
+ const GNUNET_HashCode * key,
+ uint32_t size,
+ const void *data,
+ enum GNUNET_BLOCK_Type type,
+ uint32_t priority,
+ uint32_t anonymity,
+ struct GNUNET_TIME_Absolute
+ expiration,
+ uint64_t uid);
+
+/**
+ * Get an estimate of how much space the database is
+ * currently using.
+ *
+ * @param cls closure
+ * @return number of bytes used on disk
+ */
+typedef unsigned long long (*PluginGetSize) (void *cls);
+
+
+/**
+ * Store an item in the datastore. If the item is already present,
+ * the priorities are summed up and the higher expiration time and
+ * lower anonymity level is used.
+ *
+ * @param cls closure
+ * @param key key for the item
+ * @param size number of bytes in data
+ * @param data content stored
+ * @param type type of the content
+ * @param priority priority of the content
+ * @param anonymity anonymity-level for the content
+ * @param expiration expiration time for the content
+ * @param msg set to an error message (on failure)
+ * @return GNUNET_OK on success, GNUNET_NO if the content
+ * was already present (and may have been updated);
+ * GNUNET_SYSERR on failure
+ */
+typedef int (*PluginPut) (void *cls,
+ const GNUNET_HashCode * key,
+ uint32_t size,
+ const void *data,
+ enum GNUNET_BLOCK_Type type,
+ uint32_t priority,
+ uint32_t anonymity,
+ struct GNUNET_TIME_Absolute expiration,
+ char **msg);
+
+
+/**
+ * Iterate over the results for a particular key
+ * in the datastore.
+ *
+ * @param cls closure
+ * @param key maybe NULL (to match all entries)
+ * @param vhash hash of the value, maybe NULL (to
+ * match all values that have the right key).
+ * Note that for DBlocks there is no difference
+ * betwen key and vhash, but for other blocks
+ * there may be!
+ * @param type entries of which type are relevant?
+ * Use 0 for any type.
+ * @param iter function to call on each matching value; however,
+ * after the first call to "iter", the plugin must wait
+ * until "NextRequest" was called before giving the iterator
+ * the next item; finally, the "iter" should be called once
+ * once with a NULL value at the end ("next_cls" should be NULL
+ * for that last call)
+ * @param iter_cls closure for iter
+ */
+typedef void (*PluginGet) (void *cls,
+ const GNUNET_HashCode * key,
+ const GNUNET_HashCode * vhash,
+ enum GNUNET_BLOCK_Type type,
+ PluginIterator iter, void *iter_cls);
+
+
+/**
+ * Update the priority for a particular key in the datastore. If
+ * the expiration time in value is different than the time found in
+ * the datastore, the higher value should be kept. For the
+ * anonymity level, the lower value is to be used. The specified
+ * priority should be added to the existing priority, ignoring the
+ * priority in value.
+ *
+ * Note that it is possible for multiple values to match this put.
+ * In that case, all of the respective values are updated.
+ *
+ * @param cls closure
+ * @param uid unique identifier of the datum
+ * @param delta by how much should the priority
+ * change? If priority + delta < 0 the
+ * priority should be set to 0 (never go
+ * negative).
+ * @param expire new expiration time should be the
+ * MAX of any existing expiration time and
+ * this value
+ * @param msg set to an error message (on error)
+ * @return GNUNET_OK on success
+ */
+typedef int (*PluginUpdate) (void *cls,
+ uint64_t uid,
+ int delta, struct GNUNET_TIME_Absolute expire,
+ char **msg);
+
+
+/**
+ * Select a subset of the items in the datastore and call
+ * the given iterator for each of them.
+ *
+ * @param cls closure
+ * @param type entries of which type should be considered?
+ * Use 0 for any type.
+ * @param iter function to call on each matching value; however,
+ * after the first call to "iter", the plugin must wait
+ * until "NextRequest" was called before giving the iterator
+ * the next item; finally, the "iter" should be called once
+ * once with a NULL value at the end ("next_cls" should be NULL
+ * for that last call)
+ * @param iter_cls closure for iter
+ */
+typedef void (*PluginSelector) (void *cls,
+ enum GNUNET_BLOCK_Type type,
+ PluginIterator iter,
+ void *iter_cls);
+
+/**
+ * Drop database.
+ *
+ * @param cls closure
+ */
+typedef void (*PluginDrop) (void *cls);
+
+
+
+/**
+ * Each plugin is required to return a pointer to a struct of this
+ * type as the return value from its entry point.
+ */
+struct GNUNET_DATASTORE_PluginFunctions
+{
+
+ /**
+ * Closure to use for all of the following callbacks
+ * (except "next_request").
+ */
+ void *cls;
+
+ /**
+ * Get the current on-disk size of the SQ store. Estimates are
+ * fine, if that's the only thing available.
+ */
+ PluginGetSize get_size;
+
+ /**
+ * Function to store an item in the datastore.
+ */
+ PluginPut put;
+
+ /**
+ * Function called by iterators whenever they want the next value;
+ * note that unlike all of the other callbacks, this one does get a
+ * the "next_cls" closure which is usually different from the "cls"
+ * member of this struct!
+ */
+ PluginNextRequest next_request;
+
+ /**
+ * Function to iterate over the results for a particular key
+ * in the datastore.
+ */
+ PluginGet get;
+
+ /**
+ * Update the priority for a particular key in the datastore. If
+ * the expiration time in value is different than the time found in
+ * the datastore, the higher value should be kept. For the
+ * anonymity level, the lower value is to be used. The specified
+ * priority should be added to the existing priority, ignoring the
+ * priority in value.
+ */
+ PluginUpdate update;
+
+ /**
+ * Iterate over the items in the datastore in ascending
+ * order of priority.
+ */
+ PluginSelector iter_low_priority;
+
+ /**
+ * Iterate over content with anonymity zero.
+ */
+ PluginSelector iter_zero_anonymity;
+
+ /**
+ * Iterate over the items in the datastore in ascending order of
+ * expiration time.
+ */
+ PluginSelector iter_ascending_expiration;
+
+ /**
+ * Iterate over the items in the datastore in migration
+ * order. Call the given function on the next item only
+ * (and then signal 'end' with a second call). This is
+ * a significant difference from all the other iterators!
+ */
+ PluginSelector iter_migration_order;
+
+ /**
+ * Iterate over all the items in the datastore
+ * as fast as possible in a single transaction
+ * (can lock datastore while this happens, focus
+ * is on doing it fast).
+ */
+ PluginSelector iter_all_now;
+
+ /**
+ * Delete the database. The next operation is
+ * guaranteed to be unloading of the module.
+ */
+ PluginDrop drop;
+
+};
+
+
+#endif
Modified: gnunet/src/include/gnunet_dv_service.h
===================================================================
--- gnunet/src/include/gnunet_dv_service.h 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/include/gnunet_dv_service.h 2010-11-05 21:54:44 UTC (rev
13571)
@@ -40,7 +40,7 @@
#include "gnunet_common.h"
#include "gnunet_configuration_lib.h"
#include "gnunet_scheduler_lib.h"
-#include "../transport/plugin_transport.h"
+#include "../transport/gnunet_transport_plugin.h"
/**
* Version of the dv API.
Copied: gnunet/src/include/gnunet_transport_plugin.h (from rev 13565,
gnunet/src/transport/plugin_transport.h)
===================================================================
--- gnunet/src/include/gnunet_transport_plugin.h
(rev 0)
+++ gnunet/src/include/gnunet_transport_plugin.h 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -0,0 +1,474 @@
+/*
+ This file is part of GNUnet
+ (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file transport/gnunet_transport_plugin.h
+ * @brief API for the transport services. This header
+ * specifies the struct that is given to the plugin's entry
+ * method and the other struct that must be returned.
+ * Note that the destructors of transport plugins will
+ * be given the value returned by the constructor
+ * and is expected to return a NULL pointer.
+ * @author Christian Grothoff
+ */
+#ifndef PLUGIN_TRANSPORT_H
+#define PLUGIN_TRANSPORT_H
+
+#include "gnunet_configuration_lib.h"
+#include "gnunet_scheduler_lib.h"
+#include "gnunet_statistics_service.h"
+#include "gnunet_transport_service.h"
+#include "transport_selection.h"
+
+
+/**
+ * Opaque pointer that plugins can use to distinguish specific
+ * connections to a given peer. Typically used by stateful plugins to
+ * allow the service to refer to specific streams instead of a more
+ * general notion of "some connection" to the given peer. This is
+ * useful since sometimes (i.e. for inbound TCP connections) a
+ * connection may not have an address that can be used for meaningful
+ * distinction between sessions to the same peer.
+ */
+struct Session;
+
+/**
+ * Every 'struct Session' must begin with this header.
+ */
+struct SessionHeader
+{
+
+ /**
+ * Cached signature for PONG generation for the session. Do not use
+ * in the plugin!
+ */
+ struct GNUNET_CRYPTO_RsaSignature pong_signature;
+
+ /**
+ * Expiration time for signature. Do not use in the plugin!
+ */
+ struct GNUNET_TIME_Absolute pong_sig_expires;
+
+};
+
+/**
+ * Function that will be called whenever the plugin internally
+ * cleans up a session pointer and hence the service needs to
+ * discard all of those sessions as well. Plugins that do not
+ * use sessions can simply omit calling this function and always
+ * use NULL wherever a session pointer is needed.
+ *
+ * @param cls closure
+ * @param peer which peer was the session for
+ * @param session which session is being destoyed
+ */
+typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls,
+ const struct GNUNET_PeerIdentity
*peer,
+ struct Session *session);
+
+
+/**
+ * Function called by the transport for each received message.
+ * This function should also be called with "NULL" for the
+ * message to signal that the other peer disconnected.
+ *
+ * @param cls closure
+ * @param peer (claimed) identity of the other peer
+ * @param message the message, NULL if we only care about
+ * learning about the delay until we should receive again --
FIXME!
+ * @param distance in overlay hops; use 1 unless DV (or 0 if message == NULL)
+ * @param session identifier used for this session (NULL for plugins
+ * that do not offer bi-directional communication to the sender
+ * using the same "connection")
+ * @param sender_address binary address of the sender (if we established the
+ * connection or are otherwise sure of it; should be NULL
+ * for inbound TCP/UDP connections since it it not clear
+ * that we could establish ourselves a connection to that
+ * IP address and get the same system)
+ * @param sender_address_len number of bytes in sender_address
+ * @return how long the plugin should wait until receiving more data
+ * (plugins that do not support this, can ignore the return value)
+ */
+typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback)
(void *cls,
+
const struct
+
GNUNET_PeerIdentity *
+
peer,
+
const struct
+
GNUNET_MessageHeader *
+
message,
+
uint32_t distance,
+
struct Session *session,
+
const char *sender_address,
+
uint16_t sender_address_len);
+
+
+/**
+ * Function that will be called for each address the transport
+ * is aware that it might be reachable under.
+ *
+ * @param cls closure
+ * @param name name of the transport that generated the address
+ * @param addr one of the addresses of the host, NULL for the last address
+ * the specific address format depends on the transport
+ * @param addrlen length of the address
+ * @param expires when should this address automatically expire?
+ */
+typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls,
+ const char *name,
+ const void *addr,
+ uint16_t addrlen,
+ struct
+ GNUNET_TIME_Relative
+ expires);
+
+/**
+ * Function that will be called whenever the plugin receives data over
+ * the network and wants to determine how long it should wait until
+ * the next time it reads from the given peer. Note that some plugins
+ * (such as UDP) may not be able to wait (for a particular peer), so
+ * the waiting part is optional. Plugins that can wait should call
+ * this function, sleep the given amount of time, and call it again
+ * (with zero bytes read) UNTIL it returns zero and only then read.
+ *
+ * @param cls closure
+ * @param peer which peer did we read data from
+ * @param amount_recved number of bytes read (can be zero)
+ * @return how long to wait until reading more from this peer
+ * (to enforce inbound quotas)
+ */
+typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void
*cls,
+ const
struct
+
GNUNET_PeerIdentity *peer,
+ size_t
amount_recved);
+
+/**
+ * Function called whenever the plugin has to notify ATS about costs for using
this transport
+ *
+ * The cost will be passed as struct GNUNET_ATS_Cost_Information[]
+ * This array is 0-terminated, so the last element will be a pair:
+ * ((cost->cost_type==GNUNET_ATS_ARRAY_TERMINATOR) && cost->cost_value==0))
+ *
+ * @param cls closure
+ * @param peer peer
+ * @param addr peer address
+ * @param addrlen address length
+ * @param cost pointer to the first element of struct
GNUNET_ATS_Cost_Information[]
+ */
+typedef void (*GNUNET_TRANSPORT_CostReport) (void *cls,
+
const struct GNUNET_PeerIdentity *peer,
+ const void *addr,
+ uint16_t addrlen,
+
struct GNUNET_ATS_Information * cost);
+
+/**
+ * The transport service will pass a pointer to a struct
+ * of this type as the first and only argument to the
+ * entry point of each transport plugin.
+ */
+struct GNUNET_TRANSPORT_PluginEnvironment
+{
+ /**
+ * Configuration to use.
+ */
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
+
+ /**
+ * Identity of this peer.
+ */
+ const struct GNUNET_PeerIdentity *my_identity;
+
+ /**
+ * Pointer (!) to our HELLO message. Note that the address
+ * referred to "*our_hello" might change over time.
+ */
+ struct GNUNET_HELLO_Message *const*our_hello;
+
+ /**
+ * Closure for the various callbacks.
+ */
+ void *cls;
+
+ /**
+ * Handle for reporting statistics.
+ */
+ struct GNUNET_STATISTICS_Handle *stats;
+
+ /**
+ * Function that should be called by the transport plugin
+ * whenever a message is received.
+ */
+ GNUNET_TRANSPORT_PluginReceiveCallback receive;
+
+ /**
+ * Function that must be called by each plugin to notify the
+ * transport service about the addresses under which the transport
+ * provided by the plugin can be reached.
+ */
+ GNUNET_TRANSPORT_AddressNotification notify_address;
+
+ /**
+ * Inform service about traffic received, get information
+ * about when we might be willing to receive more.
+ */
+ GNUNET_TRANSPORT_TrafficReport traffic_report;
+
+ /**
+ * Function that must be called by the plugin when a non-NULL
+ * session handle stops being valid (is destroyed).
+ */
+ GNUNET_TRANSPORT_SessionEnd session_end;
+
+ /**
+ * Inform service about costs for using this transport plugin
+ */
+ GNUNET_TRANSPORT_CostReport cost_report;
+
+ /**
+ * What is the maximum number of connections that this transport
+ * should allow? Transports that do not have sessions (such as
+ * UDP) can ignore this value.
+ */
+ uint32_t max_connections;
+
+};
+
+
+/**
+ * Function called by the GNUNET_TRANSPORT_TransmitFunction
+ * upon "completion".
+ *
+ * @param cls closure
+ * @param target who was the recipient of the message?
+ * @param result GNUNET_OK on success
+ * GNUNET_SYSERR if the target disconnected;
+ * disconnect will ALSO be signalled using
+ * the ReceiveCallback.
+ */
+typedef void
+ (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls,
+ const struct GNUNET_PeerIdentity *
+ target, int result);
+
+
+/**
+ * Function that can be used by the transport service to transmit
+ * a message using the plugin. Note that in the case of a
+ * peer disconnecting, the continuation MUST be called
+ * prior to the disconnect notification itself. This function
+ * will be called with this peer's HELLO message to initiate
+ * a fresh connection to another peer.
+ *
+ * @param cls closure
+ * @param target who should receive this message
+ * @param msgbuf the message to transmit
+ * @param msgbuf_size number of bytes in 'msgbuf'
+ * @param priority how important is the message (most plugins will
+ * ignore message priority and just FIFO)
+ * @param timeout how long to wait at most for the transmission (does not
+ * require plugins to discard the message after the timeout,
+ * just advisory for the desired delay; most plugins will ignore
+ * this as well)
+ * @param session which session must be used (or NULL for "any")
+ * @param addr the address to use (can be NULL if the plugin
+ * is "on its own" (i.e. re-use existing TCP connection))
+ * @param addrlen length of the address in bytes
+ * @param force_address GNUNET_YES if the plugin MUST use the given address,
+ * GNUNET_NO means the plugin may use any other address and
+ * GNUNET_SYSERR means that only reliable existing
+ * bi-directional connections should be used (regardless
+ * of address)
+ * @param cont continuation to call once the message has
+ * been transmitted (or if the transport is ready
+ * for the next transmission call; or if the
+ * peer disconnected...); can be NULL
+ * @param cont_cls closure for cont
+ * @return number of bytes used (on the physical network, with overheads);
+ * -1 on hard errors (i.e. address invalid); 0 is a legal value
+ * and does NOT mean that the message was not transmitted (DV)
+ */
+typedef ssize_t
+ (*GNUNET_TRANSPORT_TransmitFunction) (void *cls,
+ const struct GNUNET_PeerIdentity *
+ target,
+ const char *msgbuf,
+ size_t msgbuf_size,
+ uint32_t priority,
+ struct GNUNET_TIME_Relative timeout,
+ struct Session *session,
+ const void *addr,
+ size_t addrlen,
+ int force_address,
+ GNUNET_TRANSPORT_TransmitContinuation
+ cont, void *cont_cls);
+
+
+/**
+ * Function that can be called to force a disconnect from the
+ * specified neighbour. This should also cancel all previously
+ * scheduled transmissions. Obviously the transmission may have been
+ * partially completed already, which is OK. The plugin is supposed
+ * to close the connection (if applicable) and no longer call the
+ * transmit continuation(s).
+ *
+ * Finally, plugin MUST NOT call the services's receive function to
+ * notify the service that the connection to the specified target was
+ * closed after a getting this call.
+ *
+ * @param cls closure
+ * @param target peer for which the last transmission is
+ * to be cancelled
+ */
+typedef void
+ (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls,
+ const struct GNUNET_PeerIdentity *
+ target);
+
+
+/**
+ * Function called by the pretty printer for the resolved address for
+ * each human-readable address obtained.
+ *
+ * @param cls closure
+ * @param hostname one of the names for the host, NULL
+ * on the last call to the callback
+ */
+typedef void (*GNUNET_TRANSPORT_AddressStringCallback) (void *cls,
+ const char *address);
+
+
+/**
+ * Convert the transports address to a nice, human-readable
+ * format.
+ *
+ * @param cls closure
+ * @param name name of the transport that generated the address
+ * @param addr one of the addresses of the host, NULL for the last address
+ * the specific address format depends on the transport
+ * @param addrlen length of the address
+ * @param numeric should (IP) addresses be displayed in numeric form?
+ * @param timeout after how long should we give up?
+ * @param asc function to call on each string
+ * @param asc_cls closure for asc
+ */
+typedef void
+ (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls,
+ const char *type,
+ const void *addr,
+ size_t addrlen,
+ int numeric,
+ struct GNUNET_TIME_Relative
+ timeout,
+
GNUNET_TRANSPORT_AddressStringCallback
+ asc, void *asc_cls);
+
+
+/**
+ * Another peer has suggested an address for this peer and transport
+ * plugin. Check that this could be a valid address. This function
+ * is not expected to 'validate' the address in the sense of trying to
+ * connect to it but simply to see if the binary format is technically
+ * legal for establishing a connection to this peer (and make sure that
+ * the address really corresponds to our network connection/settings
+ * and not some potential man-in-the-middle).
+ *
+ * @param addr pointer to the address
+ * @param addrlen length of addr
+ * @return GNUNET_OK if this is a plausible address for this peer
+ * and transport, GNUNET_SYSERR if not
+ */
+typedef int
+(*GNUNET_TRANSPORT_CheckAddress) (void *cls,
+ const void *addr, size_t addrlen);
+
+
+/**
+ * Function called for a quick conversion of the binary address to
+ * a numeric address. Note that the caller must not free the
+ * address and that the next call to this function is allowed
+ * to override the address again.
+ *
+ * @param cls closure
+ * @param addr binary address
+ * @param addr_len length of the address
+ * @return string representing the same address
+ */
+typedef const char* (*GNUNET_TRANSPORT_AddressToString) (void *cls,
+ const void *addr,
+ size_t addrlen);
+
+
+/**
+ * Each plugin is required to return a pointer to a struct of this
+ * type as the return value from its entry point.
+ */
+struct GNUNET_TRANSPORT_PluginFunctions
+{
+
+ /**
+ * Closure for all of the callbacks.
+ */
+ void *cls;
+
+ /**
+ * Function that the transport service will use to transmit data to
+ * another peer. May be NULL for plugins that only support
+ * receiving data. After this call, the plugin call the specified
+ * continuation with success or error before notifying us about the
+ * target having disconnected.
+ */
+ GNUNET_TRANSPORT_TransmitFunction send;
+
+ /**
+ * Function that can be used to force the plugin to disconnect from
+ * the given peer and cancel all previous transmissions (and their
+ * continuations). Note that if the transport does not have
+ * sessions / persistent connections (for example, UDP), this
+ * function may very well do nothing.
+ */
+ GNUNET_TRANSPORT_DisconnectFunction disconnect;
+
+ /**
+ * Function to pretty-print addresses. NOTE: this function is not
+ * yet used by transport-service, but will be used in the future
+ * once the transport-API has been completed.
+ */
+ GNUNET_TRANSPORT_AddressPrettyPrinter address_pretty_printer;
+
+ /**
+ * Function that will be called to check if a binary address
+ * for this plugin is well-formed and corresponds to an
+ * address for THIS peer (as per our configuration). Naturally,
+ * if absolutely necessary, plugins can be a bit conservative in
+ * their answer, but in general plugins should make sure that the
+ * address does not redirect traffic to a 3rd party that might
+ * try to man-in-the-middle our traffic.
+ */
+ GNUNET_TRANSPORT_CheckAddress check_address;
+
+ /**
+ * Function that will be called to convert a binary address
+ * to a string (numeric conversion only).
+ */
+ GNUNET_TRANSPORT_AddressToString address_to_string;
+
+};
+
+
+#endif
Modified: gnunet/src/transport/Makefile.am
===================================================================
--- gnunet/src/transport/Makefile.am 2010-11-05 21:45:44 UTC (rev 13570)
+++ gnunet/src/transport/Makefile.am 2010-11-05 21:54:44 UTC (rev 13571)
@@ -19,14 +19,13 @@
HTTP_API_TEST = test_transport_api_http
HTTP_REL_TEST = test_transport_api_reliability_http
HTTP_QUOTA_TEST = test_quota_compliance_http \
-
test_quota_compliance_http_asymmetric_recv_constant
-
+ test_quota_compliance_http_asymmetric_recv_constant
HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
HTTPS_PLUGIN_TEST = test_plugin_transport_https
HTTPS_API_TEST = test_transport_api_https
HTTPS_REL_TEST = test_transport_api_reliability_https
HTTPS_QUOTA_TEST = test_quota_compliance_https \
-
test_quota_compliance_https_asymmetric_recv_constant
+ test_quota_compliance_https_asymmetric_recv_constant
endif
if USE_COVERAGE
@@ -175,7 +174,7 @@
libgnunet_plugin_transport_http_la_LDFLAGS = \
$(GN_LIBMHD) \
$(GN_PLUGIN_LDFLAGS)
-
+
libgnunet_plugin_transport_https_la_SOURCES = \
plugin_transport_http.c
libgnunet_plugin_transport_https_la_LIBADD = \
@@ -298,7 +297,7 @@
test_transport_api_reliability_http_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
test_plugin_transport_https_SOURCES = \
test_plugin_transport_https.c
test_plugin_transport_https_LDADD = \
@@ -330,7 +329,7 @@
test_quota_compliance_tcp_asymmetric_recv_constant_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
#test_quota_compliance_tcp_asymmetric_send_constant_SOURCES = \
# test_quota_compliance.c
#test_quota_compliance_tcp_asymmetric_send_constant_LDADD = \
@@ -342,13 +341,13 @@
test_quota_compliance_http_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
test_quota_compliance_http_asymmetric_recv_constant_SOURCES = \
test_quota_compliance.c
test_quota_compliance_http_asymmetric_recv_constant_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
#test_quota_compliance_http_asymmetric_send_constant_SOURCES = \
# test_quota_compliance.c
#test_quota_compliance_http_asymmetric_send_constant_LDADD = \
@@ -366,7 +365,7 @@
test_quota_compliance_https_asymmetric_recv_constant_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
#test_quota_compliance_https_asymmetric_send_constant_SOURCES = \
# test_quota_compliance.c
#test_quota_compliance_https_asymmetric_send_constant_LDADD = \
@@ -378,13 +377,13 @@
test_quota_compliance_udp_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
test_quota_compliance_udp_asymmetric_recv_constant_SOURCES = \
test_quota_compliance.c
test_quota_compliance_udp_asymmetric_recv_constant_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
-
+
#test_quota_compliance_udp_asymmetric_send_constant_SOURCES = \
# test_quota_compliance.c
#test_quota_compliance_udp_asymmetric_send_constant_LDADD = \
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/gnunet-service-transport.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -36,7 +36,7 @@
#include "gnunet_protocols.h"
#include "gnunet_service_lib.h"
#include "gnunet_signatures.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "transport.h"
#define DEBUG_BLACKLIST GNUNET_YES
Deleted: gnunet/src/transport/plugin_transport.h
===================================================================
--- gnunet/src/transport/plugin_transport.h 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/transport/plugin_transport.h 2010-11-05 21:54:44 UTC (rev
13571)
@@ -1,474 +0,0 @@
-/*
- This file is part of GNUnet
- (C) 2009, 2010 Christian Grothoff (and other contributing authors)
-
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file transport/plugin_transport.h
- * @brief API for the transport services. This header
- * specifies the struct that is given to the plugin's entry
- * method and the other struct that must be returned.
- * Note that the destructors of transport plugins will
- * be given the value returned by the constructor
- * and is expected to return a NULL pointer.
- * @author Christian Grothoff
- */
-#ifndef PLUGIN_TRANSPORT_H
-#define PLUGIN_TRANSPORT_H
-
-#include "gnunet_configuration_lib.h"
-#include "gnunet_scheduler_lib.h"
-#include "gnunet_statistics_service.h"
-#include "gnunet_transport_service.h"
-#include "transport_selection.h"
-
-
-/**
- * Opaque pointer that plugins can use to distinguish specific
- * connections to a given peer. Typically used by stateful plugins to
- * allow the service to refer to specific streams instead of a more
- * general notion of "some connection" to the given peer. This is
- * useful since sometimes (i.e. for inbound TCP connections) a
- * connection may not have an address that can be used for meaningful
- * distinction between sessions to the same peer.
- */
-struct Session;
-
-/**
- * Every 'struct Session' must begin with this header.
- */
-struct SessionHeader
-{
-
- /**
- * Cached signature for PONG generation for the session. Do not use
- * in the plugin!
- */
- struct GNUNET_CRYPTO_RsaSignature pong_signature;
-
- /**
- * Expiration time for signature. Do not use in the plugin!
- */
- struct GNUNET_TIME_Absolute pong_sig_expires;
-
-};
-
-/**
- * Function that will be called whenever the plugin internally
- * cleans up a session pointer and hence the service needs to
- * discard all of those sessions as well. Plugins that do not
- * use sessions can simply omit calling this function and always
- * use NULL wherever a session pointer is needed.
- *
- * @param cls closure
- * @param peer which peer was the session for
- * @param session which session is being destoyed
- */
-typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls,
- const struct GNUNET_PeerIdentity
*peer,
- struct Session *session);
-
-
-/**
- * Function called by the transport for each received message.
- * This function should also be called with "NULL" for the
- * message to signal that the other peer disconnected.
- *
- * @param cls closure
- * @param peer (claimed) identity of the other peer
- * @param message the message, NULL if we only care about
- * learning about the delay until we should receive again --
FIXME!
- * @param distance in overlay hops; use 1 unless DV (or 0 if message == NULL)
- * @param session identifier used for this session (NULL for plugins
- * that do not offer bi-directional communication to the sender
- * using the same "connection")
- * @param sender_address binary address of the sender (if we established the
- * connection or are otherwise sure of it; should be NULL
- * for inbound TCP/UDP connections since it it not clear
- * that we could establish ourselves a connection to that
- * IP address and get the same system)
- * @param sender_address_len number of bytes in sender_address
- * @return how long the plugin should wait until receiving more data
- * (plugins that do not support this, can ignore the return value)
- */
-typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback)
(void *cls,
-
const struct
-
GNUNET_PeerIdentity *
-
peer,
-
const struct
-
GNUNET_MessageHeader *
-
message,
-
uint32_t distance,
-
struct Session *session,
-
const char *sender_address,
-
uint16_t sender_address_len);
-
-
-/**
- * Function that will be called for each address the transport
- * is aware that it might be reachable under.
- *
- * @param cls closure
- * @param name name of the transport that generated the address
- * @param addr one of the addresses of the host, NULL for the last address
- * the specific address format depends on the transport
- * @param addrlen length of the address
- * @param expires when should this address automatically expire?
- */
-typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls,
- const char *name,
- const void *addr,
- uint16_t addrlen,
- struct
- GNUNET_TIME_Relative
- expires);
-
-/**
- * Function that will be called whenever the plugin receives data over
- * the network and wants to determine how long it should wait until
- * the next time it reads from the given peer. Note that some plugins
- * (such as UDP) may not be able to wait (for a particular peer), so
- * the waiting part is optional. Plugins that can wait should call
- * this function, sleep the given amount of time, and call it again
- * (with zero bytes read) UNTIL it returns zero and only then read.
- *
- * @param cls closure
- * @param peer which peer did we read data from
- * @param amount_recved number of bytes read (can be zero)
- * @return how long to wait until reading more from this peer
- * (to enforce inbound quotas)
- */
-typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void
*cls,
- const
struct
-
GNUNET_PeerIdentity *peer,
- size_t
amount_recved);
-
-/**
- * Function called whenever the plugin has to notify ATS about costs for using
this transport
- *
- * The cost will be passed as struct GNUNET_ATS_Cost_Information[]
- * This array is 0-terminated, so the last element will be a pair:
- * ((cost->cost_type==GNUNET_ATS_ARRAY_TERMINATOR) && cost->cost_value==0))
- *
- * @param cls closure
- * @param peer peer
- * @param addr peer address
- * @param addrlen address length
- * @param cost pointer to the first element of struct
GNUNET_ATS_Cost_Information[]
- */
-typedef void (*GNUNET_TRANSPORT_CostReport) (void *cls,
-
const struct GNUNET_PeerIdentity *peer,
- const void *addr,
- uint16_t addrlen,
-
struct GNUNET_ATS_Information * cost);
-
-/**
- * The transport service will pass a pointer to a struct
- * of this type as the first and only argument to the
- * entry point of each transport plugin.
- */
-struct GNUNET_TRANSPORT_PluginEnvironment
-{
- /**
- * Configuration to use.
- */
- const struct GNUNET_CONFIGURATION_Handle *cfg;
-
- /**
- * Identity of this peer.
- */
- const struct GNUNET_PeerIdentity *my_identity;
-
- /**
- * Pointer (!) to our HELLO message. Note that the address
- * referred to "*our_hello" might change over time.
- */
- struct GNUNET_HELLO_Message *const*our_hello;
-
- /**
- * Closure for the various callbacks.
- */
- void *cls;
-
- /**
- * Handle for reporting statistics.
- */
- struct GNUNET_STATISTICS_Handle *stats;
-
- /**
- * Function that should be called by the transport plugin
- * whenever a message is received.
- */
- GNUNET_TRANSPORT_PluginReceiveCallback receive;
-
- /**
- * Function that must be called by each plugin to notify the
- * transport service about the addresses under which the transport
- * provided by the plugin can be reached.
- */
- GNUNET_TRANSPORT_AddressNotification notify_address;
-
- /**
- * Inform service about traffic received, get information
- * about when we might be willing to receive more.
- */
- GNUNET_TRANSPORT_TrafficReport traffic_report;
-
- /**
- * Function that must be called by the plugin when a non-NULL
- * session handle stops being valid (is destroyed).
- */
- GNUNET_TRANSPORT_SessionEnd session_end;
-
- /**
- * Inform service about costs for using this transport plugin
- */
- GNUNET_TRANSPORT_CostReport cost_report;
-
- /**
- * What is the maximum number of connections that this transport
- * should allow? Transports that do not have sessions (such as
- * UDP) can ignore this value.
- */
- uint32_t max_connections;
-
-};
-
-
-/**
- * Function called by the GNUNET_TRANSPORT_TransmitFunction
- * upon "completion".
- *
- * @param cls closure
- * @param target who was the recipient of the message?
- * @param result GNUNET_OK on success
- * GNUNET_SYSERR if the target disconnected;
- * disconnect will ALSO be signalled using
- * the ReceiveCallback.
- */
-typedef void
- (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls,
- const struct GNUNET_PeerIdentity *
- target, int result);
-
-
-/**
- * Function that can be used by the transport service to transmit
- * a message using the plugin. Note that in the case of a
- * peer disconnecting, the continuation MUST be called
- * prior to the disconnect notification itself. This function
- * will be called with this peer's HELLO message to initiate
- * a fresh connection to another peer.
- *
- * @param cls closure
- * @param target who should receive this message
- * @param msgbuf the message to transmit
- * @param msgbuf_size number of bytes in 'msgbuf'
- * @param priority how important is the message (most plugins will
- * ignore message priority and just FIFO)
- * @param timeout how long to wait at most for the transmission (does not
- * require plugins to discard the message after the timeout,
- * just advisory for the desired delay; most plugins will ignore
- * this as well)
- * @param session which session must be used (or NULL for "any")
- * @param addr the address to use (can be NULL if the plugin
- * is "on its own" (i.e. re-use existing TCP connection))
- * @param addrlen length of the address in bytes
- * @param force_address GNUNET_YES if the plugin MUST use the given address,
- * GNUNET_NO means the plugin may use any other address and
- * GNUNET_SYSERR means that only reliable existing
- * bi-directional connections should be used (regardless
- * of address)
- * @param cont continuation to call once the message has
- * been transmitted (or if the transport is ready
- * for the next transmission call; or if the
- * peer disconnected...); can be NULL
- * @param cont_cls closure for cont
- * @return number of bytes used (on the physical network, with overheads);
- * -1 on hard errors (i.e. address invalid); 0 is a legal value
- * and does NOT mean that the message was not transmitted (DV)
- */
-typedef ssize_t
- (*GNUNET_TRANSPORT_TransmitFunction) (void *cls,
- const struct GNUNET_PeerIdentity *
- target,
- const char *msgbuf,
- size_t msgbuf_size,
- uint32_t priority,
- struct GNUNET_TIME_Relative timeout,
- struct Session *session,
- const void *addr,
- size_t addrlen,
- int force_address,
- GNUNET_TRANSPORT_TransmitContinuation
- cont, void *cont_cls);
-
-
-/**
- * Function that can be called to force a disconnect from the
- * specified neighbour. This should also cancel all previously
- * scheduled transmissions. Obviously the transmission may have been
- * partially completed already, which is OK. The plugin is supposed
- * to close the connection (if applicable) and no longer call the
- * transmit continuation(s).
- *
- * Finally, plugin MUST NOT call the services's receive function to
- * notify the service that the connection to the specified target was
- * closed after a getting this call.
- *
- * @param cls closure
- * @param target peer for which the last transmission is
- * to be cancelled
- */
-typedef void
- (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls,
- const struct GNUNET_PeerIdentity *
- target);
-
-
-/**
- * Function called by the pretty printer for the resolved address for
- * each human-readable address obtained.
- *
- * @param cls closure
- * @param hostname one of the names for the host, NULL
- * on the last call to the callback
- */
-typedef void (*GNUNET_TRANSPORT_AddressStringCallback) (void *cls,
- const char *address);
-
-
-/**
- * Convert the transports address to a nice, human-readable
- * format.
- *
- * @param cls closure
- * @param name name of the transport that generated the address
- * @param addr one of the addresses of the host, NULL for the last address
- * the specific address format depends on the transport
- * @param addrlen length of the address
- * @param numeric should (IP) addresses be displayed in numeric form?
- * @param timeout after how long should we give up?
- * @param asc function to call on each string
- * @param asc_cls closure for asc
- */
-typedef void
- (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls,
- const char *type,
- const void *addr,
- size_t addrlen,
- int numeric,
- struct GNUNET_TIME_Relative
- timeout,
-
GNUNET_TRANSPORT_AddressStringCallback
- asc, void *asc_cls);
-
-
-/**
- * Another peer has suggested an address for this peer and transport
- * plugin. Check that this could be a valid address. This function
- * is not expected to 'validate' the address in the sense of trying to
- * connect to it but simply to see if the binary format is technically
- * legal for establishing a connection to this peer (and make sure that
- * the address really corresponds to our network connection/settings
- * and not some potential man-in-the-middle).
- *
- * @param addr pointer to the address
- * @param addrlen length of addr
- * @return GNUNET_OK if this is a plausible address for this peer
- * and transport, GNUNET_SYSERR if not
- */
-typedef int
-(*GNUNET_TRANSPORT_CheckAddress) (void *cls,
- const void *addr, size_t addrlen);
-
-
-/**
- * Function called for a quick conversion of the binary address to
- * a numeric address. Note that the caller must not free the
- * address and that the next call to this function is allowed
- * to override the address again.
- *
- * @param cls closure
- * @param addr binary address
- * @param addr_len length of the address
- * @return string representing the same address
- */
-typedef const char* (*GNUNET_TRANSPORT_AddressToString) (void *cls,
- const void *addr,
- size_t addrlen);
-
-
-/**
- * Each plugin is required to return a pointer to a struct of this
- * type as the return value from its entry point.
- */
-struct GNUNET_TRANSPORT_PluginFunctions
-{
-
- /**
- * Closure for all of the callbacks.
- */
- void *cls;
-
- /**
- * Function that the transport service will use to transmit data to
- * another peer. May be NULL for plugins that only support
- * receiving data. After this call, the plugin call the specified
- * continuation with success or error before notifying us about the
- * target having disconnected.
- */
- GNUNET_TRANSPORT_TransmitFunction send;
-
- /**
- * Function that can be used to force the plugin to disconnect from
- * the given peer and cancel all previous transmissions (and their
- * continuations). Note that if the transport does not have
- * sessions / persistent connections (for example, UDP), this
- * function may very well do nothing.
- */
- GNUNET_TRANSPORT_DisconnectFunction disconnect;
-
- /**
- * Function to pretty-print addresses. NOTE: this function is not
- * yet used by transport-service, but will be used in the future
- * once the transport-API has been completed.
- */
- GNUNET_TRANSPORT_AddressPrettyPrinter address_pretty_printer;
-
- /**
- * Function that will be called to check if a binary address
- * for this plugin is well-formed and corresponds to an
- * address for THIS peer (as per our configuration). Naturally,
- * if absolutely necessary, plugins can be a bit conservative in
- * their answer, but in general plugins should make sure that the
- * address does not redirect traffic to a 3rd party that might
- * try to man-in-the-middle our traffic.
- */
- GNUNET_TRANSPORT_CheckAddress check_address;
-
- /**
- * Function that will be called to convert a binary address
- * to a string (numeric conversion only).
- */
- GNUNET_TRANSPORT_AddressToString address_to_string;
-
-};
-
-
-#endif
Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/plugin_transport_http.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -19,7 +19,7 @@
*/
/**
- * @file transport/plugin_transport_http.c
+ * @file transport/gnunet_transport_plugin.http.c
* @brief http transport service plugin
* @author Matthias Wachs
*/
@@ -35,19 +35,19 @@
#include "gnunet_resolver_service.h"
#include "gnunet_server_lib.h"
#include "gnunet_container_lib.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "gnunet_os_lib.h"
#include "microhttpd.h"
#include <curl/curl.h>
#if BUILD_HTTPS
-#define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_https_init
-#define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_https_done
+#define LIBGNUNET_PLUGIN_TRANSPORT_INIT
libgnunet_gnunet_transport_plugin.https_init
+#define LIBGNUNET_PLUGIN_TRANSPORT_DONE
libgnunet_gnunet_transport_plugin.https_done
#define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_https
#define PROTOCOL_PREFIX "https"
#else
-#define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_http_init
-#define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_http_done
+#define LIBGNUNET_PLUGIN_TRANSPORT_INIT
libgnunet_gnunet_transport_plugin.http_init
+#define LIBGNUNET_PLUGIN_TRANSPORT_DONE
libgnunet_gnunet_transport_plugin.http_done
#define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_http
#define PROTOCOL_PREFIX "http"
#endif
@@ -3099,4 +3099,4 @@
return api;
}
-/* end of plugin_transport_http.c */
+/* end of gnunet_transport_plugin.http.c */
Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/transport/plugin_transport_tcp.c 2010-11-05 21:54:44 UTC (rev
13571)
@@ -34,7 +34,7 @@
#include "gnunet_signatures.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "transport.h"
#define DEBUG_TCP GNUNET_NO
Modified: gnunet/src/transport/plugin_transport_template.c
===================================================================
--- gnunet/src/transport/plugin_transport_template.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/plugin_transport_template.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -31,7 +31,7 @@
#include "gnunet_service_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#define DEBUG_TEMPLATE GNUNET_NO
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2010-11-05 21:45:44 UTC (rev
13570)
+++ gnunet/src/transport/plugin_transport_udp.c 2010-11-05 21:54:44 UTC (rev
13571)
@@ -50,7 +50,7 @@
#include "gnunet_signatures.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "transport.h"
#define DEBUG_UDP GNUNET_YES
Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/plugin_transport_wlan.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -30,7 +30,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "plugin_transport_wlan.h"
#include "gnunet_common.h"
#include "gnunet_crypto_lib.h"
Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/test_plugin_transport.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -34,7 +34,7 @@
#include "gnunet_protocols.h"
#include "gnunet_program_lib.h"
#include "gnunet_signatures.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "transport.h"
#define VERBOSE GNUNET_NO
Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/test_plugin_transport_http.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -18,8 +18,8 @@
Boston, MA 02111-1307, USA.
*/
/**
- * @file transport/test_plugin_transport_http.c
- * @brief testcase for plugin_transport_http.c
+ * @file transport/test_gnunet_transport_plugin.http.c
+ * @brief testcase for gnunet_transport_plugin.http.c
* @author Matthias Wachs
*/
@@ -37,7 +37,7 @@
#include "gnunet_service_lib.h"
#include "gnunet_crypto_lib.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "gnunet_statistics_service.h"
#include "transport.h"
#include <curl/curl.h>
@@ -459,10 +459,10 @@
GNUNET_free(test_addr);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Unloading http plugin\n");
- GNUNET_assert (NULL == GNUNET_PLUGIN_unload
("libgnunet_plugin_transport_http", api));
+ GNUNET_assert (NULL == GNUNET_PLUGIN_unload
("libgnunet_gnunet_transport_plugin.http", api));
GNUNET_SCHEDULER_shutdown();
- GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_http");
+ GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.http");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting testcase\n");
exit(fail);
@@ -1200,7 +1200,7 @@
/* load plugins... */
setup_plugin_environment ();
- GNUNET_asprintf (&libname, "libgnunet_plugin_transport_http");
+ GNUNET_asprintf (&libname, "libgnunet_gnunet_transport_plugin.http");
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading HTTP transport plugin
`%s'\n"),libname);
api = GNUNET_PLUGIN_load (libname, &env);
GNUNET_free (libname);
@@ -1311,7 +1311,7 @@
};
int ret;
char *const argv_prog[] = {
- "test_plugin_transport_http",
+ "test_gnunet_transport_plugin.http",
"-c",
"test_plugin_transport_data_http.conf",
"-L",
@@ -1322,7 +1322,7 @@
#endif
NULL
};
- GNUNET_log_setup ("test_plugin_transport_http",
+ GNUNET_log_setup ("test_gnunet_transport_plugin.http",
#if VERBOSE
"DEBUG",
#else
@@ -1333,12 +1333,12 @@
ret = (GNUNET_OK ==
GNUNET_PROGRAM_run (5,
argv_prog,
- "test_plugin_transport_http",
+ "test_gnunet_transport_plugin.http",
"testcase", options, &run, NULL)) ? GNUNET_NO :
GNUNET_YES;
- GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_http");
+ GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.http");
return fail;
}
-/* end of test_plugin_transport_http.c */
+/* end of test_gnunet_transport_plugin.http.c */
Modified: gnunet/src/transport/test_plugin_transport_https.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_https.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/test_plugin_transport_https.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -18,8 +18,8 @@
Boston, MA 02111-1307, USA.
*/
/**
- * @file transport/test_plugin_transport_https.c
- * @brief testcase for plugin_transport_https.c
+ * @file transport/test_gnunet_transport_plugin.https.c
+ * @brief testcase for gnunet_transport_plugin.https.c
* @author Matthias Wachs
*/
@@ -37,7 +37,7 @@
#include "gnunet_service_lib.h"
#include "gnunet_crypto_lib.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "gnunet_statistics_service.h"
#include "transport.h"
#include <curl/curl.h>
@@ -462,10 +462,10 @@
GNUNET_free(test_addr);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Unloading https plugin\n");
- GNUNET_assert (NULL == GNUNET_PLUGIN_unload
("libgnunet_plugin_transport_https", api));
+ GNUNET_assert (NULL == GNUNET_PLUGIN_unload
("libgnunet_gnunet_transport_plugin.https", api));
GNUNET_SCHEDULER_shutdown();
- GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_http");
+ GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.http");
struct stat sbuf;
if (0 == stat (cert_file, &sbuf ))
@@ -1266,7 +1266,7 @@
/* load plugins... */
setup_plugin_environment ();
- GNUNET_asprintf (&libname, "libgnunet_plugin_transport_https");
+ GNUNET_asprintf (&libname, "libgnunet_gnunet_transport_plugin.https");
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading HTTPS transport plugin
`%s'\n"),libname);
api = GNUNET_PLUGIN_load (libname, &env);
GNUNET_free (libname);
@@ -1376,7 +1376,7 @@
};
int ret;
char *const argv_prog[] = {
- "test_plugin_transport_https",
+ "test_gnunet_transport_plugin.https",
"-c",
"test_plugin_transport_data_http.conf",
"-L",
@@ -1387,7 +1387,7 @@
#endif
NULL
};
- GNUNET_log_setup ("test_plugin_transport_https",
+ GNUNET_log_setup ("test_gnunet_transport_plugin.https",
#if VERBOSE
"DEBUG",
#else
@@ -1398,12 +1398,12 @@
ret = (GNUNET_OK ==
GNUNET_PROGRAM_run (5,
argv_prog,
- "test_plugin_transport_https",
+ "test_gnunet_transport_plugin.https",
"testcase", options, &run, NULL)) ? GNUNET_NO :
GNUNET_YES;
- GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_https");
+ GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.https");
return fail;
}
-/* end of test_plugin_transport_http.c */
+/* end of test_gnunet_transport_plugin.http.c */
Modified: gnunet/src/transport/test_plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_udp.c 2010-11-05 21:45:44 UTC
(rev 13570)
+++ gnunet/src/transport/test_plugin_transport_udp.c 2010-11-05 21:54:44 UTC
(rev 13571)
@@ -35,7 +35,7 @@
#include "gnunet_protocols.h"
#include "gnunet_program_lib.h"
#include "gnunet_signatures.h"
-#include "plugin_transport.h"
+#include "gnunet_transport_plugin.h"
#include "transport.h"
#define VERBOSE GNUNET_NO
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13571 - in gnunet/src: block datacache datastore dv include transport,
gnunet <=