aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/gnunet-service-transport.c12
-rw-r--r--src/transport/gnunet-service-transport_blacklist.c2
-rw-r--r--src/transport/gnunet-service-transport_clients.c13
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c6
-rw-r--r--src/transport/gnunet-service-transport_neighbours.h2
-rw-r--r--src/transport/test_transport_startonly.c3
-rw-r--r--src/transport/transport.h10
-rw-r--r--src/transport/transport_api.c9
8 files changed, 9 insertions, 48 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index a0568c855..ffe40f8c1 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -111,8 +111,6 @@ struct GNUNET_TIME_Relative hello_expiration;
111 */ 111 */
112static void 112static void
113transmit_our_hello (void *cls, const struct GNUNET_PeerIdentity *target, 113transmit_our_hello (void *cls, const struct GNUNET_PeerIdentity *target,
114 const struct GNUNET_ATS_Information *ats,
115 uint32_t ats_count,
116 const struct GNUNET_HELLO_Address *address, 114 const struct GNUNET_HELLO_Address *address,
117 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 115 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
118 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 116 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
@@ -499,17 +497,12 @@ ats_request_address_change (void *cls,
499static void 497static void
500neighbours_connect_notification (void *cls, 498neighbours_connect_notification (void *cls,
501 const struct GNUNET_PeerIdentity *peer, 499 const struct GNUNET_PeerIdentity *peer,
502 const struct GNUNET_ATS_Information *ats,
503 uint32_t ats_count,
504 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 500 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
505 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 501 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
506{ 502{
507 size_t len = 503 size_t len = sizeof (struct ConnectInfoMessage);
508 sizeof (struct ConnectInfoMessage) +
509 ats_count * sizeof (struct GNUNET_ATS_Information);
510 char buf[len] GNUNET_ALIGN; 504 char buf[len] GNUNET_ALIGN;
511 struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf; 505 struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf;
512 struct GNUNET_ATS_Information *ap;
513 506
514 connections++; 507 connections++;
515 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 508 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -518,12 +511,9 @@ neighbours_connect_notification (void *cls,
518 511
519 connect_msg->header.size = htons (sizeof (buf)); 512 connect_msg->header.size = htons (sizeof (buf));
520 connect_msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT); 513 connect_msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
521 connect_msg->ats_count = htonl (ats_count);
522 connect_msg->id = *peer; 514 connect_msg->id = *peer;
523 connect_msg->quota_in = bandwidth_in; 515 connect_msg->quota_in = bandwidth_in;
524 connect_msg->quota_out = bandwidth_out; 516 connect_msg->quota_out = bandwidth_out;
525 ap = (struct GNUNET_ATS_Information *) &connect_msg[1];
526 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
527 GST_clients_broadcast (&connect_msg->header, GNUNET_NO); 517 GST_clients_broadcast (&connect_msg->header, GNUNET_NO);
528} 518}
529 519
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c
index 479b30eb4..73dbd931d 100644
--- a/src/transport/gnunet-service-transport_blacklist.c
+++ b/src/transport/gnunet-service-transport_blacklist.c
@@ -548,8 +548,6 @@ struct TestConnectionContext
548 */ 548 */
549static void 549static void
550test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour, 550test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour,
551 const struct GNUNET_ATS_Information *ats,
552 uint32_t ats_count,
553 const struct GNUNET_HELLO_Address *address, 551 const struct GNUNET_HELLO_Address *address,
554 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 552 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
555 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 553 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c
index 23fc7278b..610dda021 100644
--- a/src/transport/gnunet-service-transport_clients.c
+++ b/src/transport/gnunet-service-transport_clients.c
@@ -474,30 +474,22 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client)
474static void 474static void
475notify_client_about_neighbour (void *cls, 475notify_client_about_neighbour (void *cls,
476 const struct GNUNET_PeerIdentity *peer, 476 const struct GNUNET_PeerIdentity *peer,
477 const struct GNUNET_ATS_Information *ats,
478 uint32_t ats_count,
479 const struct GNUNET_HELLO_Address *address, 477 const struct GNUNET_HELLO_Address *address,
480 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 478 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
481 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 479 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
482{ 480{
483 struct TransportClient *tc = cls; 481 struct TransportClient *tc = cls;
484 struct ConnectInfoMessage *cim; 482 struct ConnectInfoMessage *cim;
485 struct GNUNET_ATS_Information *ap; 483 size_t size = sizeof (struct ConnectInfoMessage);
486 size_t size =
487 sizeof (struct ConnectInfoMessage) +
488 ats_count * sizeof (struct GNUNET_ATS_Information);
489 char buf[size] GNUNET_ALIGN; 484 char buf[size] GNUNET_ALIGN;
490 485
491 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); 486 GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
492 cim = (struct ConnectInfoMessage *) buf; 487 cim = (struct ConnectInfoMessage *) buf;
493 cim->header.size = htons (size); 488 cim->header.size = htons (size);
494 cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT); 489 cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
495 cim->ats_count = htonl (ats_count);
496 cim->id = *peer; 490 cim->id = *peer;
497 cim->quota_in = bandwidth_in; 491 cim->quota_in = bandwidth_in;
498 cim->quota_out = bandwidth_out; 492 cim->quota_out = bandwidth_out;
499 ap = (struct GNUNET_ATS_Information *) &cim[1];
500 memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
501 unicast (tc, &cim->header, GNUNET_NO); 493 unicast (tc, &cim->header, GNUNET_NO);
502} 494}
503 495
@@ -898,7 +890,6 @@ compose_address_iterate_response_message (const struct GNUNET_PeerIdentity
898 */ 890 */
899static void 891static void
900output_address (void *cls, const struct GNUNET_PeerIdentity *peer, 892output_address (void *cls, const struct GNUNET_PeerIdentity *peer,
901 const struct GNUNET_ATS_Information *ats, uint32_t ats_count,
902 const struct GNUNET_HELLO_Address *address, 893 const struct GNUNET_HELLO_Address *address,
903 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 894 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
904 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 895 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
@@ -965,7 +956,7 @@ clients_handle_address_iterate (void *cls, struct GNUNET_SERVER_Client *client,
965 /* just return one neighbour */ 956 /* just return one neighbour */
966 address = GST_neighbour_get_current_address (&msg->peer); 957 address = GST_neighbour_get_current_address (&msg->peer);
967 if (address != NULL) 958 if (address != NULL)
968 output_address (tc, &msg->peer, NULL, 0, address, 959 output_address (tc, &msg->peer, address,
969 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, 960 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
970 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT); 961 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT);
971 } 962 }
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 2b010732d..ee23af7fc 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -2800,7 +2800,7 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
2800 gettext_noop ("# peers connected"), 2800 gettext_noop ("# peers connected"),
2801 ++neighbours_connected, 2801 ++neighbours_connected,
2802 GNUNET_NO); 2802 GNUNET_NO);
2803 connect_notify_cb (callback_cls, &n->id, NULL, 0, 2803 connect_notify_cb (callback_cls, &n->id,
2804 n->primary_address.bandwidth_in, 2804 n->primary_address.bandwidth_in,
2805 n->primary_address.bandwidth_out); 2805 n->primary_address.bandwidth_out);
2806 /* Tell ATS that the outbound session we created to send CONNECT was successfull */ 2806 /* Tell ATS that the outbound session we created to send CONNECT was successfull */
@@ -3059,7 +3059,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3059 gettext_noop ("# peers connected"), 3059 gettext_noop ("# peers connected"),
3060 ++neighbours_connected, 3060 ++neighbours_connected,
3061 GNUNET_NO); 3061 GNUNET_NO);
3062 connect_notify_cb (callback_cls, &n->id, NULL, 0, 3062 connect_notify_cb (callback_cls, &n->id,
3063 n->primary_address.bandwidth_in, 3063 n->primary_address.bandwidth_in,
3064 n->primary_address.bandwidth_out); 3064 n->primary_address.bandwidth_out);
3065 GNUNET_ATS_address_add(GST_ats, 3065 GNUNET_ATS_address_add(GST_ats,
@@ -3244,7 +3244,7 @@ neighbours_iterate (void *cls, const struct GNUNET_HashCode * key, void *value)
3244 bandwidth_out = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT; 3244 bandwidth_out = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
3245 } 3245 }
3246 3246
3247 ic->cb (ic->cb_cls, &n->id, NULL, 0, 3247 ic->cb (ic->cb_cls, &n->id,
3248 n->primary_address.address, 3248 n->primary_address.address,
3249 bandwidth_in, bandwidth_out); 3249 bandwidth_in, bandwidth_out);
3250 } 3250 }
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h
index 70b6d1096..fbf7d7819 100644
--- a/src/transport/gnunet-service-transport_neighbours.h
+++ b/src/transport/gnunet-service-transport_neighbours.h
@@ -177,8 +177,6 @@ GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target);
177typedef void (*GST_NeighbourIterator) (void *cls, 177typedef void (*GST_NeighbourIterator) (void *cls,
178 const struct GNUNET_PeerIdentity * 178 const struct GNUNET_PeerIdentity *
179 neighbour, 179 neighbour,
180 const struct GNUNET_ATS_Information *
181 ats, uint32_t ats_count,
182 const struct GNUNET_HELLO_Address * 180 const struct GNUNET_HELLO_Address *
183 address, 181 address,
184 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 182 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c
index 8a8fef161..8593b897c 100644
--- a/src/transport/test_transport_startonly.c
+++ b/src/transport/test_transport_startonly.c
@@ -97,8 +97,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
97 97
98static void 98static void
99notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, 99notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
100 const struct GNUNET_MessageHeader *message, 100 const struct GNUNET_MessageHeader *message)
101 const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
102{ 101{
103 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving\n"); 102 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving\n");
104} 103}
diff --git a/src/transport/transport.h b/src/transport/transport.h
index d5413f779..f1376f5a7 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -68,8 +68,6 @@
68 * 68 *
69 * @param cls closure 69 * @param cls closure
70 * @param peer the peer that connected 70 * @param peer the peer that connected
71 * @param ats performance data
72 * @param ats_count number of entries in ats (excluding 0-termination)
73 * @param bandwidth_in inbound bandwidth in NBO 71 * @param bandwidth_in inbound bandwidth in NBO
74 * @param bandwidth_out outbound bandwidth in NBO 72 * @param bandwidth_out outbound bandwidth in NBO
75 * 73 *
@@ -77,8 +75,6 @@
77 75
78typedef void (*NotifyConnect) (void *cls, 76typedef void (*NotifyConnect) (void *cls,
79 const struct GNUNET_PeerIdentity *peer, 77 const struct GNUNET_PeerIdentity *peer,
80 const struct GNUNET_ATS_Information *ats,
81 uint32_t ats_count,
82 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 78 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
83 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out); 79 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);
84 80
@@ -126,12 +122,6 @@ struct ConnectInfoMessage
126 struct GNUNET_MessageHeader header; 122 struct GNUNET_MessageHeader header;
127 123
128 /** 124 /**
129 * Number of ATS key-value pairs that follow this struct
130 * (excluding the 0-terminator).
131 */
132 uint32_t ats_count GNUNET_PACKED;
133
134 /**
135 * Identity of the new neighbour. 125 * Identity of the new neighbour.
136 */ 126 */
137 struct GNUNET_PeerIdentity id; 127 struct GNUNET_PeerIdentity id;
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 8b66fb986..48285302a 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -475,13 +475,11 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
475 const struct GNUNET_MessageHeader *imm; 475 const struct GNUNET_MessageHeader *imm;
476 const struct SendOkMessage *okm; 476 const struct SendOkMessage *okm;
477 const struct QuotaSetMessage *qm; 477 const struct QuotaSetMessage *qm;
478 const struct GNUNET_ATS_Information *ats;
479 struct GNUNET_TRANSPORT_GetHelloHandle *hwl; 478 struct GNUNET_TRANSPORT_GetHelloHandle *hwl;
480 struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl; 479 struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl;
481 struct Neighbour *n; 480 struct Neighbour *n;
482 struct GNUNET_PeerIdentity me; 481 struct GNUNET_PeerIdentity me;
483 uint16_t size; 482 uint16_t size;
484 uint32_t ats_count;
485 uint32_t bytes_msg; 483 uint32_t bytes_msg;
486 uint32_t bytes_physical; 484 uint32_t bytes_physical;
487 485
@@ -533,15 +531,12 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
533 break; 531 break;
534 } 532 }
535 cim = (const struct ConnectInfoMessage *) msg; 533 cim = (const struct ConnectInfoMessage *) msg;
536 ats_count = ntohl (cim->ats_count);
537 if (size != 534 if (size !=
538 sizeof (struct ConnectInfoMessage) + 535 sizeof (struct ConnectInfoMessage))
539 ats_count * sizeof (struct GNUNET_ATS_Information))
540 { 536 {
541 GNUNET_break (0); 537 GNUNET_break (0);
542 break; 538 break;
543 } 539 }
544 ats = (const struct GNUNET_ATS_Information *) &cim[1];
545 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", 540 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n",
546 "CONNECT", GNUNET_i2s (&cim->id)); 541 "CONNECT", GNUNET_i2s (&cim->id));
547 n = neighbour_find (h, &cim->id); 542 n = neighbour_find (h, &cim->id);
@@ -555,7 +550,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
555 "CONNECT", GNUNET_i2s (&cim->id), ntohl (cim->quota_out.value__)); 550 "CONNECT", GNUNET_i2s (&cim->id), ntohl (cim->quota_out.value__));
556 GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, cim->quota_out); 551 GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, cim->quota_out);
557 if (h->nc_cb != NULL) 552 if (h->nc_cb != NULL)
558 h->nc_cb (h->cls, &n->id, ats, ats_count); 553 h->nc_cb (h->cls, &n->id, NULL, 0);
559 break; 554 break;
560 case GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT: 555 case GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT:
561 if (size != sizeof (struct DisconnectInfoMessage)) 556 if (size != sizeof (struct DisconnectInfoMessage))