diff options
author | David Brodski <david@brodski.eu> | 2011-02-01 12:01:07 +0000 |
---|---|---|
committer | David Brodski <david@brodski.eu> | 2011-02-01 12:01:07 +0000 |
commit | 6bec3bca00d8cad55a53485539d951038f07e69d (patch) | |
tree | c2469e5f2e4aa7822635a5420e88b9d99880c60e /src/transport/plugin_transport_wlan.c | |
parent | b956a89cf9ad37967e03bb9d4b5fc67f496378da (diff) | |
download | gnunet-6bec3bca00d8cad55a53485539d951038f07e69d.tar.gz gnunet-6bec3bca00d8cad55a53485539d951038f07e69d.zip |
Some errors fixed, new debug code.
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index d35ef7735..5c9144a2f 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -1040,7 +1040,7 @@ do_transmit(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1040 | struct IeeeHeader * ieeewlanheader = NULL; | 1040 | struct IeeeHeader * ieeewlanheader = NULL; |
1041 | struct RadiotapHeader * radioHeader = NULL; | 1041 | struct RadiotapHeader * radioHeader = NULL; |
1042 | struct GNUNET_MessageHeader * msgheader = NULL; | 1042 | struct GNUNET_MessageHeader * msgheader = NULL; |
1043 | struct GNUNET_MessageHeader * msgheader2 = NULL; | 1043 | |
1044 | struct FragmentationHeader fragheader; | 1044 | struct FragmentationHeader fragheader; |
1045 | struct FragmentationHeader * fragheaderptr = NULL; | 1045 | struct FragmentationHeader * fragheaderptr = NULL; |
1046 | struct Finish_send * finish = NULL; | 1046 | struct Finish_send * finish = NULL; |
@@ -1050,6 +1050,9 @@ do_transmit(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1050 | uint copyoffset = 0; | 1050 | uint copyoffset = 0; |
1051 | struct AckQueue * akt = NULL; | 1051 | struct AckQueue * akt = NULL; |
1052 | 1052 | ||
1053 | #if 0 | ||
1054 | struct GNUNET_MessageHeader * msgheader2 = NULL; | ||
1055 | |||
1053 | //test if a "hello-beacon" has to be send | 1056 | //test if a "hello-beacon" has to be send |
1054 | if (GNUNET_TIME_absolute_get_remaining(plugin->beacon_time).rel_value == 0) | 1057 | if (GNUNET_TIME_absolute_get_remaining(plugin->beacon_time).rel_value == 0) |
1055 | { | 1058 | { |
@@ -1100,6 +1103,8 @@ do_transmit(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1100 | 1103 | ||
1101 | } | 1104 | } |
1102 | 1105 | ||
1106 | #endif | ||
1107 | |||
1103 | fm = plugin->pending_Fragment_Messages_head; | 1108 | fm = plugin->pending_Fragment_Messages_head; |
1104 | GNUNET_assert(fm != NULL); | 1109 | GNUNET_assert(fm != NULL); |
1105 | session = fm->session; | 1110 | session = fm->session; |
@@ -1860,7 +1865,7 @@ wlan_data_helper(void *cls, void * client, const struct GNUNET_MessageHeader * h | |||
1860 | session_light->session = search_session(plugin, session_light->addr); | 1865 | session_light->session = search_session(plugin, session_light->addr); |
1861 | } | 1866 | } |
1862 | session = session_light->session; | 1867 | session = session_light->session; |
1863 | wlanheader = (struct WlanHeader *) &hdr; | 1868 | wlanheader = (struct WlanHeader *) hdr; |
1864 | tempmsg = (char*) &wlanheader[1]; | 1869 | tempmsg = (char*) &wlanheader[1]; |
1865 | temp_hdr = (const struct GNUNET_MessageHeader *) &wlanheader[1]; | 1870 | temp_hdr = (const struct GNUNET_MessageHeader *) &wlanheader[1]; |
1866 | 1871 | ||
@@ -1871,6 +1876,11 @@ wlan_data_helper(void *cls, void * client, const struct GNUNET_MessageHeader * h | |||
1871 | return; | 1876 | return; |
1872 | } | 1877 | } |
1873 | 1878 | ||
1879 | #if DEBUG_wlan | ||
1880 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
1881 | "After crc\n"); | ||
1882 | #endif | ||
1883 | |||
1874 | //if not in session list | 1884 | //if not in session list |
1875 | if (session == NULL) | 1885 | if (session == NULL) |
1876 | { | 1886 | { |
@@ -1878,6 +1888,10 @@ wlan_data_helper(void *cls, void * client, const struct GNUNET_MessageHeader * h | |||
1878 | //try if it is a hello message | 1888 | //try if it is a hello message |
1879 | if (ntohs(temp_hdr->type) == GNUNET_MESSAGE_TYPE_HELLO) | 1889 | if (ntohs(temp_hdr->type) == GNUNET_MESSAGE_TYPE_HELLO) |
1880 | { | 1890 | { |
1891 | #if DEBUG_wlan | ||
1892 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
1893 | "New WLAN Client\n"); | ||
1894 | #endif | ||
1881 | session = create_session(plugin, session_light->addr); | 1895 | session = create_session(plugin, session_light->addr); |
1882 | session_light->session = session; | 1896 | session_light->session = session; |
1883 | GNUNET_assert(GNUNET_HELLO_get_id( | 1897 | GNUNET_assert(GNUNET_HELLO_get_id( |
@@ -1892,15 +1906,30 @@ wlan_data_helper(void *cls, void * client, const struct GNUNET_MessageHeader * h | |||
1892 | return; | 1906 | return; |
1893 | } | 1907 | } |
1894 | } | 1908 | } |
1909 | |||
1910 | #if DEBUG_wlan | ||
1911 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
1912 | "After session\n"); | ||
1913 | #endif | ||
1914 | |||
1895 | //"receive" the message | 1915 | //"receive" the message |
1896 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; | 1916 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; |
1897 | distance[0].type = htonl(GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); | 1917 | distance[0].type = htonl(GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); |
1898 | distance[0].value = htonl(1); | 1918 | distance[0].value = htonl(1); |
1899 | distance[1].type = htonl(GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | 1919 | distance[1].type = htonl(GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); |
1900 | distance[1].value = htonl(0); | 1920 | distance[1].value = htonl(0); |
1901 | plugin->env->receive(plugin, &session->target, temp_hdr, | 1921 | #if DEBUG_wlan |
1922 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
1923 | "After Information\n"); | ||
1924 | #endif | ||
1925 | plugin->env->receive(plugin, &(session->target), temp_hdr, | ||
1902 | (const struct GNUNET_TRANSPORT_ATS_Information *) &distance, 2, | 1926 | (const struct GNUNET_TRANSPORT_ATS_Information *) &distance, 2, |
1903 | session, session->addr, sizeof(session->addr)); | 1927 | session, session->addr, sizeof(session->addr)); |
1928 | #if DEBUG_wlan | ||
1929 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
1930 | "After receive\n"); | ||
1931 | #endif | ||
1932 | |||
1904 | } | 1933 | } |
1905 | 1934 | ||
1906 | else if (ntohs(hdr->type) == GNUNET_MESSAGE_TYPE_WLAN_FRAGMENT) | 1935 | else if (ntohs(hdr->type) == GNUNET_MESSAGE_TYPE_WLAN_FRAGMENT) |
@@ -2052,6 +2081,11 @@ wlan_data_helper(void *cls, void * client, const struct GNUNET_MessageHeader * h | |||
2052 | return; | 2081 | return; |
2053 | } | 2082 | } |
2054 | 2083 | ||
2084 | #if DEBUG_wlan | ||
2085 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
2086 | "Helper finished\n"); | ||
2087 | #endif | ||
2088 | |||
2055 | } | 2089 | } |
2056 | 2090 | ||
2057 | /** | 2091 | /** |