[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26640 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26640 - gnunet/src/transport |
Date: |
Thu, 28 Mar 2013 14:49:14 +0100 |
Author: wachs
Date: 2013-03-28 14:49:14 +0100 (Thu, 28 Mar 2013)
New Revision: 26640
Modified:
gnunet/src/transport/gnunet-service-transport.c
gnunet/src/transport/gnunet-service-transport_manipulation.c
gnunet/src/transport/gnunet-service-transport_manipulation.h
Log:
docu
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2013-03-28 13:26:19 UTC
(rev 26639)
+++ gnunet/src/transport/gnunet-service-transport.c 2013-03-28 13:49:14 UTC
(rev 26640)
@@ -692,7 +692,7 @@
GST_blacklist_start (GST_server, GST_cfg, &GST_my_identity);
GST_ats =
GNUNET_ATS_scheduling_init (GST_cfg, &ats_request_address_change, NULL);
- GST_manipulation_init (GST_cfg, &plugin_env_update_metrics);
+ GST_manipulation_init (GST_cfg);
GST_plugins_load (&GST_manipulation_recv,
&plugin_env_address_change_notification,
&plugin_env_session_end,
Modified: gnunet/src/transport/gnunet-service-transport_manipulation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_manipulation.c
2013-03-28 13:26:19 UTC (rev 26639)
+++ gnunet/src/transport/gnunet-service-transport_manipulation.c
2013-03-28 13:49:14 UTC (rev 26640)
@@ -52,8 +52,6 @@
{
struct GNUNET_CONTAINER_MultiHashMap *peers;
- GNUNET_TRANSPORT_UpdateAddressMetrics metric_update_cb;
-
/**
* General inbound delay
*/
@@ -290,6 +288,17 @@
GNUNET_free (dqe);
}
+
+/**
+ * Adapter function between transport's send function and transport plugins
+ *
+ * @param target the peer the message to send to
+ * @param msg the message received
+ * @param msg_size message size
+ * @param timeout timeout
+ * @param cont the continuation to call after sending
+ * @param cont_cls cls for continuation
+ */
void
GST_manipulation_send (const struct GNUNET_PeerIdentity *target, const void
*msg,
size_t msg_size, struct GNUNET_TIME_Relative timeout,
@@ -393,6 +402,19 @@
return ats_new;
}
+
+/**
+ * Adapter function between transport plugins and transport receive function
+ * manipulation delays for next send.
+ *
+ * @param cls the closure for transport
+ * @param peer the peer the message was received from
+ * @param message the message received
+ * @param session the session the message was received on
+ * @param sender_address the sender address
+ * @param sender_address_len the length of the sender address
+ * @return manipulated delay for next receive
+ */
struct GNUNET_TIME_Relative
GST_manipulation_recv (void *cls,
const struct GNUNET_PeerIdentity *peer,
@@ -426,12 +448,15 @@
return m_delay;
}
+
+/**
+ * Initialize traffic manipulation
+ *
+ * @param GST_cfg configuration handle
+ */
void
-GST_manipulation_init (const struct GNUNET_CONFIGURATION_Handle *GST_cfg,
- GNUNET_TRANSPORT_UpdateAddressMetrics metric_update_cb)
+GST_manipulation_init (const struct GNUNET_CONFIGURATION_Handle *GST_cfg)
{
- man_handle.metric_update_cb = metric_update_cb;
-
if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number (GST_cfg,
"transport", "MANIPULATE_DISTANCE_IN",
&man_handle.distance_recv))
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Setting inbound
distance_in to %u\n",
Modified: gnunet/src/transport/gnunet-service-transport_manipulation.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_manipulation.h
2013-03-28 13:26:19 UTC (rev 26639)
+++ gnunet/src/transport/gnunet-service-transport_manipulation.h
2013-03-28 13:49:14 UTC (rev 26640)
@@ -41,11 +41,34 @@
GST_manipulation_set_metric (void *cls, struct GNUNET_SERVER_Client *client,
const struct GNUNET_MessageHeader *message);
+/**
+ * Adapter function between transport's send function and transport plugins
+ *
+ * @param target the peer the message to send to
+ * @param msg the message received
+ * @param msg_size message size
+ * @param timeout timeout
+ * @param cont the continuation to call after sending
+ * @param cont_cls cls for continuation
+ */
void
-GST_manipulation_send (const struct GNUNET_PeerIdentity *target, const void
*msg,
- size_t msg_size, struct GNUNET_TIME_Relative timeout,
- GST_NeighbourSendContinuation cont, void *cont_cls);
+GST_manipulation_send (const struct GNUNET_PeerIdentity *target,
+
const void *msg, size_t msg_size,
+
struct GNUNET_TIME_Relative timeout,
+
GST_NeighbourSendContinuation cont, void *cont_cls);
+/**
+ * Adapter function between transport plugins and transport receive function
+ * manipulation delays for next send.
+ *
+ * @param cls the closure for transport
+ * @param peer the peer the message was received from
+ * @param message the message received
+ * @param session the session the message was received on
+ * @param sender_address the sender address
+ * @param sender_address_len the length of the sender address
+ * @return manipulated delay for next receive
+ */
struct GNUNET_TIME_Relative
GST_manipulation_recv (void *cls,
const struct GNUNET_PeerIdentity *peer,
@@ -71,10 +94,17 @@
const struct GNUNET_ATS_Information *ats,
uint32_t ats_count);
+/**
+ * Initialize traffic manipulation
+ *
+ * @param GST_cfg configuration handle
+ */
void
-GST_manipulation_init (const struct GNUNET_CONFIGURATION_Handle *GST_cfg,
- GNUNET_TRANSPORT_UpdateAddressMetrics metric_update_cb);
+GST_manipulation_init (const struct GNUNET_CONFIGURATION_Handle *GST_cfg);
+/**
+ * Stop traffic manipulation
+ */
void
GST_manipulation_stop ();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26640 - gnunet/src/transport,
gnunet <=