static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
send_task = GNUNET_SCHEDULER_add_now (&send_task_f, NULL);
uint32_t session_id GNUNET_PACKED;
/* followed by:
- - struct GNUNET_TRANSPORT_ATS_Information [ats_count];
+ - struct GNUNET_ATS_Information [ats_count];
- char address[address_length]
- char plugin_name[plugin_name_length] (including '\0'-termination).
*/
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
/* followed by:
- - struct GNUNET_TRANSPORT_ATS_Information [ats_count];
+ - struct GNUNET_ATS_Information [ats_count];
- char address[address_length]
- char plugin_name[plugin_name_length] (including '\0'-termination).
*/
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
/* followed by:
- - struct GNUNET_TRANSPORT_ATS_Information [ats_count];
+ - struct GNUNET_ATS_Information [ats_count];
- char address[address_length]
- char plugin_name[plugin_name_length] (including '\0'-termination).
*/
static struct AllocationRecord *
create_allocation_record (const char *plugin_name, struct Session *session,
const void *plugin_addr, size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct AllocationRecord *ar;
GNUNET_assert (ats_count > 0);
GNUNET_array_grow (ar->ats, ar->ats_count, ats_count);
memcpy (ar->ats, ats,
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ ats_count * sizeof (struct GNUNET_ATS_Information));
ar->connected = GNUNET_SYSERR; /* aka: not known / no change */
return ar;
}
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,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct AllocationRecord *ar;
struct GNUNET_TIME_Absolute valid_until,
const char *plugin_name, struct Session *session,
const void *plugin_addr, size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct AllocationRecord *ar;
/**
* Performance information associated with this address (array).
*/
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
/**
* Name of the plugin
const struct GNUNET_MessageHeader *msg)
{
const struct PeerInformationMessage *pi;
- const struct GNUNET_TRANSPORT_ATS_Information *atsi;
+ const struct GNUNET_ATS_Information *atsi;
const char *address;
const char *plugin_name;
uint16_t address_length;
ats_count = ntohl (pi->ats_count);
address_length = ntohs (pi->address_length);
plugin_name_length = ntohs (pi->plugin_name_length);
- atsi = (const struct GNUNET_TRANSPORT_ATS_Information*) &pi[1];
+ atsi = (const struct GNUNET_ATS_Information*) &pi[1];
address = (const char*) &atsi[ats_count];
plugin_name = &address[address_length];
if ( (address_length +
plugin_name_length +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) +
+ ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct PeerInformationMessage) != ntohs (msg->size)) ||
- (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information)) ||
+ (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) ||
(plugin_name[plugin_name_length - 1] != '\0') )
{
GNUNET_break (0);
{
struct GNUNET_ATS_SchedulingHandle *sh = cls;
const struct AddressSuggestionMessage *m;
- const struct GNUNET_TRANSPORT_ATS_Information *atsi;
+ const struct GNUNET_ATS_Information *atsi;
const char *address;
const char *plugin_name;
uint16_t address_length;
m = (const struct AddressSuggestionMessage*) msg;
ats_count = ntohl (m->ats_count);
address_length = ntohs (m->address_length);
- atsi = (const struct GNUNET_TRANSPORT_ATS_Information*) &m[1];
+ atsi = (const struct GNUNET_ATS_Information*) &m[1];
address = (const char*) &atsi[ats_count];
plugin_name = &address[address_length];
plugin_name_length = ntohs (m->plugin_name_length);
if ( (address_length +
plugin_name_length +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) +
+ ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct AddressSuggestionMessage) != ntohs (msg->size)) ||
- (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information)) ||
+ (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) ||
(plugin_name[plugin_name_length - 1] != '\0') )
{
GNUNET_break (0);
const char *plugin_name,
const void *plugin_addr, size_t plugin_addr_len,
struct Session *session,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct PendingMessage *p;
struct AddressUpdateMessage *m;
- struct GNUNET_TRANSPORT_ATS_Information *am;
+ struct GNUNET_ATS_Information *am;
char *pm;
size_t namelen;
size_t msize;
namelen = (plugin_name == NULL) ? 0 : strlen (plugin_name) + 1;
msize = sizeof (struct AddressUpdateMessage) + plugin_addr_len +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) + namelen;
+ ats_count * sizeof (struct GNUNET_ATS_Information) + namelen;
if ( (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
(plugin_addr_len >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
(namelen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
- (ats_count >= GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information)) )
+ (ats_count >= GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) )
{
GNUNET_break (0);
return;
m->address_length = htons (plugin_addr_len);
m->plugin_name_length = htons (namelen);
m->session_id = htonl (get_session_id (sh, session));
- am = (struct GNUNET_TRANSPORT_ATS_Information*) &m[1];
- memcpy (am, ats, ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ am = (struct GNUNET_ATS_Information*) &m[1];
+ memcpy (am, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
pm = (char *) &am[ats_count];
memcpy (pm, plugin_addr, plugin_addr_len);
memcpy (&pm[plugin_addr_len], plugin_name, namelen);
char * plugin;
- struct GNUNET_TRANSPORT_ATS_Information * ats;
+ struct GNUNET_ATS_Information * ats;
struct GNUNET_BANDWIDTH_Value32NBO bw_in;
const void *plugin_addr, size_t plugin_addr_len,
struct GNUNET_SERVER_Client *session_client,
uint32_t session_id,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count)
{
struct ATS_Address * aa;
struct ATS_Address * old;
aa = GNUNET_malloc (sizeof (struct ATS_Address) + plugin_addr_len);
- aa->ats = GNUNET_malloc(atsi_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ aa->ats = GNUNET_malloc(atsi_count * sizeof (struct GNUNET_ATS_Information));
aa->peer = *peer;
aa->addr_len = plugin_addr_len;
aa->ats_count = atsi_count;
- memcpy (aa->ats, atsi, atsi_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ memcpy (aa->ats, atsi, atsi_count * sizeof (struct GNUNET_ATS_Information));
aa->addr = &aa[1];
memcpy (&aa[1], plugin_addr, plugin_addr_len);
aa->plugin = GNUNET_strdup (plugin_name);
#define GNUNET_SERVICE_ATS_ADDRESSES_H
#include "gnunet_util_lib.h"
-#include "gnunet_transport_service.h" // FIXME...
#include "gnunet_ats_service.h"
#include "ats.h"
const void *plugin_addr, size_t plugin_addr_len,
struct GNUNET_SERVER_Client *session_client,
uint32_t session_id,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count);
struct ATS_Handle *
ats_init (double D, double U, double R, int v_b_min, int v_n_min,
int max_iterations, struct GNUNET_TIME_Relative max_duration,
- GNUNET_TRANSPORT_ATS_AddressNotification address_not,
- GNUNET_TRANSPORT_ATS_ResultCallback res_cb)
+ GNUNET_ATS_AddressNotification address_not,
+ GNUNET_ATS_ResultCallback res_cb)
{
struct ATS_Handle *ats = NULL;
{
ia[array_index] = row_index;
ja[array_index] = c2;
- if (qm[c - 1].atis_index == GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY)
+ if (qm[c - 1].atis_index == GNUNET_ATS_QUALITY_NET_DELAY)
{
double v0 = 0, v1 = 0, v2 = 0;
value = 100.0 / ((v0 + 2 * v1 + 3 * v2) / 6.0);
value = 1;
}
- if (qm[c - 1].atis_index == GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE)
+ if (qm[c - 1].atis_index == GNUNET_ATS_QUALITY_NET_DISTANCE)
{
double v0 = 0, v1 = 0, v2 = 0;
GNUNET_assert (ats->mechanisms[c2].addr != NULL);
GNUNET_assert (ats->mechanisms[c2].peer != NULL);
- if (qm[c - 1].atis_index == GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY)
+ if (qm[c - 1].atis_index == GNUNET_ATS_QUALITY_NET_DELAY)
{
double v0 = 0, v1 = 0, v2 = 0;
value = 100.0 / ((v0 + 2 * v1 + 3 * v2) / 6.0);
//value = 1;
}
- if (qm[c - 1].atis_index == GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE)
+ if (qm[c - 1].atis_index == GNUNET_ATS_QUALITY_NET_DISTANCE)
{
double v0 = 0, v1 = 0, v2 = 0;
struct ATS_mechanism;
struct ATS_peer;
-typedef void (*GNUNET_TRANSPORT_ATS_AddressNotification) (struct ATS_peer **
+typedef void (*GNUNET_ATS_AddressNotification) (struct ATS_peer **
peers, int *c_p,
struct ATS_mechanism
** mechanisms,
int *c_m);
-typedef void (*GNUNET_TRANSPORT_ATS_ResultCallback) (void);
+typedef void (*GNUNET_ATS_ResultCallback) (void);
enum ATS_problem_state
{
* Callback functions
*/
- GNUNET_TRANSPORT_ATS_AddressNotification addr_notification;
+ GNUNET_ATS_AddressNotification addr_notification;
- GNUNET_TRANSPORT_ATS_ResultCallback result_cb;
+ GNUNET_ATS_ResultCallback result_cb;
/**
struct ATS_Handle *
ats_init (double D, double U, double R, int v_b_min, int v_n_min,
int max_iterations, struct GNUNET_TIME_Relative max_duration,
- GNUNET_TRANSPORT_ATS_AddressNotification address_not,
- GNUNET_TRANSPORT_ATS_ResultCallback res_cb);
+ GNUNET_ATS_AddressNotification address_not,
+ GNUNET_ATS_ResultCallback res_cb);
void
ats_shutdown (struct ATS_Handle *ats);
GAS_performance_notify_clients (const struct GNUNET_PeerIdentity *peer,
const char *plugin_name,
const void *plugin_addr, size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
struct PerformanceClient *pc;
struct PeerInformationMessage *msg;
size_t plugin_name_length = strlen (plugin_name) + 1;
- size_t msize = sizeof (struct PeerInformationMessage) + atsi_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)
+ size_t msize = sizeof (struct PeerInformationMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information)
+ plugin_addr_len + plugin_name_length;
char buf[msize];
- struct GNUNET_TRANSPORT_ATS_Information *atsp;
+ struct GNUNET_ATS_Information *atsp;
char *addrp;
GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE);
- GNUNET_assert (atsi_count < GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ GNUNET_assert (atsi_count < GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information));
msg = (struct PeerInformationMessage*) buf;
msg->header.size = htons (msize);
msg->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_PEER_INFORMATION);
msg->plugin_name_length = htons (plugin_name_length);
msg->bandwidth_out = bandwidth_out;
msg->bandwidth_in = bandwidth_in;
- atsp = (struct GNUNET_TRANSPORT_ATS_Information* ) &msg[1];
- memcpy (atsp, atsi, sizeof (struct GNUNET_TRANSPORT_ATS_Information) * atsi_count);
+ atsp = (struct GNUNET_ATS_Information* ) &msg[1];
+ memcpy (atsp, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count);
addrp = (char*) &atsp[atsi_count];
memcpy (addrp, plugin_addr, plugin_addr_len);
strcpy (&addrp[plugin_addr_len], plugin_name);
#define GNUNET_SERVICE_ATS_PERFORMANCE_H
#include "gnunet_util_lib.h"
-#include "gnunet_transport_service.h" // FIXME
+#include "gnunet_ats_service.h"
#include "ats.h"
/**
GAS_performance_notify_clients (const struct GNUNET_PeerIdentity *peer,
const char *plugin_name,
const void *plugin_addr, size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
const void *plugin_addr, size_t plugin_addr_len,
struct GNUNET_SERVER_Client *session_client,
uint32_t session_id,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
struct SchedulingClient *sc;
struct AddressSuggestionMessage *msg;
size_t plugin_name_length = strlen (plugin_name) + 1;
- size_t msize = sizeof (struct AddressSuggestionMessage) + atsi_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)
+ size_t msize = sizeof (struct AddressSuggestionMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information)
+ plugin_addr_len + plugin_name_length;
char buf[msize];
- struct GNUNET_TRANSPORT_ATS_Information *atsp;
+ struct GNUNET_ATS_Information *atsp;
char *addrp;
GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE);
- GNUNET_assert (atsi_count < GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ GNUNET_assert (atsi_count < GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information));
msg = (struct AddressSuggestionMessage*) buf;
msg->header.size = htons (msize);
msg->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_ADDRESS_SUGGESTION);
/* session ID is set only if 'client' is the same... */
msg->bandwidth_out = bandwidth_out;
msg->bandwidth_in = bandwidth_in;
- atsp = (struct GNUNET_TRANSPORT_ATS_Information* ) &msg[1];
- memcpy (atsp, atsi, sizeof (struct GNUNET_TRANSPORT_ATS_Information) * atsi_count);
+ atsp = (struct GNUNET_ATS_Information* ) &msg[1];
+ memcpy (atsp, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count);
addrp = (char*) &atsp[atsi_count];
memcpy (addrp, plugin_addr, plugin_addr_len);
strcpy (&addrp[plugin_addr_len], plugin_name);
{
const struct AddressUpdateMessage * m;
- const struct GNUNET_TRANSPORT_ATS_Information *atsi;
+ const struct GNUNET_ATS_Information *atsi;
const char *address;
const char *plugin_name;
uint16_t address_length;
ats_count = ntohl (m->ats_count);
address_length = ntohs (m->address_length);
plugin_name_length = ntohs (m->plugin_name_length);
- atsi = (const struct GNUNET_TRANSPORT_ATS_Information*) &m[1];
+ atsi = (const struct GNUNET_ATS_Information*) &m[1];
address = (const char*) &atsi[ats_count];
if (plugin_name_length != 0)
plugin_name = &address[address_length];
plugin_name = "";
if ( (address_length +
plugin_name_length +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) +
+ ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct AddressUpdateMessage) != ntohs (message->size)) ||
- (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_TRANSPORT_ATS_Information)) ||
+ (ats_count > GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) ||
(plugin_name[plugin_name_length - 1] != '\0') )
{
GNUNET_break (0);
const void *plugin_addr, size_t plugin_addr_len,
struct GNUNET_SERVER_Client *session_client,
uint32_t session_id,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
void * addr;
size_t addr_len;
- struct GNUNET_TRANSPORT_ATS_Information * ats;
+ struct GNUNET_ATS_Information * ats;
int ats_count;
void *session;
GNUNET_BANDWIDTH_Value32NBO
bandwidth_in,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats,
uint32_t ats_count)
{
GNUNET_BANDWIDTH_Value32NBO
bandwidth_in,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats,
uint32_t ats_count)
void * addr;
size_t addr_len;
- struct GNUNET_TRANSPORT_ATS_Information * ats;
+ struct GNUNET_ATS_Information * ats;
int ats_count;
void *session;
struct Address addr[2];
struct PeerContext p[2];
-struct GNUNET_TRANSPORT_ATS_Information atsi[2];
+struct GNUNET_ATS_Information atsi[2];
static void
stop_arm ()
GNUNET_BANDWIDTH_Value32NBO
bandwidth_in,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats,
uint32_t ats_count)
/**
* Performance information associated with this address (array).
*/
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
/**
* Name of the plugin
const char *plugin_name, const void *plugin_addr,
size_t plugin_addr_len, struct Session *session,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct ExpectedValues *ex = cls;
ar->session = NULL;
ar->plugin_addr = "address1";
ar->plugin_addr_len = strlen (ar->plugin_addr) + 1;
- ar->ats = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ ar->ats = GNUNET_malloc (sizeof (struct GNUNET_ATS_Information));
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Initial ATS information\n");
ar->ats_count = 1;
handle_p2p_join_notification (void *cls,
const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
const struct P2PJoinNotificationMessage *p2p_jnmsg;
handle_p2p_leave_notification (void *cls,
const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
const struct P2PLeaveNotificationMessage *p2p_lnmsg;
handle_p2p_message_notification (void *cls,
const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
const struct P2PReceiveNotificationMessage *p2p_rnmsg;
static int
handle_p2p_sync_request (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct ChatClient *entry;
struct GNUNET_CORE_TransmitHandle *th;
handle_p2p_confirmation_receipt (void *cls,
const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
const struct P2PConfirmationReceiptMessage *p2p_crmsg;
*/
static void
peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct ConnectedPeer *cp;
struct GNUNET_CORE_TransmitHandle *th;
* First of the ATS information blocks (we must have at least
* one due to the 0-termination requirement).
*/
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
};
* First of the ATS information blocks (we must have at least
* one due to the 0-termination requirement).
*/
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
};
* First of the ATS information blocks (we must have at least
* one due to the 0-termination requirement).
*/
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
};
ats_count = ntohl (cnm->ats_count);
if ((msize !=
sizeof (struct ConnectNotifyMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)) ||
- (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR !=
+ ats_count * sizeof (struct GNUNET_ATS_Information)) ||
+ (GNUNET_ATS_ARRAY_TERMINATOR !=
ntohl ((&cnm->ats)[ats_count].type)))
{
GNUNET_break (0);
ats_count = ntohl (ntm->ats_count);
if ((msize <
sizeof (struct NotifyTrafficMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) +
+ ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct GNUNET_MessageHeader)) ||
- (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR !=
+ (GNUNET_ATS_ARRAY_TERMINATOR !=
ntohl ((&ntm->ats)[ats_count].type)))
{
GNUNET_break (0);
if ((GNUNET_NO == h->inbound_hdr_only) &&
(msize !=
ntohs (em->size) + sizeof (struct NotifyTrafficMessage) +
- +ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)))
+ +ats_count * sizeof (struct GNUNET_ATS_Information)))
{
GNUNET_break (0);
reconnect_later (h);
ats_count = ntohl (ntm->ats_count);
if ((msize <
sizeof (struct NotifyTrafficMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) +
+ ats_count * sizeof (struct GNUNET_ATS_Information) +
sizeof (struct GNUNET_MessageHeader)) ||
- (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR !=
+ (GNUNET_ATS_ARRAY_TERMINATOR !=
ntohl ((&ntm->ats)[ats_count].type)))
{
GNUNET_break (0);
if ((GNUNET_NO == h->outbound_hdr_only) &&
(msize !=
ntohs (em->size) + sizeof (struct NotifyTrafficMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)))
+ ats_count * sizeof (struct GNUNET_ATS_Information)))
{
GNUNET_break (0);
reconnect_later (h);
ats_count = ntohl (connect_message->ats_count);
if ((msize !=
sizeof (struct ConnectNotifyMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)) ||
- (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR !=
+ ats_count * sizeof (struct GNUNET_ATS_Information)) ||
+ (GNUNET_ATS_ARRAY_TERMINATOR !=
ntohl ((&connect_message->ats)[ats_count].type)))
{
GNUNET_break (0);
*/
static void
connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct PrintContext *pc;
/**
* Performance data for the peer.
*/
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
/**
* Identity of the neighbour.
{
struct PeerStatusNotifyMessage *psnm;
char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
size_t size;
if ((!n->is_connected) || (n->status != PEER_STATE_KEY_CONFIRMED))
#endif
size =
sizeof (struct PeerStatusNotifyMessage) +
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_ATS_Information);
if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
GNUNET_array_grow (n->ats, n->ats_count, 0);
size =
sizeof (struct PeerStatusNotifyMessage) +
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_ATS_Information);
}
psnm = (struct PeerStatusNotifyMessage *) buf;
psnm->header.size = htons (size);
psnm->ats_count = htonl (n->ats_count);
ats = &psnm->ats;
memcpy (ats, n->ats,
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ n->ats_count * sizeof (struct GNUNET_ATS_Information));
ats[n->ats_count].type = htonl (0);
ats[n->ats_count].value = htonl (0);
send_to_all_clients (&psnm->header, GNUNET_YES,
struct Neighbour *n = value;
size_t size;
char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
struct ConnectNotifyMessage *cnm;
size =
sizeof (struct ConnectNotifyMessage) +
- (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (n->ats_count) * sizeof (struct GNUNET_ATS_Information);
if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
GNUNET_array_grow (n->ats, n->ats_count, 0);
size =
sizeof (struct ConnectNotifyMessage) +
- (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (n->ats_count) * sizeof (struct GNUNET_ATS_Information);
}
cnm = (struct ConnectNotifyMessage *) buf;
cnm->header.size = htons (size);
cnm->ats_count = htonl (n->ats_count);
ats = &cnm->ats;
memcpy (ats, n->ats,
- sizeof (struct GNUNET_TRANSPORT_ATS_Information) * n->ats_count);
- ats[n->ats_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ sizeof (struct GNUNET_ATS_Information) * n->ats_count);
+ ats[n->ats_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
ats[n->ats_count].value = htonl (0);
if (n->status == PEER_STATE_KEY_CONFIRMED)
{
struct GNUNET_SERVER_TransmitContext *tc = cls;
struct Neighbour *n = value;
char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
size_t size;
struct ConnectNotifyMessage *cnm;
return GNUNET_OK;
size =
sizeof (struct ConnectNotifyMessage) +
- (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (n->ats_count) * sizeof (struct GNUNET_ATS_Information);
if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
GNUNET_array_grow (n->ats, n->ats_count, 0);
size =
sizeof (struct PeerStatusNotifyMessage) +
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_ATS_Information);
}
cnm = (struct ConnectNotifyMessage *) buf;
cnm->header.size = htons (size);
cnm->ats_count = htonl (n->ats_count);
ats = &cnm->ats;
memcpy (ats, n->ats,
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
- ats[n->ats_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ n->ats_count * sizeof (struct GNUNET_ATS_Information));
+ ats[n->ats_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
ats[n->ats_count].value = htonl (0);
#if DEBUG_CORE_CLIENT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n",
*/
static void
handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count);
*/
static void
update_neighbour_performance (struct Neighbour *n,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count)
{
uint32_t i;
*/
static void
handle_ping (struct Neighbour *n, const struct PingMessage *m,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct PingMessage t;
*/
static void
handle_pong (struct Neighbour *n, const struct PongMessage *m,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct PongMessage t;
struct ConnectNotifyMessage *cnm;
struct GNUNET_CRYPTO_AesInitializationVector iv;
char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
- struct GNUNET_TRANSPORT_ATS_Information *mats;
+ struct GNUNET_ATS_Information *mats;
size_t size;
#if DEBUG_HANDSHAKE
update_neighbour_performance (n, ats, ats_count);
size =
sizeof (struct ConnectNotifyMessage) +
- (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (n->ats_count) * sizeof (struct GNUNET_ATS_Information);
if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
GNUNET_array_grow (n->ats, n->ats_count, 0);
size =
sizeof (struct PeerStatusNotifyMessage) +
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ n->ats_count * sizeof (struct GNUNET_ATS_Information);
}
cnm = (struct ConnectNotifyMessage *) buf;
cnm->header.size = htons (size);
cnm->peer = n->peer;
mats = &cnm->ats;
memcpy (mats, n->ats,
- n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
- mats[n->ats_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ n->ats_count * sizeof (struct GNUNET_ATS_Information));
+ mats[n->ats_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
mats[n->ats_count].value = htonl (0);
send_to_all_clients (&cnm->header, GNUNET_NO,
GNUNET_CORE_OPTION_SEND_CONNECT);
*/
static void
handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct SetKeyMessage *m_cpy;
{
size_t size =
msize + sizeof (struct NotifyTrafficMessage) +
- (sender->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (sender->ats_count) * sizeof (struct GNUNET_ATS_Information);
char buf[size];
struct NotifyTrafficMessage *ntm;
- struct GNUNET_TRANSPORT_ATS_Information *ats;
+ struct GNUNET_ATS_Information *ats;
GNUNET_assert (GNUNET_YES == sender->is_connected);
GNUNET_break (sender->status == PEER_STATE_KEY_CONFIRMED);
GNUNET_array_grow (sender->ats, sender->ats_count, 0);
size =
msize + sizeof (struct NotifyTrafficMessage) +
- (sender->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (sender->ats_count) * sizeof (struct GNUNET_ATS_Information);
}
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
ntm->peer = sender->peer;
ats = &ntm->ats;
memcpy (ats, sender->ats,
- sizeof (struct GNUNET_TRANSPORT_ATS_Information) * sender->ats_count);
- ats[sender->ats_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ sizeof (struct GNUNET_ATS_Information) * sender->ats_count);
+ ats[sender->ats_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
ats[sender->ats_count].value = htonl (0);
memcpy (&ats[sender->ats_count + 1], m, msize);
send_to_client (client, &ntm->header, GNUNET_YES);
*/
static void
handle_encrypted_message (struct Neighbour *n, const struct EncryptedMessage *m,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
size_t size = ntohs (m->header.size);
static void
handle_transport_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct Neighbour *n;
static void
handle_transport_notify_connect (void *cls,
const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count)
{
struct Neighbour *n;
void
GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
const struct GNUNET_PeerIdentity *neighbour,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count,
const struct GSC_TypeMap *tmap_old,
const struct GSC_TypeMap *tmap_new)
struct ConnectNotifyMessage *cnm;
size_t size;
char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
- struct GNUNET_TRANSPORT_ATS_Information *a;
+ struct GNUNET_ATS_Information *a;
struct DisconnectNotifyMessage dcm;
int old_match;
int new_match;
/* send connect */
size =
sizeof (struct ConnectNotifyMessage) +
- (atsi_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ (atsi_count) * sizeof (struct GNUNET_ATS_Information);
if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
cnm->ats_count = htonl (atsi_count);
a = &cnm->ats;
memcpy (a, atsi,
- sizeof (struct GNUNET_TRANSPORT_ATS_Information) * atsi_count);
- a[atsi_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ sizeof (struct GNUNET_ATS_Information) * atsi_count);
+ a[atsi_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
a[atsi_count].value = htonl (0);
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
*/
void
GSC_CLIENTS_notify_clients_about_neighbour (const struct GNUNET_PeerIdentity *neighbour,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count,
const struct GSC_TypeMap *tmap_old,
const struct GSC_TypeMap *tmap_new)
*/
void
GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count,
const struct GNUNET_MessageHeader *msg,
uint16_t msize,
int options)
{
size_t size = msize + sizeof (struct NotifyTrafficMessage) +
- atsi_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ atsi_count * sizeof (struct GNUNET_ATS_Information);
char buf[size];
struct NotifyTrafficMessage *ntm;
- struct GNUNET_TRANSPORT_ATS_Information *a;
+ struct GNUNET_ATS_Information *a;
if (0 == options)
{
ntm->peer = *sender;
a = &ntm->ats;
memcpy (a, atsi,
- sizeof (struct GNUNET_TRANSPORT_ATS_Information) * atsi_count);
- a[atsi_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ sizeof (struct GNUNET_ATS_Information) * atsi_count);
+ a[atsi_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
a[atsi_count].value = htonl (0);
memcpy (&a[atsi_count + 1], msg, msize);
send_to_all_clients (&ntm->header, GNUNET_YES,
void
GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
const struct GNUNET_PeerIdentity *neighbour,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count,
const struct GSC_TypeMap *tmap_old,
const struct GSC_TypeMap *tmap_new);
*/
void
GSC_CLIENTS_notify_clients_about_neighbour (const struct GNUNET_PeerIdentity *neighbour,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count,
const struct GSC_TypeMap *tmap_old,
const struct GSC_TypeMap *tmap_new);
*/
void
GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count,
const struct GNUNET_MessageHeader *msg,
uint16_t msize,
/**
* Performance information for the connection.
*/
- const struct GNUNET_TRANSPORT_ATS_Information *atsi;
+ const struct GNUNET_ATS_Information *atsi;
/**
* Sender of the message.
void
GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx,
const struct GNUNET_MessageHeader *msg,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count)
{
const struct EncryptedMessage *m;
void
GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx,
const struct GNUNET_MessageHeader *msg,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi,
+ const struct GNUNET_ATS_Information *atsi,
uint32_t atsi_count);
static void
handle_transport_notify_connect (void *cls,
const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count)
{
struct Neighbour *n;
static void
handle_transport_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct Neighbour *n;
struct GNUNET_SERVER_TransmitContext *tc = cls;
struct Session *session = value;
struct ConnectNotifyMessage cnm;
- struct GNUNET_TRANSPORT_ATS_Information *a;
+ struct GNUNET_ATS_Information *a;
/* FIXME: code duplication with clients... */
cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
cnm.peer = session->peer;
a = &cnm.ats;
// FIXME: full ats...
- a[0].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ a[0].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
a[0].value = htonl (0);
GNUNET_SERVER_transmit_context_append_message (tc, &cnm.header);
return GNUNET_OK;
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct PeerContext *pc = cls;
static int
inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Core provides inbound data from `%4s'.\n", GNUNET_i2s (other));
static int
outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Core notifies about outbound data for `%4s'.\n",
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving message from `%4s'.\n",
GNUNET_i2s (peer));
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct PeerContext *pc = cls;
static int
inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static int
outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
static int n;
unsigned int s;
static int
receive (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
if (die_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (die_task);
static void
connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s.\n",
GNUNET_i2s (peer));
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
}
static int
inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
return GNUNET_OK;
}
static int
outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
return GNUNET_OK;
}
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct PeerContext *pc = cls;
static int
inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static int
outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
#if DEBUG_TRANSMISSION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
static int n;
const struct TestMessage *hdr;
*/
static void
handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct PeerInfo *ret;
int peer_bucket;
handle_dht_p2p_put (void *cls,
const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
const struct PeerPutMessage *put;
static int
handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
struct PeerGetMessage *get;
static int
handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
const struct PeerResultMessage *prm;
* @return connected transport distance
*/
static uint32_t
-get_atsi_distance (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+get_atsi_distance (const struct GNUNET_ATS_Information *atsi)
{
- while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) &&
- (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE))
+ while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
+ (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DISTANCE))
atsi++;
- if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR)
+ if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
{
GNUNET_break (0);
/* FIXME: we do not have distance data? Assume direct neighbor. */
* @return connection latency
*/
static struct GNUNET_TIME_Relative
-get_atsi_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+get_atsi_latency (const struct GNUNET_ATS_Information *atsi)
{
- while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) &&
- (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY))
+ while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
+ (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DELAY))
atsi++;
- if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR)
+ if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
{
GNUNET_break (0);
/* how can we not have latency data? */
static int
handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
const p2p_dv_MESSAGE_Data *incoming = (const p2p_dv_MESSAGE_Data *) message;
const struct GNUNET_MessageHeader *packed_message;
static int
handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi);
+ const struct GNUNET_ATS_Information *atsi);
static int
handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi);
/** End forward declarations **/
"%s: learned about peer %llu from which we have a previous unknown message, processing!\n",
my_short_id, referrer_peer_id);
#endif
- struct GNUNET_TRANSPORT_ATS_Information atsi[3];
+ struct GNUNET_ATS_Information atsi[3];
- atsi[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
atsi[0].value = htonl (referrer->pending_messages[i].distance);
- atsi[1].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY);
+ atsi[1].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
atsi[1].value =
htonl ((uint32_t) referrer->pending_messages[i].
latency.rel_value);
- atsi[2].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ atsi[2].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
atsi[2].value = htonl (0);
handle_dv_data_message (NULL, &referrer->pending_messages[i].sender,
referrer->pending_messages[i].message,
- (const struct GNUNET_TRANSPORT_ATS_Information
+ (const struct GNUNET_ATS_Information
*) &atsi);
GNUNET_free (referrer->pending_messages[i].message);
referrer->pending_messages[i].sender_id = 0;
static int
handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
struct DirectNeighbor *referrer;
static int
handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct DirectNeighbor *referrer;
p2p_dv_MESSAGE_NeighborInfo *enc_message =
*/
static void
handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct DirectNeighbor *neighbor;
struct DistantNeighbor *about;
distance);
GNUNET_free_non_null (my_id);
#endif
- struct GNUNET_TRANSPORT_ATS_Information ats[2];
+ struct GNUNET_ATS_Information ats[2];
- ats[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
ats[0].value = htonl (distance);
- ats[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
+ ats[1].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
ats[1].value = htonl (0);
plugin->env->receive (plugin->env->cls, sender,
(struct GNUNET_MessageHeader *) msg,
- (const struct GNUNET_TRANSPORT_ATS_Information *) &ats,
+ (const struct GNUNET_ATS_Information *) &ats,
2, NULL, sender_address, sender_address_len);
}
* @return connected transport distance
*/
static uint32_t
-get_atsi_distance (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+get_atsi_distance (const struct GNUNET_ATS_Information *atsi)
{
- while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) &&
- (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE))
+ while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
+ (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DISTANCE))
atsi++;
- if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR)
+ if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
{
GNUNET_break (0);
/* FIXME: we do not have distance data? Assume direct neighbor. */
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct TestMessageContext *pos = cls;
struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *) message;
*/
static void
connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct TestMessageContext *pos = cls;
*/
static void
connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct TestMessageContext *pos = cls;
*/
static void
all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_TESTING_Daemon *d = cls;
struct GNUNET_TESTING_Daemon *second_daemon;
static int
handle_p2p_put (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GSF_ConnectedPeer *cp;
static int
handle_p2p_get (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GSF_PendingRequest *pr;
*/
static void
peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GSF_ConnectedPeer *cp;
* @return connection latency
*/
static struct GNUNET_TIME_Relative
-get_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+get_latency (const struct GNUNET_ATS_Information *atsi)
{
if (atsi == NULL)
return GNUNET_TIME_UNIT_SECONDS;
- while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) &&
- (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY))
+ while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
+ (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DELAY))
atsi++;
- if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR)
+ if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
{
/* We sometime have no latency data, i.e. if the address came from
peerinfo and we never had a chance to play transport-level
*/
static void
update_atsi (struct GSF_ConnectedPeer *cp,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_TIME_Relative latency;
*/
struct GSF_ConnectedPeer *
GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GSF_ConnectedPeer *cp;
char *fn;
GSF_handle_p2p_migration_stop_ (void *cls,
const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi)
{
struct GSF_ConnectedPeer *cp;
/**
* Transport performance data.
*/
- struct GNUNET_TRANSPORT_ATS_Information *atsi;
+ struct GNUNET_ATS_Information *atsi;
/**
* List of the last clients for which this peer successfully
*/
struct GSF_ConnectedPeer *
GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi);
+ const struct GNUNET_ATS_Information *atsi);
/**
GSF_handle_p2p_migration_stop_ (void *cls,
const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*atsi);
static int
advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_assert (NULL != client_adv_handler);
return (*client_adv_handler) (cls, peer, message, atsi);
*/
static void
connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity)))
return;
*/
static void
handler_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_assert (stat_connection_count < UINT_MAX);
stat_connection_count++;
static int
handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
size_t size;
size_t uri_size;
*/
static void
connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
size_t size;
*/
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
if (peer == NULL)
static int
ad_arrive_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
char *hostname;
char *expected_uri;
*/
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
if (peer == NULL)
* @brief automatic transport selection and outbound bandwidth determination
* @author Christian Grothoff
* @author Matthias Wachs
- *
- * TODO:
- * - move GNUNET_TRANSPORT_ATS* in here and rename...
*/
#ifndef GNUNET_ATS_SERVICE_H
#define GNUNET_ATS_SERVICE_H
#include "gnunet_constants.h"
#include "gnunet_util_lib.h"
-#include "gnunet_transport_service.h"
-#include "gnunet_transport_plugin.h"
+
+
+/**
+ * Enum defining all known property types for ATS Enum values are used
+ * in the GNUNET_ATS_Information struct as
+ * (key,value)-pairs.
+ *
+ * Cost are always stored in uint32_t, so all units used to define costs
+ * have to be normalized to fit in uint32_t [0 .. 4.294.967.295]
+ */
+enum GNUNET_ATS_Property
+{
+
+ /**
+ * End of the array.
+ * @deprecated
+ */
+ GNUNET_ATS_ARRAY_TERMINATOR = 0,
+
+ /**
+ * Actual traffic on this connection from the other peer to this peer.
+ *
+ * Unit: [bytes/second]
+ */
+ GNUNET_ATS_UTILIZATION_UP,
+
+ /**
+ * Actual traffic on this connection from this peer to the other peer.
+ *
+ * Unit: [bytes/second]
+ */
+ GNUNET_ATS_UTILIZATION_DOWN,
+
+ /**
+ * Delay
+ * Time between when the time packet is sent and the packet arrives
+ *
+ * Unit: [ms]
+ *
+ * Examples:
+ *
+ * LAN : 1
+ * WLAN : 2
+ * Dialup: 500
+ */
+ GNUNET_ATS_QUALITY_NET_DELAY,
+
+ /**
+ * Distance on network layer (required for distance-vector routing).
+ *
+ * Unit: [DV-hops]
+ */
+ GNUNET_ATS_QUALITY_NET_DISTANCE,
+
+ /**
+ * Network overhead on WAN (Wide-Area Network)
+ *
+ * How many bytes are sent on the WAN when 1 kilobyte (1024 bytes)
+ * of application data is transmitted?
+ * A factor used with connect cost, bandwidth cost and energy cost
+ * to describe the overhead produced by the transport protocol
+ *
+ * Unit: [bytes/kb]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
+ * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
+ * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
+ * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
+ */
+ GNUNET_ATS_COST_WAN,
+
+ /**
+ * Network overhead on LAN (Local-Area Network)
+ *
+ * How many bytes are sent on the LAN when 1 kilobyte (1024 bytes)
+ * of application data is transmitted?
+ * A factor used with connect cost, bandwidth cost and energy cost
+ * to describe the overhead produced by the transport protocol
+ *
+ * Unit: [bytes/kb]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
+ * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
+ * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
+ * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
+ */
+ GNUNET_ATS_COST_LAN,
+
+ /**
+ * Network overhead on WLAN (Wireless Local Area Network)
+ *
+ * How many bytes are sent on the LAN when 1 kilobyte (1024 bytes)
+ * of application data is transmitted?
+ * A factor used with connect cost, bandwidth cost and energy cost
+ * to describe the overhead produced by the transport protocol
+ *
+ * Unit: [bytes/kb]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
+ * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
+ * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
+ * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
+ */
+ GNUNET_ATS_COST_WLAN
+
+
+
+ /* Cost related values */
+ /* =================== */
+
+ /**
+ * Volume based cost in financial units to transmit data
+ *
+ * Note: This value is not bound to a specific currency or unit and only
+ * used locally.
+ * "cent" just refers the smallest amount of money in the respective
+ * currency.
+ *
+ * Unit: [cent/MB]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ * LAN: 0 [cent/MB]
+ * 2G : 10 [cent/MB]
+ */
+ // GNUNET_ATS_COST_FINANCIAL_PER_VOLUME = 1,
+
+ /**
+ * Time based cost in financial units to transmit data
+ *
+ * Note: This value is not bound to a specific currency or unit and only
+ * used locally.
+ * "cent" just refers the smallest amount of money in the respective
+ * currency.
+ *
+ * Unit: [cent/h]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ * LAN : 0 [cent/h]
+ * Dialup: 10 [cent/h]
+ */
+ // GNUNET_ATS_COST_FINANCIAL_PER_TIME = 2,
+
+ /**
+ * Computational costs
+ *
+ * Effort of preparing data to be sent with this transport
+ * Includes encoding, encryption and conversion of data
+ * Partial values can be summed up: c_sum = c_enc + c_enc + c_conv
+ * Resulting values depend on local system properties, e.g. CPU
+ *
+ * Unit: [ms/GB]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * HTTPS with AES CBC-256: 7,382
+ * HTTPS with AES CBC-128: 5,279
+ * HTTPS with RC4-1024: 2,652
+ */
+ // GNUNET_ATS_COST_COMPUTATIONAL = 3,
+
+ /**
+ * Energy consumption
+ *
+ * Energy consumption using this transport when sending with a certain
+ * power at a certain bitrate. This is only an approximation based on:
+ * Energy consumption E = P / D
+ *
+ * with:
+ * Power P in Watt (J/s)
+ * Datarate D in MBit/s
+ *
+ * Conversion between power P and dBm used by WLAN in radiotap's dBm TX power:
+ *
+ * Lp(dbm) = 10 log10 (P/ 1mW)
+ *
+ * => P = 1 mW * 10^(Lp(dbm)/10)
+ *
+ * Unit: [mJ/MB]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * LAN: 0
+ * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s)
+ * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s)
+ */
+ // GNUNET_ATS_COST_ENERGY_CONSUMPTION = 4,
+
+ /**
+ * Connect cost
+ * How many bytes are transmitted to initiate a new connection using
+ * this transport?
+ *
+ * Unit: [bytes]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * UDP (No connection) :
+ * 0 bytes
+ * TCP (TCP 3-Way handshake):
+ * 220 bytes Ethernet, 172 bytes TCP/IP, 122 bytes TCP
+ * HTTP (TCP + Header) :
+ * 477 bytes Ethernet, 429 bytes TCP/IP, 374 bytes TCP, 278 bytes HTTP
+ * HTTPS HTTP+TLS Handshake:
+ * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS
+ *
+ * */
+ // GNUNET_ATS_COST_CONNECT = 5,
+
+ /**
+ * Bandwidth cost
+ *
+ * How many bandwidth is available to consume?
+ * Used to calculate which impact sending data with this transport has
+ *
+ * Unit: [kB/s]
+ *
+ * Interpretation: more is better
+ *
+ * Examples:
+ * LAN: 12,800 (100 MBit/s)
+ * WLAN: 6,912 (54 MBit/s)
+ * Dial-up: 8 (64 Kbit/s)
+ *
+ */
+ // GNUNET_ATS_COST_BANDWITH_AVAILABLE = 6,
+
+ /**
+ * Network overhead
+ *
+ * How many bytes are sent over the wire when 1 kilobyte (1024 bytes)
+ * of application data is transmitted?
+ * A factor used with connect cost, bandwidth cost and energy cost
+ * to describe the overhead produced by the transport protocol
+ *
+ * Unit: [bytes/kb]
+ *
+ * Interpretation: less is better
+ *
+ * Examples:
+ *
+ * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
+ * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
+ * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
+ * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
+ */
+ // GNUNET_ATS_COST_NETWORK_OVERHEAD = 7,
+
+
+ /* Quality related values */
+ /* ====================== */
+
+ /* Physical layer quality properties */
+
+ /**
+ * Signal strength on physical layer
+ *
+ * Unit: [dBm]
+ */
+ // GNUNET_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025,
+
+ /**
+ * Collision rate on physical layer
+ *
+ * Unit: [B/s]
+ */
+ // GNUNET_ATS_QUALITY_PHY_COLLISION_RATE = 1026,
+
+ /**
+ * Error rate on physical layer
+ *
+ * Unit: [B/s]
+ */
+ // GNUNET_ATS_QUALITY_PHY_ERROR_RATE = 1027,
+
+ /**
+ * Jitter
+ * Time variations of the delay
+ * 1st derivative of a delay function
+ *
+ * Unit: [ms]
+ */
+ // GNUNET_ATS_QUALITY_NET_JITTER = 1029,
+
+ /**
+ * Error rate on network layer
+ *
+ * Unit: [B/s]
+ *
+ * Examples:
+ *
+ * LAN : 0
+ * WLAN : 400
+ * Bluetooth : 100
+ * Note: This numbers are just assumptions as an example, not
+ * measured or somehow determined
+ */
+ // GNUNET_ATS_QUALITY_NET_ERRORRATE = 1030,
+
+ /**
+ * Drop rate on network layer
+ * Bytes actively dismissed by a network component during transmission
+ * Reasons for dropped data can be full queues, congestion, quota violations...
+ *
+ * Unit: [B/s]
+ *
+ * Examples:
+ *
+ * LAN : 0
+ * WLAN : 400
+ * Bluetooth : 100
+ * Note: This numbers are just assumptions as an example, not
+ * measured or somehow determined
+ */
+ // GNUNET_ATS_QUALITY_NET_DROPRATE = 1031,
+
+ /**
+ * Loss rate on network layer
+ * Bytes lost during transmission
+ * Reasons can be collisions, ...
+ *
+ * Unit: [B/s]
+ *
+ * Examples:
+ *
+ * LAN : 0
+ * WLAN : 40
+ * Bluetooth : 10
+ * Note: This numbers are just assumptions as an example, not measured
+ * or somehow determined
+ */
+ // GNUNET_ATS_QUALITY_NET_LOSSRATE = 1032,
+
+ /**
+ * Throughput on network layer
+ *
+ * Unit: [kB/s]
+ *
+ * Examples:
+ *
+ * LAN : 3400
+ * WLAN : 1200
+ * Dialup: 4
+ *
+ */
+ // GNUNET_ATS_QUALITY_NET_THROUGHPUT = 1033,
+
+
+ /* Availability related values */
+ /* =========================== */
+
+ /**
+ * Is a peer reachable?
+ */
+ // GNUNET_ATS_AVAILABILITY_REACHABLE = 2048,
+
+ /**
+ * Is there a connection established to a peer using this transport
+ */
+ // GNUNET_ATS_AVAILABILITY_CONNECTED = 2049
+};
+
+
+/**
+ * struct used to communicate the transport's properties like cost and
+ * quality of service as well as high-level constraints on resource
+ * consumption.
+ *
+ * +---+
+ * +-----------+ Constraints | | Plugin properties +---------+
+ * | Highlevel |------------> |ATS| <------------------|Transport|
+ * | Component | ATS struct | | ATS struct | Plugin |
+ * +-----------+ | | +---------+
+ * +---+
+ *
+ * This structure will be used by transport plugins to communicate
+ * costs to ATS or by higher level components to tell ATS their
+ * constraints. Always a pair of (GNUNET_ATS_Property,
+ * uint32_t value). Value is always uint32_t, so all units used to
+ * define costs have to be normalized to fit uint32_t.
+ */
+struct GNUNET_ATS_Information
+{
+ /**
+ * ATS property type, in network byte order.
+ */
+ uint32_t type;
+
+ /**
+ * ATS property value, in network byte order.
+ */
+ uint32_t value;
+};
+
/* ******************************** Scheduling API ***************************** */
GNUNET_BANDWIDTH_Value32NBO
bandwidth_in,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats,
uint32_t ats_count);
const char *plugin_name,
const void *plugin_addr, size_t plugin_addr_len,
struct Session *session,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count);
GNUNET_BANDWIDTH_Value32NBO
bandwidth_in,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats,
uint32_t ats_count);
const struct
GNUNET_PeerIdentity * peer,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* atsi);
const struct GNUNET_MessageHeader *
message,
const struct
- GNUNET_TRANSPORT_ATS_Information *
+ GNUNET_ATS_Information *
atsi);
const struct GNUNET_MessageHeader *
message,
const struct
- GNUNET_TRANSPORT_ATS_Information *
+ GNUNET_ATS_Information *
atsi);
const struct
GNUNET_PeerIdentity * peer,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* atsi);
const struct GNUNET_MessageHeader *
message,
const struct
- GNUNET_TRANSPORT_ATS_Information *
+ GNUNET_ATS_Information *
atsi);
GNUNET_PeerIdentity
* initiator,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* atsi);
const struct GNUNET_PeerIdentity
* peer,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* atsi);
GNUNET_MessageHeader
* message,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats,
uint32_t
ats_count,
#endif
#endif
-#include "gnunet_bandwidth_lib.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_connection_lib.h"
-#include "gnunet_scheduler_lib.h"
-#include "gnunet_time_lib.h"
+#include "gnunet_util_lib.h"
+#include "gnunet_ats_service.h"
/**
* Version number of the transport API.
#define GNUNET_TRANSPORT_VERSION 0x00000000
-/**
- * Enum defining all known property types for ATS Enum values are used
- * in the GNUNET_TRANSPORT_ATS_Information struct as
- * (key,value)-pairs.
- *
- * Cost are always stored in uint32_t, so all units used to define costs
- * have to be normalized to fit in uint32_t [0 .. 4.294.967.295]
- *
- * To keep the elements ordered
- * 1..1024 : Values with a relation to cost
- * 1025..2048 : Values with a relation to quality
- * 2049..3072 : Values with a relation to availability
- *
- */
-enum GNUNET_TRANSPORT_ATS_Property
-{
-
- /**
- * End of the array.
- */
- GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR = 0,
-
- /* Cost related values */
- /* =================== */
-
- /**
- * Volume based cost in financial units to transmit data
- *
- * Note: This value is not bound to a specific currency or unit and only
- * used locally.
- * "cent" just refers the smallest amount of money in the respective
- * currency.
- *
- * Unit: [cent/MB]
- *
- * Interpretation: less is better
- *
- * Examples:
- * LAN: 0 [cent/MB]
- * 2G : 10 [cent/MB]
- */
- GNUNET_TRANSPORT_ATS_COST_FINANCIAL_PER_VOLUME = 1,
-
- /**
- * Time based cost in financial units to transmit data
- *
- * Note: This value is not bound to a specific currency or unit and only
- * used locally.
- * "cent" just refers the smallest amount of money in the respective
- * currency.
- *
- * Unit: [cent/h]
- *
- * Interpretation: less is better
- *
- * Examples:
- * LAN : 0 [cent/h]
- * Dialup: 10 [cent/h]
- */
- GNUNET_TRANSPORT_ATS_COST_FINANCIAL_PER_TIME = 2,
-
- /**
- * Computational costs
- *
- * Effort of preparing data to be sent with this transport
- * Includes encoding, encryption and conversion of data
- * Partial values can be summed up: c_sum = c_enc + c_enc + c_conv
- * Resulting values depend on local system properties, e.g. CPU
- *
- * Unit: [ms/GB]
- *
- * Interpretation: less is better
- *
- * Examples:
- *
- * HTTPS with AES CBC-256: 7,382
- * HTTPS with AES CBC-128: 5,279
- * HTTPS with RC4-1024: 2,652
- */
- GNUNET_TRANSPORT_ATS_COST_COMPUTATIONAL = 3,
-
- /**
- * Energy consumption
- *
- * Energy consumption using this transport when sending with a certain
- * power at a certain bitrate. This is only an approximation based on:
- * Energy consumption E = P / D
- *
- * with:
- * Power P in Watt (J/s)
- * Datarate D in MBit/s
- *
- * Conversion between power P and dBm used by WLAN in radiotap's dBm TX power:
- *
- * Lp(dbm) = 10 log10 (P/ 1mW)
- *
- * => P = 1 mW * 10^(Lp(dbm)/10)
- *
- * Unit: [mJ/MB]
- *
- * Interpretation: less is better
- *
- * Examples:
- *
- * LAN: 0
- * WLAN: 89 (600 mW @ 802.11g /w 54 MBit/s)
- * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s)
- */
- GNUNET_TRANSPORT_ATS_COST_ENERGY_CONSUMPTION = 4,
-
- /**
- * Connect cost
- * How many bytes are transmitted to initiate a new connection using
- * this transport?
- *
- * Unit: [bytes]
- *
- * Interpretation: less is better
- *
- * Examples:
- *
- * UDP (No connection) :
- * 0 bytes
- * TCP (TCP 3-Way handshake):
- * 220 bytes Ethernet, 172 bytes TCP/IP, 122 bytes TCP
- * HTTP (TCP + Header) :
- * 477 bytes Ethernet, 429 bytes TCP/IP, 374 bytes TCP, 278 bytes HTTP
- * HTTPS HTTP+TLS Handshake:
- * 2129 bytes Ethernet, 1975 bytes TCP/IP, 1755 bytes TCP, 1403 bytes HTTPS
- *
- * */
- GNUNET_TRANSPORT_ATS_COST_CONNECT = 5,
-
- /**
- * Bandwidth cost
- *
- * How many bandwidth is available to consume?
- * Used to calculate which impact sending data with this transport has
- *
- * Unit: [kB/s]
- *
- * Interpretation: more is better
- *
- * Examples:
- * LAN: 12,800 (100 MBit/s)
- * WLAN: 6,912 (54 MBit/s)
- * Dial-up: 8 (64 Kbit/s)
- *
- */
- GNUNET_TRANSPORT_ATS_COST_BANDWITH_AVAILABLE = 6,
-
- /**
- * Network overhead
- *
- * How many bytes are sent over the wire when 1 kilobyte (1024 bytes)
- * of application data is transmitted?
- * A factor used with connect cost, bandwidth cost and energy cost
- * to describe the overhead produced by the transport protocol
- *
- * Unit: [bytes/kb]
- *
- * Interpretation: less is better
- *
- * Examples:
- *
- * TCP/IPv4 over Ethernet: 1024 + 38 + 20 + 20 = 1102 [bytes/kb]
- * TCP/IPv6 over Ethernet: 1024 + 38 + 20 + 40 = 1122 [bytes/kb]
- * UDP/IPv4 over Ethernet: 1024 + 38 + 20 + 8 = 1090 [bytes/kb]
- * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb]
- */
- GNUNET_TRANSPORT_ATS_COST_NETWORK_OVERHEAD = 7,
-
-
- /* Quality related values */
- /* ====================== */
-
- /* Physical layer quality properties */
-
- /**
- * Signal strength on physical layer
- *
- * Unit: [dBm]
- */
- GNUNET_TRANSPORT_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025,
-
- /**
- * Collision rate on physical layer
- *
- * Unit: [B/s]
- */
- GNUNET_TRANSPORT_ATS_QUALITY_PHY_COLLISION_RATE = 1026,
-
- /**
- * Error rate on physical layer
- *
- * Unit: [B/s]
- */
- GNUNET_TRANSPORT_ATS_QUALITY_PHY_ERROR_RATE = 1027,
-
- /* Network layer quality properties */
-
- /**
- * Delay
- * Time between when the time packet is sent and the packet arrives
- *
- * Unit: [ms]
- *
- * Examples:
- *
- * LAN : 1
- * WLAN : 2
- * Dialup: 500
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY = 1028,
-
- /**
- * Jitter
- * Time variations of the delay
- * 1st derivative of a delay function
- *
- * Unit: [ms]
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_JITTER = 1029,
-
- /**
- * Error rate on network layer
- *
- * Unit: [B/s]
- *
- * Examples:
- *
- * LAN : 0
- * WLAN : 400
- * Bluetooth : 100
- * Note: This numbers are just assumptions as an example, not
- * measured or somehow determined
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_ERRORRATE = 1030,
-
- /**
- * Drop rate on network layer
- * Bytes actively dismissed by a network component during transmission
- * Reasons for dropped data can be full queues, congestion, quota violations...
- *
- * Unit: [B/s]
- *
- * Examples:
- *
- * LAN : 0
- * WLAN : 400
- * Bluetooth : 100
- * Note: This numbers are just assumptions as an example, not
- * measured or somehow determined
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_DROPRATE = 1031,
-
- /**
- * Loss rate on network layer
- * Bytes lost during transmission
- * Reasons can be collisions, ...
- *
- * Unit: [B/s]
- *
- * Examples:
- *
- * LAN : 0
- * WLAN : 40
- * Bluetooth : 10
- * Note: This numbers are just assumptions as an example, not measured
- * or somehow determined
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_LOSSRATE = 1032,
-
- /**
- * Throughput on network layer
- *
- * Unit: [kB/s]
- *
- * Examples:
- *
- * LAN : 3400
- * WLAN : 1200
- * Dialup: 4
- *
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_THROUGHPUT = 1033,
-
- /**
- * Distance on network layer
- *
- * Unit: []
- */
- GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE = 1034,
-
-
- /* Availability related values */
- /* =========================== */
-
- /**
- * Is a peer reachable?
- */
- GNUNET_TRANSPORT_ATS_AVAILABILITY_REACHABLE = 2048,
-
- /**
- * Is there a connection established to a peer using this transport
- */
- GNUNET_TRANSPORT_ATS_AVAILABILITY_CONNECTED = 2049
-};
-
-
-/**
- * struct used to communicate the transport's properties like cost and
- * quality of service as well as high-level constraints on resource
- * consumption.
- *
- * +---+
- * +-----------+ Constraints | | Plugin properties +---------+
- * | Highlevel |------------> |ATS| <------------------|Transport|
- * | Component | ATS struct | | ATS struct | Plugin |
- * +-----------+ | | +---------+
- * +---+
- *
- * This structure will be used by transport plugins to communicate
- * costs to ATS or by higher level components to tell ATS their
- * constraints. Always a pair of (GNUNET_TRANSPORT_ATS_Property,
- * uint32_t value). Value is always uint32_t, so all units used to
- * define costs have to be normalized to fit uint32_t.
- */
-struct GNUNET_TRANSPORT_ATS_Information
-{
- /**
- * ATS property type, in network byte order.
- */
- uint32_t type;
-
- /**
- * ATS property value, in network byte order.
- */
- uint32_t value;
-};
-
-
-
/**
* Function called by the transport for each received message.
*
GNUNET_MessageHeader *
message,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats, uint32_t ats_count);
const struct GNUNET_PeerIdentity
* peer,
const struct
- GNUNET_TRANSPORT_ATS_Information
+ GNUNET_ATS_Information
* ats, uint32_t ats_count);
/**
static int
handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
unsigned int own_pos;
uint16_t size;
static int
handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_Unicast *msg;
struct MeshTunnel *t;
static int
handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_Multicast *msg;
struct GNUNET_PeerIdentity *id;
static int
handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_ToOrigin *msg;
struct GNUNET_PeerIdentity id;
static int
handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_PathACK *msg;
struct GNUNET_PeerIdentity id;
*/
static void
core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct MeshPeerInfo *peer_info;
struct MeshPeerPath *path;
/* list of application-types */
struct type_list_element *type_head, *type_tail;
- struct GNUNET_TRANSPORT_ATS_Information atsi;
+ struct GNUNET_ATS_Information atsi;
struct peer_list_element *next, *prev;
/* The handle that sends the hellos to this peer */
*/
static void
core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_Handle *handle = cls;
if (NULL != atsi)
memcpy (&element->atsi, atsi,
- sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ sizeof (struct GNUNET_ATS_Information));
GNUNET_CONTAINER_DLL_insert_after (handle->connected_peers.head,
handle->connected_peers.tail,
static int
receive_hello (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_Handle *handle = cls;
uint16_t *num = (uint16_t *) (message + 1);
static int
core_receive (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_MESH_Handle *handle = cls;
struct tunnel_message *tmessage = (struct tunnel_message *) message;
const struct GNUNET_MESH_TunnelNotification *msg)
{
struct GNUNET_MESH_Tunnel *t;
- struct GNUNET_TRANSPORT_ATS_Information atsi;
+ struct GNUNET_ATS_Information atsi;
MESH_TunnelNumber tid;
tid = ntohl (msg->tunnel_id);
{
struct GNUNET_MESH_Tunnel *t;
struct GNUNET_MESH_Peer *p;
- struct GNUNET_TRANSPORT_ATS_Information atsi;
+ struct GNUNET_ATS_Information atsi;
GNUNET_PEER_Id id;
uint16_t size;
handler = &h->message_handlers[i];
if (handler->type == type)
{
- struct GNUNET_TRANSPORT_ATS_Information atsi;
+ struct GNUNET_ATS_Information atsi;
atsi.type = 0;
atsi.value = 0;
callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
return GNUNET_OK;
}
data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Data callback\n");
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
static void *
inbound_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
const struct GNUNET_PeerIdentity *initiator,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
unsigned int id = *(unsigned int *) cls;
*/
static void
peer_conected (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer connected\n");
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown, NULL);
data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Data callback\n");
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
static void *
inbound_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
const struct GNUNET_PeerIdentity *initiator,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
unsigned int id = *(unsigned int *) cls;
*/
static void
peer_conected (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer connected\n");
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown, NULL);
*/
static void
ch (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "peer connected\n");
return;
void **tunnel_ctx,
const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
long client = (long) cls;
incoming_tunnel (void *cls,
struct GNUNET_MESH_Tunnel * tunnel,
const struct GNUNET_PeerIdentity * initiator,
- const struct GNUNET_TRANSPORT_ATS_Information * atsi)
+ const struct GNUNET_ATS_Information * atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: Incoming tunnel from %s\n",
*/
static void
ch (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: peer %s connected\n",
incoming_tunnel (void *cls,
struct GNUNET_MESH_Tunnel * tunnel,
const struct GNUNET_PeerIdentity * initiator,
- const struct GNUNET_TRANSPORT_ATS_Information * atsi)
+ const struct GNUNET_ATS_Information * atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: Incoming tunnel from %s\n",
*/
static void
ch (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: peer %s connected\n",
static int
handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
const struct GNUNET_NSE_FloodMessage *incoming_flood;
struct GNUNET_TIME_Absolute ts;
*/
static void
handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct NSEPeerEntry *peer_entry;
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
char *dotOutFileNameFinished;
FILE *dotOutFileFinished;
*/
static void
connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct TestMessageContext *pos = cls;
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
char *dotOutFileNameFinished;
FILE *dotOutFileFinished;
*/
static void
connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct TestMessageContext *pos = cls;
*/
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_TESTING_ConnectContext *ctx = cls;
*/
static void
core_initial_iteration (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct GNUNET_TESTING_ConnectContext *ctx = cls;
*/
static void
core_connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct SendHelloContext *send_hello_context = cls;
struct PeerConnection *connection;
*/
static void
internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct CoreContext *core_ctx = cls;
struct TopologyIterateContext *iter_ctx = core_ctx->iter_context;
*/
static void
connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct Peer *pos;
static int
handle_encrypted_hello (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
struct Peer *peer;
struct GNUNET_PeerIdentity pid;
*/
static void
transmit_our_hello (void *cls, const struct GNUNET_PeerIdentity *target,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count,
const char * transport,
const void * addr,
static struct GNUNET_TIME_Relative
plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count, struct Session *session,
const char *sender_address,
uint16_t sender_address_len)
struct Session *session,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- const struct GNUNET_TRANSPORT_ATS_Information * ats,
+ const struct GNUNET_ATS_Information * ats,
uint32_t ats_count)
{
uint32_t bw_in = ntohl (bandwidth_in.value__);
static void
neighbours_connect_notification (void *cls,
const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count)
{
char buf[sizeof (struct ConnectInfoMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information)];
+ ats_count * sizeof (struct GNUNET_ATS_Information)];
struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf;
connect_msg->header.size = htons (sizeof (buf));
connect_msg->ats_count = htonl (ats_count);
connect_msg->id = *peer;
memcpy (&connect_msg->ats, &connect_msg->ats,
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ ats_count * sizeof (struct GNUNET_ATS_Information));
GST_clients_broadcast (&connect_msg->header, GNUNET_NO);
}
*/
static void
test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count,
const char * transport,
const void * addr,
static void
notify_client_about_neighbour (void *cls,
const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count,
const char * transport,
const void * addr,
size =
sizeof (struct ConnectInfoMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+ ats_count * sizeof (struct GNUNET_ATS_Information);
GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
cim = GNUNET_malloc (size);
cim->header.size = htons (size);
cim->ats_count = htonl (ats_count);
cim->id = *peer;
memcpy (&cim->ats, ats,
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
+ ats_count * sizeof (struct GNUNET_ATS_Information));
unicast (tc, &cim->header, GNUNET_NO);
GNUNET_free (cim);
}
*/
static void
output_addresses (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count,
const char * transport,
const void * addr,
/**
* Performance data for the peer.
*/
- //struct GNUNET_TRANSPORT_ATS_Information *ats;
+ //struct GNUNET_ATS_Information *ats;
/**
* Are we currently trying to send a message? If so, which one?
GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
const char *plugin_name, const void *address,
size_t address_len, struct Session *session,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count)
{
struct NeighbourMapEntry *n;
const struct GNUNET_PeerIdentity *
neighbour,
const struct
- GNUNET_TRANSPORT_ATS_Information * ats,
+ GNUNET_ATS_Information * ats,
uint32_t ats_count,
const char * transport,
const void * addr,
GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
const char *plugin_name, const void *address,
size_t address_len, struct Session *session,
- const struct GNUNET_TRANSPORT_ATS_Information
+ const struct GNUNET_ATS_Information
*ats, uint32_t ats_count);
/* validity achieved, remember it! */
ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION);
{
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
- ats.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY);
+ ats.type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
ats.value = htonl ((uint32_t) GNUNET_TIME_absolute_get_duration (ve->send_time).rel_value);
GNUNET_ATS_address_update (GST_ats, &ve->pid,
ve->transport_name,ve->addr, ve->addrlen, NULL,
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n",
{
struct Session *s = cls;
struct Plugin *plugin = s->plugin;
- struct GNUNET_TRANSPORT_ATS_Information distance;
+ struct GNUNET_ATS_Information distance;
struct GNUNET_TIME_Relative delay;
- distance.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ distance.type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
distance.value = htonl (1);
- delay = plugin->env->receive (plugin->env->cls, &s->target, message, (const struct GNUNET_TRANSPORT_ATS_Information*) &distance, 1, s, s->addr, s->addrlen);
+ delay = plugin->env->receive (plugin->env->cls, &s->target, message, (const struct GNUNET_ATS_Information*) &distance, 1, s, s->addr, s->addrlen);
return delay;
}
{
struct Session *session = cls;
struct GNUNET_TIME_Relative delay;
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
session->receive_delay_task = GNUNET_SCHEDULER_NO_TASK;
delay =
GNUNET_STATISTICS_update (plugin->env->stats,
gettext_noop ("# bytes received via TCP"),
ntohs (message->size), GNUNET_NO);
- struct GNUNET_TRANSPORT_ATS_Information distance;
+ struct GNUNET_ATS_Information distance;
- distance.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ distance.type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
distance.value = htonl (1);
delay =
plugin->env->receive (plugin->env->cls, &session->target, message,
- (const struct GNUNET_TRANSPORT_ATS_Information *)
+ (const struct GNUNET_ATS_Information *)
&distance, 1, session,
(GNUNET_YES ==
session->inbound) ? NULL : session->connect_addr,
{
struct Plugin *plugin = cls;
struct SourceInformation *si = client;
- struct GNUNET_TRANSPORT_ATS_Information distance;
+ struct GNUNET_ATS_Information distance;
/* setup ATS */
- distance.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ distance.type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
distance.value = htonl (1);
LOG (GNUNET_ERROR_TYPE_DEBUG,
const struct GNUNET_MessageHeader *currhdr,
const struct sockaddr_un *un, size_t fromlen)
{
- struct GNUNET_TRANSPORT_ATS_Information distance;
+ struct GNUNET_ATS_Information distance;
- distance.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ distance.type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
distance.value = htonl (UNIX_DIRECT_DISTANCE);
GNUNET_assert (fromlen >= sizeof (struct sockaddr_un));
un->sun_path);
#endif
plugin->env->receive (plugin->env->cls, sender, currhdr,
- (const struct GNUNET_TRANSPORT_ATS_Information *)
+ (const struct GNUNET_ATS_Information *)
&distance, 1, NULL, un->sun_path,
strlen (un->sun_path) + 1);
}
struct Session *session = (struct Session *) client;
struct Plugin *plugin = (struct Plugin *) cls;
- struct GNUNET_TRANSPORT_ATS_Information distance;
+ struct GNUNET_ATS_Information distance;
- distance.type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+ distance.type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
distance.value = htonl (1);
#if DEBUG_wlan
#endif
plugin->env->receive (plugin->env->cls, &(session->target), hdr,
- (const struct GNUNET_TRANSPORT_ATS_Information *)
+ (const struct GNUNET_ATS_Information *)
&distance, 1, session,
(const char *) &session->mac->addr,
sizeof (session->mac->addr));
static void
notify_receive_new (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
const struct TestMessage *hdr;
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
connected++;
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct PeerContext * p = cls;
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static int c;
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n",
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n",
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static int n;
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n",
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static int n;
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static int n;
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' connected \n",
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving\n");
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' connected \n",
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving\n");
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct PeerContext *p = cls;
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ const struct GNUNET_ATS_Information *ats,
uint32_t ats_count)
{
struct PeerContext *p = cls;
* First of the ATS information blocks (we must have at least
* one due to the 0-termination requirement).
*/
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
};
* First of the ATS information blocks (we must have at least
* one due to the 0-termination requirement).
*/
- struct GNUNET_TRANSPORT_ATS_Information ats;
+ struct GNUNET_ATS_Information ats;
};
ats_count = ntohl (cim->ats_count);
if (size !=
sizeof (struct ConnectInfoMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information))
+ ats_count * sizeof (struct GNUNET_ATS_Information))
{
GNUNET_break (0);
break;
imm = (const struct GNUNET_MessageHeader *) &((&(im->ats))[ats_count + 1]);
if (ntohs (imm->size) + sizeof (struct InboundMessage) +
- ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information) != size)
+ ats_count * sizeof (struct GNUNET_ATS_Information) != size)
{
GNUNET_break (0);
break;
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n");
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
void
send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
/* peer == NULL means that all peers in this request are connected */
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
void
send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi);
+ const struct GNUNET_ATS_Information *atsi);
/**
* The configuration to use
void
mesh_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
if (NULL == peer)
const struct GNUNET_PeerIdentity *sender
__attribute__ ((unused)),
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
struct dns_pkt *dns = (struct dns_pkt *) (message + 1);
__attribute__ ((unused)),
const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi
+ const struct GNUNET_ATS_Information *atsi
__attribute__ ((unused)))
{
/* TODo: size check */