aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2011-08-12 10:54:28 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2011-08-12 10:54:28 +0000
commit11fac3bf77e48f4439b602727f9abe2f63eab6b9 (patch)
treec198a1c8a918412d018f446d98ee553a3a1dac68
parent7cb6e0403faa30edc5bcedc5c8489f622ce06095 (diff)
initial ATS service refactoring
git-svn-id: https://gnunet.org/svn/gnunet@16466 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/ats/Makefile.am38
-rw-r--r--src/ats/ats_api.c (renamed from src/transport/gnunet-service-transport_ats-new.c)100
-rw-r--r--src/include/gnunet_ats_service.h (renamed from src/transport/gnunet-service-transport_ats-new.h)96
-rw-r--r--src/transport/Makefile.am2
-rw-r--r--src/transport/gnunet-service-transport-new.c8
-rw-r--r--src/transport/gnunet-service-transport.h2
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c14
-rw-r--r--src/transport/gnunet-service-transport_validation.c6
10 files changed, 156 insertions, 112 deletions
diff --git a/configure.ac b/configure.ac
index 3e309da164..d212979694 100644
--- a/configure.ac
+++ b/configure.ac
@@ -741,6 +741,7 @@ m4/Makefile
po/Makefile.in
src/Makefile
src/arm/Makefile
+src/ats/Makefile
src/block/Makefile
src/core/Makefile
src/datacache/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index ac08a16a91..044983d601 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,6 +17,7 @@ SUBDIRS = \
datacache \
datastore \
template \
+ ats \
nat \
fragmentation \
transport \
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am
new file mode 100644
index 0000000000..39aa3f87b7
--- /dev/null
+++ b/src/ats/Makefile.am
@@ -0,0 +1,38 @@
+INCLUDES = -I$(top_srcdir)/src/include
+
+if MINGW
+ WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
+endif
+
+if USE_COVERAGE
+ AM_CFLAGS = -fprofile-arcs -ftest-coverage
+endif
+
+lib_LTLIBRARIES = libgnunetats.la
+
+libgnunetats_la_SOURCES = \
+ ats_api.c
+
+
+#bin_PROGRAMS = \
+# gnunet-service-ats
+
+#gnunet_service_ats_SOURCES = \
+# gnunet-service-ats.c
+#gnunet_service_ats_LDADD = \
+# $(top_builddir)/src/util/libgnunetutil.la \
+# $(GN_LIBINTL)
+
+
+#check_PROGRAMS = \
+# test_ats_api
+
+#if ENABLE_TEST_RUN
+#TESTS = $(check_PROGRAMS)
+#endif
+
+#test_ats_api_SOURCES = \
+# test_ats_api.c
+#test_ats_api_LDADD = \
+# $(top_builddir)/src/util/libgnunetutil.la
+
diff --git a/src/transport/gnunet-service-transport_ats-new.c b/src/ats/ats_api.c
index 3a8bc74974..8609ac5a5a 100644
--- a/src/transport/gnunet-service-transport_ats-new.c
+++ b/src/ats/ats_api.c
@@ -18,14 +18,18 @@
Boston, MA 02111-1307, USA.
*/
/**
- * @file transport/gnunet-service-transport_ats-new.c
+ * @file ats/ats_api.c
* @brief automatic transport selection API
* @author Christian Grothoff
* @author Matthias Wachs
*/
#include "platform.h"
-#include "gnunet-service-transport_ats-new.h"
+#include "gnunet_ats_service.h"
+// NOTE: this implementation is simply supposed
+// to implement a simplistic strategy in-process;
+// in the future, we plan to replace it with a real
+// service implementation
/**
* Allocation record for a peer's address.
@@ -84,13 +88,13 @@ struct AllocationRecord
/**
* Opaque handle to stop incremental validation address callbacks.
*/
-struct GST_AtsSuggestionContext
+struct GNUNET_ATS_SuggestionContext
{
/**
* Function to call with our final suggestion.
*/
- GST_AtsAddressSuggestionCallback cb;
+ GNUNET_ATS_AddressSuggestionCallback cb;
/**
* Closure for 'cb'.
@@ -100,7 +104,7 @@ struct GST_AtsSuggestionContext
/**
* Global ATS handle.
*/
- struct GST_AtsHandle *atc;
+ struct GNUNET_ATS_Handle *atc;
/**
* Which peer are we monitoring?
@@ -113,7 +117,7 @@ struct GST_AtsSuggestionContext
/**
* Handle to the ATS subsystem.
*/
-struct GST_AtsHandle
+struct GNUNET_ATS_Handle
{
/**
* Configuration.
@@ -137,7 +141,7 @@ struct GST_AtsHandle
struct GNUNET_CONTAINER_MultiHashMap *peers;
/**
- * Map of PeerIdentities to 'struct GST_AtsSuggestionContext's.
+ * Map of PeerIdentities to 'struct GNUNET_ATS_SuggestionContext's.
*/
struct GNUNET_CONTAINER_MultiHashMap *notify_map;
@@ -177,7 +181,7 @@ count_connections (void *cls,
struct SetBandwidthContext
{
- struct GST_AtsHandle *atc;
+ struct GNUNET_ATS_Handle *atc;
struct GNUNET_BANDWIDTH_Value32NBO bw;
};
@@ -226,14 +230,14 @@ set_bw_connections (void *cls,
/**
* Task run to update bandwidth assignments.
*
- * @param cls the 'struct GST_AtsHandle'
+ * @param cls the 'struct GNUNET_ATS_Handle'
* @param tc scheduler context
*/
static void
update_bandwidth_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- struct GST_AtsHandle *atc = cls;
+ struct GNUNET_ATS_Handle *atc = cls;
unsigned int ac;
struct SetBandwidthContext bwc;
@@ -257,7 +261,7 @@ update_bandwidth_task (void *cls,
* @param change which allocation record changed?
*/
static void
-update_bandwidth_assignment (struct GST_AtsHandle *atc,
+update_bandwidth_assignment (struct GNUNET_ATS_Handle *atc,
struct AllocationRecord *change)
{
/* FIXME: based on the 'change', update the LP-problem... */
@@ -270,7 +274,7 @@ update_bandwidth_assignment (struct GST_AtsHandle *atc,
/**
* Function called with feasbile addresses we might want to suggest.
*
- * @param cls the 'struct GST_AtsSuggestionContext'
+ * @param cls the 'struct GNUNET_ATS_SuggestionContext'
* @param key identity of the peer
* @param value a 'struct AllocationRecord' for the peer
* @return GNUNET_NO if we're done, GNUNET_YES if we did not suggest an address yet
@@ -280,7 +284,7 @@ suggest_address (void *cls,
const GNUNET_HashCode *key,
void *value)
{
- struct GST_AtsSuggestionContest *asc = cls;
+ struct GNUNET_ATS_SuggestionContest *asc = cls;
struct AllocationRecord *ar = value;
// FIXME...
@@ -297,15 +301,15 @@ suggest_address (void *cls,
* @param cb function to call with the address
* @param cb_cls closure for cb
*/
-struct GST_AtsSuggestionContext *
-GST_ats_suggest_address (struct GST_AtsHandle *atc,
+struct GNUNET_ATS_SuggestionContext *
+GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc,
const struct GNUNET_PeerIdentity *peer,
- GST_AtsAddressSuggestionCallback cb,
+ GNUNET_ATS_AddressSuggestionCallback cb,
void *cb_cls)
{
- struct GST_AtsSuggestionContext *asc;
+ struct GNUNET_ATS_SuggestionContext *asc;
- asc = GNUNET_malloc (sizeof (struct GST_AtsSuggestionContext));
+ asc = GNUNET_malloc (sizeof (struct GNUNET_ATS_SuggestionContext));
asc->cb = cb;
asc->cb_cls = cb_cls;
asc->atc = atc;
@@ -333,7 +337,7 @@ GST_ats_suggest_address (struct GST_AtsHandle *atc,
* @param asc handle of the request to cancel
*/
void
-GST_ats_suggest_address_cancel (struct GST_AtsSuggestionContext *asc)
+GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc)
{
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (asc->atc->notify_map,
@@ -351,14 +355,14 @@ GST_ats_suggest_address_cancel (struct GST_AtsSuggestionContext *asc)
* @param alloc_cb_cls closure for 'alloc_cb'
* @return ats context
*/
-struct GST_AtsHandle *
-GST_ats_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
+struct GNUNET_ATS_Handle *
+GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
void *alloc_cb_cls)
{
- struct GST_AtsHandle *atc;
+ struct GNUNET_ATS_Handle *atc;
- atc = GNUNET_malloc (sizeof (struct GST_AtsHandle));
+ atc = GNUNET_malloc (sizeof (struct GNUNET_ATS_Handle));
atc->cfg = cfg;
atc->alloc_cb = alloc_cb;
atc->alloc_cb_cls = alloc_cb_cls;
@@ -399,7 +403,7 @@ destroy_allocation_record (void *cls,
* @param atc handle
*/
void
-GST_ats_shutdown (struct GST_AtsHandle *atc)
+GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc)
{
if (GNUNET_SCHEDULER_NO_TASK != atc->ba_task)
{
@@ -425,7 +429,7 @@ struct UpdateSessionContext
/**
* Ats handle.
*/
- struct GST_AtsHandle *atc;
+ struct GNUNET_ATS_Handle *atc;
/**
* Allocation record with new information.
@@ -536,7 +540,7 @@ disconnect_peer (void *cls,
const GNUNET_HashCode *key,
void *value)
{
- struct GST_AtsHandle *atc = cls;
+ struct GNUNET_ATS_Handle *atc = cls;
struct AllocationRecord *ar = value;
if (GNUNET_YES == ar->connected)
@@ -564,15 +568,15 @@ disconnect_peer (void *cls,
* @param ats_count number of performance records in 'ats'
*/
void
-GST_ats_peer_connect (struct GST_AtsHandle *atc,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name,
- struct Session *session,
- const void *plugin_addr,
- size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count)
+GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name,
+ struct Session *session,
+ const void *plugin_addr,
+ size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count)
{
struct AllocationRecord *ar;
struct UpdateSessionContext usc;
@@ -615,7 +619,7 @@ GST_ats_peer_connect (struct GST_AtsHandle *atc,
* @param peer identity of the new peer
*/
void
-GST_ats_peer_disconnect (struct GST_AtsHandle *atc,
+GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc,
const struct GNUNET_PeerIdentity *peer)
{
(void) GNUNET_CONTAINER_multihashmap_get_multiple (atc->peers,
@@ -633,7 +637,7 @@ struct SessionDestroyContext
/**
* Ats handle.
*/
- struct GST_AtsHandle *atc;
+ struct GNUNET_ATS_Handle *atc;
/**
* Session being destroyed.
@@ -685,7 +689,7 @@ destroy_session (void *cls,
* @param session session handle that is no longer valid
*/
void
-GST_ats_session_destroyed (struct GST_AtsHandle *atc,
+GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
const struct GNUNET_PeerIdentity *peer,
const struct Session *session)
{
@@ -713,7 +717,7 @@ notify_valid (void *cls,
void *value)
{
struct AllocationRecord *ar = cls;
- struct GST_AtsSuggestionContext *asc = value;
+ struct GNUNET_ATS_SuggestionContext *asc = value;
asc->cb (asc->cb_cls,
&ar->public_key,
@@ -745,15 +749,15 @@ notify_valid (void *cls,
* @param ats_count number of performance records in 'ats'
*/
void
-GST_ats_address_update (struct GST_AtsHandle *atc,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name,
- struct Session *session,
- const void *plugin_addr,
- size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count)
+GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name,
+ struct Session *session,
+ const void *plugin_addr,
+ size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count)
{
struct AllocationRecord *ar;
struct UpdateSessionContext usc;
diff --git a/src/transport/gnunet-service-transport_ats-new.h b/src/include/gnunet_ats_service.h
index ed72dd1715..da54b24bea 100644
--- a/src/transport/gnunet-service-transport_ats-new.h
+++ b/src/include/gnunet_ats_service.h
@@ -18,18 +18,18 @@
Boston, MA 02111-1307, USA.
*/
/**
- * @file transport/gnunet-service-transport_ats-new.h
+ * @file include/gnunet_ats_service.h
* @brief automatic transport selection and outbound bandwidth determination
* @author Christian Grothoff
* @author Matthias Wachs
*
* TODO:
- * - turn into service
+ * - move GNUNET_TRANSPORT_ATS* in here and rename...
* - extend API to express communication preferences to ATS
* (to be called DIRECTLY from apps, not from transport/core!)
*/
-#ifndef GNUNET_SERVICE_TRANSPORT_ATS_H
-#define GNUNET_SERVICE_TRANSPORT_ATS_H
+#ifndef GNUNET_ATS_SERVICE_H
+#define GNUNET_ATS_SERVICE_H
#include "gnunet_constants.h"
#include "gnunet_util_lib.h"
@@ -40,7 +40,7 @@
/**
* Handle to the ATS subsystem.
*/
-struct GST_AtsHandle;
+struct GNUNET_ATS_Handle;
/**
@@ -75,10 +75,10 @@ typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification)(void *cls,
* @param alloc_cb_cls closure for 'alloc_cb'
* @return ats context
*/
-struct GST_AtsHandle *
-GST_ats_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
- void *alloc_cb_cls);
+struct GNUNET_ATS_Handle *
+GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
+ void *alloc_cb_cls);
/**
@@ -87,7 +87,7 @@ GST_ats_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
* @param atc handle
*/
void
-GST_ats_shutdown (struct GST_AtsHandle *atc);
+GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc);
/**
@@ -102,20 +102,20 @@ GST_ats_shutdown (struct GST_AtsHandle *atc);
* @param ats performance data for the address (as far as known)
* @param ats_count number of performance records in 'ats'
*/
-typedef void (*GST_AtsAddressSuggestionCallback)(void *cls,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name,
- const void *plugin_addr,
- size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count);
+typedef void (*GNUNET_ATS_AddressSuggestionCallback)(void *cls,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name,
+ const void *plugin_addr,
+ size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count);
/**
* Handle to cancel suggestion request.
*/
-struct GST_AtsSuggestionContext;
+struct GNUNET_ATS_SuggestionContext;
/**
@@ -127,11 +127,11 @@ struct GST_AtsSuggestionContext;
* @param cb function to call with the address
* @param cb_cls closure for cb
*/
-struct GST_AtsSuggestionContext *
-GST_ats_suggest_address (struct GST_AtsHandle *atc,
- const struct GNUNET_PeerIdentity *peer,
- GST_AtsAddressSuggestionCallback cb,
- void *cb_cls);
+struct GNUNET_ATS_SuggestionContext *
+GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer,
+ GNUNET_ATS_AddressSuggestionCallback cb,
+ void *cb_cls);
/**
@@ -140,7 +140,7 @@ GST_ats_suggest_address (struct GST_AtsHandle *atc,
* @param asc handle of the request to cancel
*/
void
-GST_ats_suggest_address_cancel (struct GST_AtsSuggestionContext *asc);
+GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc);
/**
@@ -159,15 +159,15 @@ GST_ats_suggest_address_cancel (struct GST_AtsSuggestionContext *asc);
* @param ats_count number of performance records in 'ats'
*/
void
-GST_ats_peer_connect (struct GST_AtsHandle *atc,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name,
- struct Session *session,
- const void *plugin_addr,
- size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count);
+GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name,
+ struct Session *session,
+ const void *plugin_addr,
+ size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count);
/**
@@ -179,8 +179,8 @@ GST_ats_peer_connect (struct GST_AtsHandle *atc,
* @param peer identity of the peer
*/
void
-GST_ats_peer_disconnect (struct GST_AtsHandle *atc,
- const struct GNUNET_PeerIdentity *peer);
+GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer);
/**
@@ -191,9 +191,9 @@ GST_ats_peer_disconnect (struct GST_AtsHandle *atc,
* @param session session handle that is no longer valid
*/
void
-GST_ats_session_destroyed (struct GST_AtsHandle *atc,
- const struct GNUNET_PeerIdentity *peer,
- const struct Session *session);
+GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct Session *session);
/**
@@ -215,15 +215,15 @@ GST_ats_session_destroyed (struct GST_AtsHandle *atc,
* @param ats_count number of performance records in 'ats'
*/
void
-GST_ats_address_update (struct GST_AtsHandle *atc,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name,
- struct Session *session,
- const void *plugin_addr,
- size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count);
+GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name,
+ struct Session *session,
+ const void *plugin_addr,
+ size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count);
#endif
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index b9ab214e05..372ff115eb 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -153,7 +153,6 @@ gnunet_service_transport_LDADD = \
gnunet_service_transport_new_SOURCES = \
gnunet-service-transport-new.c gnunet-service-transport.h \
- gnunet-service-transport_ats-new.h gnunet-service-transport_ats-new.c \
gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \
gnunet-service-transport_clients.h gnunet-service-transport_clients.c \
gnunet-service-transport_hello.h gnunet-service-transport_hello.c \
@@ -161,6 +160,7 @@ gnunet_service_transport_new_SOURCES = \
gnunet-service-transport_plugins.h gnunet-service-transport_plugins.c \
gnunet-service-transport_validation.h gnunet-service-transport_validation.c
gnunet_service_transport_new_LDADD = \
+ $(top_builddir)/src/ats/libgnunetats.la \
$(top_builddir)/src/hello/libgnunethello.la \
$(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
$(top_builddir)/src/statistics/libgnunetstatistics.la \
diff --git a/src/transport/gnunet-service-transport-new.c b/src/transport/gnunet-service-transport-new.c
index 968145b1e9..cd1901a274 100644
--- a/src/transport/gnunet-service-transport-new.c
+++ b/src/transport/gnunet-service-transport-new.c
@@ -28,8 +28,8 @@
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
#include "gnunet_peerinfo_service.h"
+#include "gnunet_ats_service.h"
#include "gnunet-service-transport.h"
-#include "gnunet-service-transport_ats-new.h"
#include "gnunet-service-transport_blacklist.h"
#include "gnunet-service-transport_clients.h"
#include "gnunet-service-transport_hello.h"
@@ -72,7 +72,7 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GST_my_private_key;
/**
* ATS handle.
*/
-struct GST_AtsHandle *GST_ats;
+struct GNUNET_ATS_Handle *GST_ats;
/**
@@ -133,7 +133,7 @@ shutdown_task (void *cls,
{
GST_validation_stop ();
GST_neighbours_stop ();
- GST_ats_shutdown (GST_ats); GST_ats = NULL;
+ GNUNET_ATS_shutdown (GST_ats); GST_ats = NULL;
GST_clients_stop ();
GST_blacklist_stop ();
GST_plugins_unload ();
@@ -221,7 +221,7 @@ run (void *cls,
NULL, // FIXME...
NULL, // FIXME...
NULL); // FIXME...
- GST_ats = GST_ats_init (GST_cfg,
+ GST_ats = GNUNET_ATS_init (GST_cfg,
NULL, // FIXME...
NULL); // FIXME...
GST_neighbours_start (NULL, // FIXME...
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h
index 69cb20e7bd..17fcaa0ae0 100644
--- a/src/transport/gnunet-service-transport.h
+++ b/src/transport/gnunet-service-transport.h
@@ -63,7 +63,7 @@ extern struct GNUNET_CRYPTO_RsaPrivateKey *GST_my_private_key;
/**
* ATS handle.
*/
-extern struct GST_AtsHandle *GST_ats;
+extern struct GNUNET_ATS_Handle *GST_ats;
#endif
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index cff2bb595e..2d23ebfa1b 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -24,7 +24,7 @@
* @author Christian Grothoff
*/
#include "platform.h"
-#include "gnunet-service-transport_ats-new.h"
+#include "gnunet_ats_service.h"
#include "gnunet-service-transport_neighbours.h"
#include "gnunet-service-transport_validation.h"
#include "gnunet-service-transport.h"
@@ -129,7 +129,7 @@ struct NeighbourMapEntry
* Context for address suggestion.
* NULL after we are connected.
*/
- struct GST_AtsSuggestionContext *asc;
+ struct GNUNET_ATS_SuggestionContext *asc;
/**
* Performance data for the peer.
@@ -341,7 +341,7 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
}
if (NULL != n->asc)
{
- GST_ats_suggest_address_cancel (n->asc);
+ GNUNET_ATS_suggest_address_cancel (n->asc);
n->asc = NULL;
}
GNUNET_array_grow (n->ats,
@@ -486,10 +486,10 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target)
}
if (n->asc != NULL)
return; /* already trying */
- n->asc = GST_ats_suggest_address (GST_ats,
- target,
- &try_connect_using_address,
- n);
+ n->asc = GNUNET_ATS_suggest_address (GST_ats,
+ target,
+ &try_connect_using_address,
+ n);
}
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 1a619a901d..2b03e38057 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -27,9 +27,9 @@
#include "gnunet-service-transport_validation.h"
#include "gnunet-service-transport_plugins.h"
#include "gnunet-service-transport_hello.h"
-#include "gnunet-service-transport_ats-new.h"
#include "gnunet-service-transport.h"
#include "gnunet_hello_lib.h"
+#include "gnunet_ats_service.h"
#include "gnunet_peerinfo_service.h"
#include "gnunet_signatures.h"
@@ -418,7 +418,7 @@ add_valid_address (void *cls,
ve = find_validation_entry (&public_key, &pid, tname, addr, addrlen);
ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until,
expiration);
- GST_ats_address_update (GST_ats,
+ GNUNET_ATS_address_update (GST_ats,
&public_key,
&pid,
tname,
@@ -1037,7 +1037,7 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
/* validity achieved, remember it! */
ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION);
- GST_ats_address_update (GST_ats,
+ GNUNET_ATS_address_update (GST_ats,
&ve->public_key,
&ve->pid,
ve->transport_name,