diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-13 16:59:57 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-13 16:59:57 +0000 |
commit | 1257490cb630ade315a196a724d0233e662afb2c (patch) | |
tree | 0d9c01593a1aa73d8f6490127b640d67da69b54c /src/transport/plugin_transport_wlan.c | |
parent | 35d79cb1941c9f9607195b8760d8a14d836e6397 (diff) | |
download | gnunet-1257490cb630ade315a196a724d0233e662afb2c.tar.gz gnunet-1257490cb630ade315a196a724d0233e662afb2c.zip |
implementing 0003268 to inbound information in HELLO addresses
All transport plugin functions are modified to use HELLO addresses instead of peer,address,address_length
All plugins are modified to use HELLO addresses internally
This commit can break transport functionality: core tests on my system still pass,
but transport tests may still fail, errors messages may occurs or crashs
Will be fixed asap
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 130 |
1 files changed, 71 insertions, 59 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 1fafc4070..1026eb584 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -351,7 +351,9 @@ struct MacEndpoint | |||
351 | /** | 351 | /** |
352 | * peer mac address | 352 | * peer mac address |
353 | */ | 353 | */ |
354 | struct WlanAddress addr; | 354 | //struct WlanAddress addr; |
355 | |||
356 | struct GNUNET_HELLO_Address *address; | ||
355 | 357 | ||
356 | /** | 358 | /** |
357 | * Inbound or outbound session | 359 | * Inbound or outbound session |
@@ -612,8 +614,8 @@ send_ack (void *cls, uint32_t msg_id, | |||
612 | get_radiotap_header (endpoint, radio_header, size); | 614 | get_radiotap_header (endpoint, radio_header, size); |
613 | get_wlan_header (endpoint->plugin, | 615 | get_wlan_header (endpoint->plugin, |
614 | &radio_header->frame, | 616 | &radio_header->frame, |
615 | &endpoint->addr.mac, | 617 | endpoint->address->address, |
616 | size); | 618 | endpoint->address->address_length); |
617 | memcpy (&radio_header[1], hdr, msize); | 619 | memcpy (&radio_header[1], hdr, msize); |
618 | if (NULL != | 620 | if (NULL != |
619 | GNUNET_HELPER_send (endpoint->plugin->suid_helper, | 621 | GNUNET_HELPER_send (endpoint->plugin->suid_helper, |
@@ -789,10 +791,11 @@ create_session (struct MacEndpoint *endpoint, | |||
789 | GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, &session_timeout, session); | 791 | GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, &session_timeout, session); |
790 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 792 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
791 | "Created new %s session %p for peer `%s' with endpoint %s\n", | 793 | "Created new %s session %p for peer `%s' with endpoint %s\n", |
794 | |||
792 | (GNUNET_YES == inbound) ? "inbound" : "outbound", | 795 | (GNUNET_YES == inbound) ? "inbound" : "outbound", |
793 | session, | 796 | session, |
794 | GNUNET_i2s (peer), | 797 | GNUNET_i2s (peer), |
795 | mac_to_string (&endpoint->addr.mac)); | 798 | mac_to_string (endpoint->address->address)); |
796 | 799 | ||
797 | return session; | 800 | return session; |
798 | } | 801 | } |
@@ -870,8 +873,8 @@ transmit_fragment (void *cls, | |||
870 | get_radiotap_header (endpoint, radio_header, size); | 873 | get_radiotap_header (endpoint, radio_header, size); |
871 | get_wlan_header (endpoint->plugin, | 874 | get_wlan_header (endpoint->plugin, |
872 | &radio_header->frame, | 875 | &radio_header->frame, |
873 | &endpoint->addr.mac, | 876 | endpoint->address->address, |
874 | size); | 877 | endpoint->address->address_length); |
875 | memcpy (&radio_header[1], hdr, msize); | 878 | memcpy (&radio_header[1], hdr, msize); |
876 | GNUNET_assert (NULL == fm->sh); | 879 | GNUNET_assert (NULL == fm->sh); |
877 | fm->sh = GNUNET_HELPER_send (endpoint->plugin->suid_helper, | 880 | fm->sh = GNUNET_HELPER_send (endpoint->plugin->suid_helper, |
@@ -1072,15 +1075,16 @@ macendpoint_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1072 | */ | 1075 | */ |
1073 | static struct MacEndpoint * | 1076 | static struct MacEndpoint * |
1074 | create_macendpoint (struct Plugin *plugin, | 1077 | create_macendpoint (struct Plugin *plugin, |
1075 | const struct WlanAddress *addr) | 1078 | const struct GNUNET_HELLO_Address *address) |
1076 | { | 1079 | { |
1077 | struct MacEndpoint *pos; | 1080 | struct MacEndpoint *pos; |
1078 | 1081 | ||
1079 | for (pos = plugin->mac_head; NULL != pos; pos = pos->next) | 1082 | for (pos = plugin->mac_head; NULL != pos; pos = pos->next) |
1080 | if (0 == memcmp (addr, &pos->addr, sizeof (struct WlanAddress))) | 1083 | if (0 == memcmp (address->address, pos->address->address, |
1084 | pos->address->address_length)) | ||
1081 | return pos; | 1085 | return pos; |
1082 | pos = GNUNET_new (struct MacEndpoint); | 1086 | pos = GNUNET_new (struct MacEndpoint); |
1083 | pos->addr = *addr; | 1087 | pos->address = GNUNET_HELLO_address_copy (address); |
1084 | pos->plugin = plugin; | 1088 | pos->plugin = plugin; |
1085 | pos->defrag = | 1089 | pos->defrag = |
1086 | GNUNET_DEFRAGMENT_context_create (plugin->env->stats, WLAN_MTU, | 1090 | GNUNET_DEFRAGMENT_context_create (plugin->env->stats, WLAN_MTU, |
@@ -1090,8 +1094,7 @@ create_macendpoint (struct Plugin *plugin, | |||
1090 | &send_ack); | 1094 | &send_ack); |
1091 | 1095 | ||
1092 | pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS; | 1096 | pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS; |
1093 | pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 1097 | pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100); |
1094 | 100); | ||
1095 | pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); | 1098 | pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); |
1096 | pos->timeout_task = | 1099 | pos->timeout_task = |
1097 | GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, | 1100 | GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, |
@@ -1100,9 +1103,8 @@ create_macendpoint (struct Plugin *plugin, | |||
1100 | plugin->mac_count++; | 1103 | plugin->mac_count++; |
1101 | GNUNET_STATISTICS_update (plugin->env->stats, _("# WLAN MAC endpoints allocated"), | 1104 | GNUNET_STATISTICS_update (plugin->env->stats, _("# WLAN MAC endpoints allocated"), |
1102 | 1, GNUNET_NO); | 1105 | 1, GNUNET_NO); |
1103 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1106 | LOG (GNUNET_ERROR_TYPE_DEBUG, "New MAC endpoint `%s'\n", |
1104 | "New MAC endpoint `%s'\n", | 1107 | wlan_plugin_address_to_string(NULL, address->address, address->address_length)); |
1105 | wlan_plugin_address_to_string(NULL, addr, sizeof (struct WlanAddress))); | ||
1106 | return pos; | 1108 | return pos; |
1107 | } | 1109 | } |
1108 | 1110 | ||
@@ -1149,7 +1151,7 @@ wlan_plugin_get_session (void *cls, | |||
1149 | "Service asked to create session for peer `%s' with MAC `%s'\n", | 1151 | "Service asked to create session for peer `%s' with MAC `%s'\n", |
1150 | GNUNET_i2s (&address->peer), | 1152 | GNUNET_i2s (&address->peer), |
1151 | wlan_plugin_address_to_string(NULL, address->address, address->address_length)); | 1153 | wlan_plugin_address_to_string(NULL, address->address, address->address_length)); |
1152 | endpoint = create_macendpoint (plugin, address->address); | 1154 | endpoint = create_macendpoint (plugin, address); |
1153 | return get_session (endpoint, &address->peer, GNUNET_NO); | 1155 | return get_session (endpoint, &address->peer, GNUNET_NO); |
1154 | } | 1156 | } |
1155 | 1157 | ||
@@ -1261,6 +1263,7 @@ static int | |||
1261 | process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | 1263 | process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) |
1262 | { | 1264 | { |
1263 | struct Plugin *plugin = cls; | 1265 | struct Plugin *plugin = cls; |
1266 | struct GNUNET_HELLO_Address *address; | ||
1264 | struct MacAndSession *mas = client; | 1267 | struct MacAndSession *mas = client; |
1265 | struct MacAndSession xmas; | 1268 | struct MacAndSession xmas; |
1266 | struct GNUNET_ATS_Information ats; | 1269 | struct GNUNET_ATS_Information ats; |
@@ -1291,21 +1294,18 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1291 | "Processing %u bytes of HELLO from peer `%s' at MAC %s\n", | 1294 | "Processing %u bytes of HELLO from peer `%s' at MAC %s\n", |
1292 | (unsigned int) msize, | 1295 | (unsigned int) msize, |
1293 | GNUNET_i2s (&tmpsource), | 1296 | GNUNET_i2s (&tmpsource), |
1294 | wlan_plugin_address_to_string (NULL, &mas->endpoint->addr, sizeof (struct WlanAddress))); | 1297 | wlan_plugin_address_to_string (NULL, mas->endpoint->address->address, mas->endpoint->address->address_length)); |
1295 | 1298 | ||
1296 | GNUNET_STATISTICS_update (plugin->env->stats, | 1299 | GNUNET_STATISTICS_update (plugin->env->stats, |
1297 | _("# HELLO messages received via WLAN"), 1, | 1300 | _("# HELLO messages received via WLAN"), 1, |
1298 | GNUNET_NO); | 1301 | GNUNET_NO); |
1302 | |||
1299 | plugin->env->receive (plugin->env->cls, | 1303 | plugin->env->receive (plugin->env->cls, |
1300 | &tmpsource, | 1304 | mas->endpoint->address, |
1301 | hdr, | 1305 | mas->session, |
1302 | mas->session, | 1306 | hdr); |
1303 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | ||
1304 | (mas->endpoint == NULL) ? 0 : sizeof (struct WlanAddress)); | ||
1305 | plugin->env->update_address_metrics (plugin->env->cls, | 1307 | plugin->env->update_address_metrics (plugin->env->cls, |
1306 | &tmpsource, | 1308 | mas->endpoint->address, |
1307 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | ||
1308 | (mas->endpoint == NULL) ? 0 : sizeof (struct WlanAddress), | ||
1309 | mas->session, | 1309 | mas->session, |
1310 | &ats, 1); | 1310 | &ats, 1); |
1311 | break; | 1311 | break; |
@@ -1318,7 +1318,8 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1318 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1318 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1319 | "Processing %u bytes of FRAGMENT from MAC %s\n", | 1319 | "Processing %u bytes of FRAGMENT from MAC %s\n", |
1320 | (unsigned int) msize, | 1320 | (unsigned int) msize, |
1321 | wlan_plugin_address_to_string (NULL, &mas->endpoint->addr, sizeof (struct WlanAddress))); | 1321 | wlan_plugin_address_to_string (NULL, mas->endpoint->address->address, |
1322 | mas->endpoint->address->address_length)); | ||
1322 | GNUNET_STATISTICS_update (plugin->env->stats, | 1323 | GNUNET_STATISTICS_update (plugin->env->stats, |
1323 | _("# fragments received via WLAN"), 1, GNUNET_NO); | 1324 | _("# fragments received via WLAN"), 1, GNUNET_NO); |
1324 | (void) GNUNET_DEFRAGMENT_process_fragment (mas->endpoint->defrag, | 1325 | (void) GNUNET_DEFRAGMENT_process_fragment (mas->endpoint->defrag, |
@@ -1339,7 +1340,8 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1339 | { | 1340 | { |
1340 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1341 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1341 | "Got last ACK, finished message transmission to `%s' (%p)\n", | 1342 | "Got last ACK, finished message transmission to `%s' (%p)\n", |
1342 | wlan_plugin_address_to_string (NULL, &mas->endpoint->addr, sizeof (struct WlanAddress)), | 1343 | wlan_plugin_address_to_string (NULL, mas->endpoint->address->address, |
1344 | mas->endpoint->address->address_length), | ||
1343 | fm); | 1345 | fm); |
1344 | mas->endpoint->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); | 1346 | mas->endpoint->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); |
1345 | if (NULL != fm->cont) | 1347 | if (NULL != fm->cont) |
@@ -1354,13 +1356,15 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1354 | { | 1356 | { |
1355 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1357 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1356 | "Got an ACK, message transmission to `%s' not yet finished\n", | 1358 | "Got an ACK, message transmission to `%s' not yet finished\n", |
1357 | wlan_plugin_address_to_string (NULL, &mas->endpoint->addr, sizeof (struct WlanAddress))); | 1359 | wlan_plugin_address_to_string (NULL, mas->endpoint->address->address, |
1360 | mas->endpoint->address->address_length)); | ||
1358 | break; | 1361 | break; |
1359 | } | 1362 | } |
1360 | } | 1363 | } |
1361 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1364 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1362 | "ACK not matched against any active fragmentation with MAC `%s'\n", | 1365 | "ACK not matched against any active fragmentation with MAC `%s'\n", |
1363 | wlan_plugin_address_to_string (NULL, &mas->endpoint->addr, sizeof (struct WlanAddress))); | 1366 | wlan_plugin_address_to_string (NULL, mas->endpoint->address->address, |
1367 | mas->endpoint->address->address_length)); | ||
1364 | break; | 1368 | break; |
1365 | case GNUNET_MESSAGE_TYPE_WLAN_DATA: | 1369 | case GNUNET_MESSAGE_TYPE_WLAN_DATA: |
1366 | if (NULL == mas->endpoint) | 1370 | if (NULL == mas->endpoint) |
@@ -1395,12 +1399,14 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1395 | if (NULL == (xmas.session = lookup_session (mas->endpoint, &wlanheader->sender, GNUNET_YES))) | 1399 | if (NULL == (xmas.session = lookup_session (mas->endpoint, &wlanheader->sender, GNUNET_YES))) |
1396 | { | 1400 | { |
1397 | xmas.session = create_session (mas->endpoint, &wlanheader->sender, GNUNET_YES); | 1401 | xmas.session = create_session (mas->endpoint, &wlanheader->sender, GNUNET_YES); |
1398 | plugin->env->session_start (NULL, &wlanheader->sender, | 1402 | address = GNUNET_HELLO_address_allocate (&wlanheader->sender, PLUGIN_NAME, |
1399 | PLUGIN_NAME, &mas->endpoint->addr, | 1403 | &mas->endpoint->address, sizeof (struct WlanAddress), |
1400 | sizeof (struct WlanAddress), xmas.session, NULL, 0); | 1404 | GNUNET_HELLO_ADDRESS_INFO_NONE); |
1405 | plugin->env->session_start (NULL, address, xmas.session, NULL, 0); | ||
1401 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1406 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1402 | "Notifying transport about peer `%s''s new inbound session %p \n", | 1407 | "Notifying transport about peer `%s''s new inbound session %p \n", |
1403 | GNUNET_i2s (&wlanheader->sender), xmas.session); | 1408 | GNUNET_i2s (&wlanheader->sender), xmas.session); |
1409 | GNUNET_HELLO_address_free (address); | ||
1404 | } | 1410 | } |
1405 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1411 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1406 | "Processing %u bytes of WLAN DATA from peer `%s'\n", | 1412 | "Processing %u bytes of WLAN DATA from peer `%s'\n", |
@@ -1429,17 +1435,13 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
1429 | (unsigned int) ntohs (hdr->type), | 1435 | (unsigned int) ntohs (hdr->type), |
1430 | GNUNET_i2s (&mas->session->target)); | 1436 | GNUNET_i2s (&mas->session->target)); |
1431 | plugin->env->receive (plugin->env->cls, | 1437 | plugin->env->receive (plugin->env->cls, |
1432 | &mas->session->target, | 1438 | mas->session->mac->address, |
1433 | hdr, | 1439 | mas->session, |
1434 | mas->session, | 1440 | hdr); |
1435 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | ||
1436 | (mas->endpoint == NULL) ? 0 : sizeof (struct WlanAddress)); | ||
1437 | plugin->env->update_address_metrics (plugin->env->cls, | 1441 | plugin->env->update_address_metrics (plugin->env->cls, |
1438 | &mas->session->target, | 1442 | mas->session->mac->address, |
1439 | (mas->endpoint == NULL) ? NULL : (const char *) &mas->endpoint->addr, | 1443 | mas->session, |
1440 | (mas->endpoint == NULL) ? 0 : sizeof (struct WlanAddress), | 1444 | &ats, 1); |
1441 | mas->session, | ||
1442 | &ats, 1); | ||
1443 | break; | 1445 | break; |
1444 | } | 1446 | } |
1445 | return GNUNET_OK; | 1447 | return GNUNET_OK; |
@@ -1458,6 +1460,7 @@ handle_helper_message (void *cls, void *client, | |||
1458 | const struct GNUNET_MessageHeader *hdr) | 1460 | const struct GNUNET_MessageHeader *hdr) |
1459 | { | 1461 | { |
1460 | struct Plugin *plugin = cls; | 1462 | struct Plugin *plugin = cls; |
1463 | struct GNUNET_HELLO_Address *address; | ||
1461 | const struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage *rxinfo; | 1464 | const struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage *rxinfo; |
1462 | const struct GNUNET_TRANSPORT_WLAN_HelperControlMessage *cm; | 1465 | const struct GNUNET_TRANSPORT_WLAN_HelperControlMessage *cm; |
1463 | struct WlanAddress wa; | 1466 | struct WlanAddress wa; |
@@ -1484,24 +1487,26 @@ handle_helper_message (void *cls, void *client, | |||
1484 | memset (&wa, 0, sizeof (struct WlanAddress)); | 1487 | memset (&wa, 0, sizeof (struct WlanAddress)); |
1485 | wa.mac = plugin->mac_address; | 1488 | wa.mac = plugin->mac_address; |
1486 | wa.options = htonl(plugin->options); | 1489 | wa.options = htonl(plugin->options); |
1487 | plugin->env->notify_address (plugin->env->cls, GNUNET_NO, | 1490 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, |
1488 | &wa, | 1491 | PLUGIN_NAME, &wa, sizeof (wa), GNUNET_HELLO_ADDRESS_INFO_NONE); |
1489 | sizeof (wa), | 1492 | plugin->env->notify_address (plugin->env->cls, GNUNET_NO, address); |
1490 | "wlan"); | 1493 | GNUNET_HELLO_address_free (address); |
1491 | } | 1494 | } |
1492 | plugin->mac_address = cm->mac; | 1495 | plugin->mac_address = cm->mac; |
1493 | plugin->have_mac = GNUNET_YES; | 1496 | plugin->have_mac = GNUNET_YES; |
1497 | |||
1494 | memset (&wa, 0, sizeof (struct WlanAddress)); | 1498 | memset (&wa, 0, sizeof (struct WlanAddress)); |
1495 | wa.mac = plugin->mac_address; | 1499 | wa.mac = plugin->mac_address; |
1496 | wa.options = htonl(plugin->options); | 1500 | wa.options = htonl(plugin->options); |
1501 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, | ||
1502 | PLUGIN_NAME, &wa, sizeof (wa), GNUNET_HELLO_ADDRESS_INFO_NONE); | ||
1503 | |||
1497 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1504 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1498 | "Received WLAN_HELPER_CONTROL message with MAC address `%s' for peer `%s'\n", | 1505 | "Received WLAN_HELPER_CONTROL message with MAC address `%s' for peer `%s'\n", |
1499 | mac_to_string (&cm->mac), | 1506 | mac_to_string (&cm->mac), |
1500 | GNUNET_i2s (plugin->env->my_identity)); | 1507 | GNUNET_i2s (plugin->env->my_identity)); |
1501 | plugin->env->notify_address (plugin->env->cls, GNUNET_YES, | 1508 | plugin->env->notify_address (plugin->env->cls, GNUNET_YES, address); |
1502 | &wa, | 1509 | GNUNET_HELLO_address_free (address); |
1503 | sizeof (struct WlanAddress), | ||
1504 | "wlan"); | ||
1505 | break; | 1510 | break; |
1506 | case GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER: | 1511 | case GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER: |
1507 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1512 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1551,7 +1556,10 @@ handle_helper_message (void *cls, void *client, | |||
1551 | mac_to_string (&rxinfo->frame.addr2)); | 1556 | mac_to_string (&rxinfo->frame.addr2)); |
1552 | wa.mac = rxinfo->frame.addr2; | 1557 | wa.mac = rxinfo->frame.addr2; |
1553 | wa.options = htonl (0); | 1558 | wa.options = htonl (0); |
1554 | mas.endpoint = create_macendpoint (plugin, &wa); | 1559 | address = GNUNET_HELLO_address_allocate (NULL, PLUGIN_NAME, &wa, |
1560 | sizeof (struct WlanAddress), GNUNET_HELLO_ADDRESS_INFO_NONE); | ||
1561 | mas.endpoint = create_macendpoint (plugin, address); | ||
1562 | GNUNET_HELLO_address_free (address); | ||
1555 | mas.session = NULL; | 1563 | mas.session = NULL; |
1556 | (void) GNUNET_SERVER_mst_receive (plugin->helper_payload_tokenizer, | 1564 | (void) GNUNET_SERVER_mst_receive (plugin->helper_payload_tokenizer, |
1557 | &mas, | 1565 | &mas, |
@@ -1738,7 +1746,8 @@ wlan_plugin_address_pretty_printer (void *cls, const char *type, | |||
1738 | void * | 1746 | void * |
1739 | libgnunet_plugin_transport_wlan_done (void *cls) | 1747 | libgnunet_plugin_transport_wlan_done (void *cls) |
1740 | { | 1748 | { |
1741 | struct WlanAddress wa; | 1749 | struct WlanAddress wa; |
1750 | struct GNUNET_HELLO_Address *address; | ||
1742 | struct GNUNET_TRANSPORT_PluginFunctions *api = cls; | 1751 | struct GNUNET_TRANSPORT_PluginFunctions *api = cls; |
1743 | struct Plugin *plugin = api->cls; | 1752 | struct Plugin *plugin = api->cls; |
1744 | struct MacEndpoint *endpoint; | 1753 | struct MacEndpoint *endpoint; |
@@ -1752,14 +1761,17 @@ libgnunet_plugin_transport_wlan_done (void *cls) | |||
1752 | 1761 | ||
1753 | if (GNUNET_YES == plugin->have_mac) | 1762 | if (GNUNET_YES == plugin->have_mac) |
1754 | { | 1763 | { |
1755 | memset (&wa, 0, sizeof (wa)); | 1764 | memset (&wa, 0, sizeof(wa)); |
1756 | wa.options = htonl (plugin->options); | 1765 | wa.options = htonl (plugin->options); |
1757 | wa.mac = plugin->mac_address; | 1766 | wa.mac = plugin->mac_address; |
1758 | plugin->env->notify_address (plugin->env->cls, GNUNET_NO, | 1767 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, |
1759 | &wa, | 1768 | PLUGIN_NAME, &wa, sizeof (struct WlanAddress), |
1760 | sizeof (struct WlanAddress), | 1769 | GNUNET_HELLO_ADDRESS_INFO_NONE); |
1761 | "wlan"); | 1770 | |
1762 | plugin->have_mac = GNUNET_NO; | 1771 | plugin->env->notify_address (plugin->env->cls, GNUNET_NO, address); |
1772 | plugin->have_mac = GNUNET_NO; | ||
1773 | |||
1774 | GNUNET_HELLO_address_free (address); | ||
1763 | } | 1775 | } |
1764 | 1776 | ||
1765 | if (GNUNET_SCHEDULER_NO_TASK != plugin->beacon_task) | 1777 | if (GNUNET_SCHEDULER_NO_TASK != plugin->beacon_task) |