*/
struct PendingRequest *pr_tail;
+ struct GNUNET_HELLO_Address *address;
+
/**
* To whom are we talking to.
*/
ats.type = htonl ((uint32_t) GNUNET_ATS_QUALITY_NET_DISTANCE);
ats.value = htonl (session->distance);
plugin->env->update_address_metrics (plugin->env->cls,
- &session->sender,
- NULL, 0,
- session,
- &ats, 1);
+ session->address, session, &ats, 1);
}
ntohs (message->size),
GNUNET_i2s (&session->sender));
- plugin->env->receive (plugin->env->cls,
- &session->sender,
- message,
- session, "", 0);
+ plugin->env->receive (plugin->env->cls, session->address, session,
+ message);
plugin->env->update_address_metrics (plugin->env->cls,
- &session->sender, NULL,
- 0, session,
- &ats, 1);
+ session->address, session, &ats, 1);
return GNUNET_OK;
}
ntohs (msg->type),
ntohs (msg->size),
GNUNET_i2s (sender));
- plugin->env->receive (plugin->env->cls, sender,
- msg,
- session, "", 0);
+ plugin->env->receive (plugin->env->cls, session->address, session, msg);
plugin->env->update_address_metrics (plugin->env->cls,
- sender, "",
- 0, session,
- &ats, 1);
+ session->address, session, &ats, 1);
}
}
session = GNUNET_new (struct Session);
+ session->address = GNUNET_HELLO_address_allocate (peer, PLUGIN_NAME,
+ NULL, 0, GNUNET_HELLO_ADDRESS_INFO_NONE);
session->sender = *peer;
session->plugin = plugin;
session->distance = distance;
ats[1].type = htonl (GNUNET_ATS_NETWORK_TYPE);
ats[1].value = htonl ((uint32_t) network);
session->active = GNUNET_YES;
- plugin->env->session_start (plugin->env->cls, peer,
- PLUGIN_NAME,
- NULL, 0,
+ plugin->env->session_start (plugin->env->cls, session->address,
session, ats, 2);
}
if (GNUNET_YES == session->active)
{
plugin->env->session_end (plugin->env->cls,
- &session->sender,
+ session->address,
session);
session->active = GNUNET_NO;
}
pr->size, 0);
GNUNET_free (pr);
}
+ GNUNET_HELLO_address_free (session->address);
GNUNET_free (session);
}
{
if ( (0 == addrlen) &&
(0 == strcmp (type, "dv")) )
- asc (asc_cls, "dv");
- asc (asc_cls, NULL);
+ asc (asc_cls, "dv", GNUNET_OK);
+ else
+ asc (asc_cls, NULL, GNUNET_SYSERR);
+
+ asc (asc_cls, NULL, GNUNET_OK);
}