aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-helper-transport-wlan-dummy.c10
-rw-r--r--src/transport/gnunet-helper-transport-wlan.c4
-rw-r--r--src/transport/gnunet-transport-wlan-sender.c2
-rw-r--r--src/transport/plugin_transport_wlan.c8
-rw-r--r--src/transport/plugin_transport_wlan.h4
5 files changed, 11 insertions, 17 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c
index cd545af65..86e5d4684 100644
--- a/src/transport/gnunet-helper-transport-wlan-dummy.c
+++ b/src/transport/gnunet-helper-transport-wlan-dummy.c
@@ -82,7 +82,7 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
82 struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage newheader; 82 struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage newheader;
83 83
84 in = (const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) hdr; 84 in = (const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) hdr;
85 if ( (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type)) || 85 if ( (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) ||
86 (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) < ntohs (hdr->size)) ) 86 (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) < ntohs (hdr->size)) )
87 { 87 {
88 fprintf (stderr, "Function stdin_send: wrong packet type or size\n"); 88 fprintf (stderr, "Function stdin_send: wrong packet type or size\n");
@@ -96,7 +96,7 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
96 } 96 }
97 memset (&newheader, 0, sizeof (newheader)); 97 memset (&newheader, 0, sizeof (newheader));
98 newheader.header.size = htons (payload_size + sizeof (newheader)); 98 newheader.header.size = htons (payload_size + sizeof (newheader));
99 newheader.header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA); 99 newheader.header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER);
100 newheader.frame = in->frame; 100 newheader.frame = in->frame;
101 memcpy (write_pout->buf + write_pout->size, 101 memcpy (write_pout->buf + write_pout->size,
102 &newheader, 102 &newheader,
@@ -116,12 +116,6 @@ file_in_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
116 uint16_t sendsize; 116 uint16_t sendsize;
117 117
118 sendsize = ntohs (hdr->size); 118 sendsize = ntohs (hdr->size);
119
120 if (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type))
121 {
122 fprintf (stderr, "Function file_in_send: wrong packet type\n");
123 exit (1);
124 }
125 if ((sendsize + write_std->size) > MAXLINE * 2) 119 if ((sendsize + write_std->size) > MAXLINE * 2)
126 { 120 {
127 fprintf (stderr, "Function file_in_send: Packet too big for buffer\n"); 121 fprintf (stderr, "Function file_in_send: Packet too big for buffer\n");
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c
index 0169a2da1..3b5e0b1ab 100644
--- a/src/transport/gnunet-helper-transport-wlan.c
+++ b/src/transport/gnunet-helper-transport-wlan.c
@@ -1795,7 +1795,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1795 sendsize = ntohs (hdr->size); 1795 sendsize = ntohs (hdr->size);
1796 if ( (sendsize < 1796 if ( (sendsize <
1797 sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage)) || 1797 sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage)) ||
1798 (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type)) ) 1798 (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) )
1799 { 1799 {
1800 fprintf (stderr, "Received malformed message\n"); 1800 fprintf (stderr, "Received malformed message\n");
1801 exit (1); 1801 exit (1);
@@ -2039,7 +2039,7 @@ main (int argc, char *argv[])
2039 + sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage) 2039 + sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage)
2040 - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame); 2040 - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame);
2041 rrm->header.size = htons (write_std.size); 2041 rrm->header.size = htons (write_std.size);
2042 rrm->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA); 2042 rrm->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER);
2043 } 2043 }
2044 } 2044 }
2045 } 2045 }
diff --git a/src/transport/gnunet-transport-wlan-sender.c b/src/transport/gnunet-transport-wlan-sender.c
index a6280bc7d..daa8f0269 100644
--- a/src/transport/gnunet-transport-wlan-sender.c
+++ b/src/transport/gnunet-transport-wlan-sender.c
@@ -58,7 +58,7 @@ getRadiotapHeader (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header,
58 uint16_t size) 58 uint16_t size)
59{ 59{
60 header->header.size = htons (size); 60 header->header.size = htons (size);
61 header->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA); 61 header->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER);
62 header->rate = 255; 62 header->rate = 255;
63 header->tx_power = 0; 63 header->tx_power = 0;
64 header->antenna = 0; 64 header->antenna = 0;
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 0c60bd68c..13f414f30 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -1221,7 +1221,7 @@ getRadiotapHeader (struct Plugin *plugin, struct MacEndpoint *endpoint,
1221 struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header, 1221 struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header,
1222 uint16_t size) 1222 uint16_t size)
1223{ 1223{
1224 header->header.type = ntohs (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA); 1224 header->header.type = ntohs (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER);
1225 header->header.size = ntohs (size); 1225 header->header.size = ntohs (size);
1226 if (endpoint != NULL) 1226 if (endpoint != NULL)
1227 { 1227 {
@@ -2778,12 +2778,12 @@ wlan_process_helper (void *cls, void *client,
2778 GNUNET_assert (plugin != NULL); 2778 GNUNET_assert (plugin != NULL);
2779 switch (ntohs (hdr->type)) 2779 switch (ntohs (hdr->type))
2780 { 2780 {
2781 case GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA: 2781 case GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER:
2782 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, 2782 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
2783 "Func wlan_process_helper got GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA size: %u\n", 2783 "Got data message from helper with %u bytes\n",
2784 ntohs (hdr->size)); 2784 ntohs (hdr->size));
2785 GNUNET_STATISTICS_update (plugin->env->stats, 2785 GNUNET_STATISTICS_update (plugin->env->stats,
2786 _("# wlan WLAN_HELPER_DATA received"), 1, 2786 _("# wlan data messages received"), 1,
2787 GNUNET_NO); 2787 GNUNET_NO);
2788 //call wlan_process_helper with the message inside, later with wlan: analyze signal 2788 //call wlan_process_helper with the message inside, later with wlan: analyze signal
2789 if (ntohs (hdr->size) < sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage)) 2789 if (ntohs (hdr->size) < sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage))
diff --git a/src/transport/plugin_transport_wlan.h b/src/transport/plugin_transport_wlan.h
index 96aa434ee..2b70fc0f5 100644
--- a/src/transport/plugin_transport_wlan.h
+++ b/src/transport/plugin_transport_wlan.h
@@ -142,7 +142,7 @@ struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage
142{ 142{
143 143
144 /** 144 /**
145 * Type is 'GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA'. 145 * Type is 'GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER'.
146 */ 146 */
147 struct GNUNET_MessageHeader header; 147 struct GNUNET_MessageHeader header;
148 148
@@ -183,7 +183,7 @@ struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage
183{ 183{
184 184
185 /** 185 /**
186 * Type is 'GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA'. 186 * Type is 'GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER'.
187 */ 187 */
188 struct GNUNET_MessageHeader header; 188 struct GNUNET_MessageHeader header;
189 189