summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp_broadcasting.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-13 16:59:57 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-13 16:59:57 +0000
commit1257490cb630ade315a196a724d0233e662afb2c (patch)
tree0d9c01593a1aa73d8f6490127b640d67da69b54c /src/transport/plugin_transport_udp_broadcasting.c
parent35d79cb1941c9f9607195b8760d8a14d836e6397 (diff)
implementing 0003268 to inbound information in HELLO addresses
All transport plugin functions are modified to use HELLO addresses instead of peer,address,address_length All plugins are modified to use HELLO addresses internally This commit can break transport functionality: core tests on my system still pass, but transport tests may still fail, errors messages may occurs or crashs Will be fixed asap
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index c17a3ccff..669ebdb01 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -135,6 +135,7 @@ broadcast_ipv6_mst_cb (void *cls, void *client,
{
struct Plugin *plugin = cls;
struct Mstv6Context *mc = client;
+ struct GNUNET_HELLO_Address *address;
const struct GNUNET_MessageHeader *hello;
const struct UDP_Beacon_Message *msg;
struct GNUNET_ATS_Information atsi;
@@ -155,19 +156,12 @@ broadcast_ipv6_mst_cb (void *cls, void *client,
GNUNET_break (ntohl(mc->ats_address_network_type) != GNUNET_ATS_NET_UNSPECIFIED);
hello = (struct GNUNET_MessageHeader *) &msg[1];
- plugin->env->receive (plugin->env->cls,
- &msg->sender,
- hello,
- NULL,
- (const char *) &mc->addr,
- sizeof (mc->addr));
- plugin->env->update_address_metrics (plugin->env->cls,
- &msg->sender,
- (const char *) &mc->addr,
- sizeof (mc->addr),
- NULL,
- &atsi, 1);
-
+ address = GNUNET_HELLO_address_allocate (&msg->sender, PLUGIN_NAME,
+ (const char *) &mc->addr, sizeof (mc->addr), GNUNET_HELLO_ADDRESS_INFO_INBOUND);
+ plugin->env->receive (plugin->env->cls, address, NULL, hello);
+ plugin->env->update_address_metrics (plugin->env->cls, address,
+ NULL, &atsi, 1);
+ GNUNET_HELLO_address_free (address);
GNUNET_STATISTICS_update (plugin->env->stats,
_
("# IPv6 multicast HELLO beacons received via udp"),
@@ -183,6 +177,7 @@ broadcast_ipv4_mst_cb (void *cls, void *client,
{
struct Plugin *plugin = cls;
struct Mstv4Context *mc = client;
+ struct GNUNET_HELLO_Address *address;
const struct GNUNET_MessageHeader *hello;
const struct UDP_Beacon_Message *msg;
struct GNUNET_ATS_Information atsi;
@@ -204,19 +199,12 @@ broadcast_ipv4_mst_cb (void *cls, void *client,
GNUNET_break (ntohl(mc->ats_address_network_type) != GNUNET_ATS_NET_UNSPECIFIED);
hello = (struct GNUNET_MessageHeader *) &msg[1];
- plugin->env->receive (plugin->env->cls,
- &msg->sender,
- hello,
- NULL,
- (const char *) &mc->addr,
- sizeof (mc->addr));
-
- plugin->env->update_address_metrics (plugin->env->cls,
- &msg->sender,
- (const char *) &mc->addr,
- sizeof (mc->addr),
- NULL,
- &atsi, 1);
+ address = GNUNET_HELLO_address_allocate (&msg->sender, PLUGIN_NAME,
+ (const char *) &mc->addr, sizeof (mc->addr), GNUNET_HELLO_ADDRESS_INFO_INBOUND);
+ plugin->env->receive (plugin->env->cls, address, NULL, hello);
+ plugin->env->update_address_metrics (plugin->env->cls, address,
+ NULL, &atsi, 1);
+ GNUNET_HELLO_address_free (address);
GNUNET_STATISTICS_update (plugin->env->stats,
_("# IPv4 broadcast HELLO beacons received via udp"),