diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-10 23:24:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-10 23:24:01 +0000 |
commit | 1c323bd4cbb388a9e7515a1f733a3062bf093aee (patch) | |
tree | 7cc525d79149d44840b9f7a0040aaf3e69ecd665 /src/transport/plugin_transport_wlan.c | |
parent | aedaaed687db1ff20b447378f01ad7306921450c (diff) | |
download | gnunet-1c323bd4cbb388a9e7515a1f733a3062bf093aee.tar.gz gnunet-1c323bd4cbb388a9e7515a1f733a3062bf093aee.zip |
fixing #3657 (replace ATS_Information with struct), but WIHTOUT fixing ATS testcases yet
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 42b7d8669..c0e629b83 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -98,6 +98,15 @@ | |||
98 | #define WLAN_MTU 1430 | 98 | #define WLAN_MTU 1430 |
99 | 99 | ||
100 | 100 | ||
101 | /** | ||
102 | * Which network scope do we belong to? | ||
103 | */ | ||
104 | #if BUILD_WLAN | ||
105 | static const enum GNUNET_ATS_Network_Type scope = GNUNET_ATS_NET_WLAN; | ||
106 | #else | ||
107 | static const enum GNUNET_ATS_Network_Type scope = GNUNET_ATS_NET_BT; | ||
108 | #endif | ||
109 | |||
101 | 110 | ||
102 | /** | 111 | /** |
103 | * Maximum number of messages in defragmentation queue per MAC | 112 | * Maximum number of messages in defragmentation queue per MAC |
@@ -1428,19 +1437,12 @@ process_data (void *cls, | |||
1428 | struct Plugin *plugin = cls; | 1437 | struct Plugin *plugin = cls; |
1429 | struct GNUNET_HELLO_Address *address; | 1438 | struct GNUNET_HELLO_Address *address; |
1430 | struct MacAndSession *mas = client; | 1439 | struct MacAndSession *mas = client; |
1431 | struct GNUNET_ATS_Information ats; | ||
1432 | struct FragmentMessage *fm; | 1440 | struct FragmentMessage *fm; |
1433 | struct GNUNET_PeerIdentity tmpsource; | 1441 | struct GNUNET_PeerIdentity tmpsource; |
1434 | const struct WlanHeader *wlanheader; | 1442 | const struct WlanHeader *wlanheader; |
1435 | int ret; | 1443 | int ret; |
1436 | uint16_t msize; | 1444 | uint16_t msize; |
1437 | 1445 | ||
1438 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); | ||
1439 | #if BUILD_WLAN | ||
1440 | ats.value = htonl (GNUNET_ATS_NET_WLAN); | ||
1441 | #else | ||
1442 | ats.value = htonl (GNUNET_ATS_NET_BT); | ||
1443 | #endif | ||
1444 | msize = ntohs (hdr->size); | 1446 | msize = ntohs (hdr->size); |
1445 | 1447 | ||
1446 | GNUNET_STATISTICS_update (plugin->env->stats, | 1448 | GNUNET_STATISTICS_update (plugin->env->stats, |
@@ -1489,16 +1491,12 @@ process_data (void *cls, | |||
1489 | plugin->env->session_start (plugin->env->cls, | 1491 | plugin->env->session_start (plugin->env->cls, |
1490 | address, | 1492 | address, |
1491 | mas->session, | 1493 | mas->session, |
1492 | &ats, 1); | 1494 | scope); |
1493 | } | 1495 | } |
1494 | plugin->env->receive (plugin->env->cls, | 1496 | plugin->env->receive (plugin->env->cls, |
1495 | address, | 1497 | address, |
1496 | mas->session, | 1498 | mas->session, |
1497 | hdr); | 1499 | hdr); |
1498 | plugin->env->update_address_metrics (plugin->env->cls, | ||
1499 | address, | ||
1500 | mas->session, | ||
1501 | &ats, 1); | ||
1502 | GNUNET_HELLO_address_free (address); | 1500 | GNUNET_HELLO_address_free (address); |
1503 | break; | 1501 | break; |
1504 | case GNUNET_MESSAGE_TYPE_FRAGMENT: | 1502 | case GNUNET_MESSAGE_TYPE_FRAGMENT: |
@@ -1615,7 +1613,7 @@ process_data (void *cls, | |||
1615 | plugin->env->session_start (plugin->env->cls, | 1613 | plugin->env->session_start (plugin->env->cls, |
1616 | address, | 1614 | address, |
1617 | mas->session, | 1615 | mas->session, |
1618 | NULL, 0); | 1616 | scope); |
1619 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1617 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1620 | "Notifying transport about peer `%s''s new session %p \n", | 1618 | "Notifying transport about peer `%s''s new session %p \n", |
1621 | GNUNET_i2s (&wlanheader->sender), | 1619 | GNUNET_i2s (&wlanheader->sender), |
@@ -1654,10 +1652,6 @@ process_data (void *cls, | |||
1654 | mas->session->address, | 1652 | mas->session->address, |
1655 | mas->session, | 1653 | mas->session, |
1656 | hdr); | 1654 | hdr); |
1657 | plugin->env->update_address_metrics (plugin->env->cls, | ||
1658 | mas->session->address, | ||
1659 | mas->session, | ||
1660 | &ats, 1); | ||
1661 | break; | 1655 | break; |
1662 | } | 1656 | } |
1663 | return GNUNET_OK; | 1657 | return GNUNET_OK; |