aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-helper-transport-wlan-dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-helper-transport-wlan-dummy.c')
-rw-r--r--src/transport/gnunet-helper-transport-wlan-dummy.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c
index 684546314..63ed9c4b7 100644
--- a/src/transport/gnunet-helper-transport-wlan-dummy.c
+++ b/src/transport/gnunet-helper-transport-wlan-dummy.c
@@ -120,11 +120,11 @@ send_mac_to_plugin (char *buffer, struct GNUNET_TRANSPORT_WLAN_MacAddress *mac)
120 * type to the output forward and copy it to the buffer for stdout. 120 * type to the output forward and copy it to the buffer for stdout.
121 * 121 *
122 * @param cls the 'struct SendBuffer' to copy the converted message to 122 * @param cls the 'struct SendBuffer' to copy the converted message to
123 * @param client unused
124 * @param hdr inbound message from the FIFO 123 * @param hdr inbound message from the FIFO
125 */ 124 */
126static int 125static int
127stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) 126stdin_send (void *cls,
127 const struct GNUNET_MessageHeader *hdr)
128{ 128{
129 struct SendBuffer *write_pout = cls; 129 struct SendBuffer *write_pout = cls;
130 const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *in; 130 const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *in;
@@ -166,11 +166,11 @@ stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
166 * We read a full message from stdin. Copy it to our send buffer. 166 * We read a full message from stdin. Copy it to our send buffer.
167 * 167 *
168 * @param cls the 'struct SendBuffer' to copy to 168 * @param cls the 'struct SendBuffer' to copy to
169 * @param client unused
170 * @param hdr the message we received to copy to the buffer 169 * @param hdr the message we received to copy to the buffer
171 */ 170 */
172static int 171static int
173file_in_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) 172file_in_send (void *cls,
173 const struct GNUNET_MessageHeader *hdr)
174{ 174{
175 struct SendBuffer *write_std = cls; 175 struct SendBuffer *write_std = cls;
176 uint16_t sendsize; 176 uint16_t sendsize;
@@ -213,8 +213,8 @@ main (int argc, char *argv[])
213 fd_set wfds; 213 fd_set wfds;
214 struct timeval tv; 214 struct timeval tv;
215 int retval; 215 int retval;
216 struct GNUNET_SERVER_MessageStreamTokenizer *stdin_mst = NULL; 216 struct GNUNET_MessageStreamTokenizer *stdin_mst = NULL;
217 struct GNUNET_SERVER_MessageStreamTokenizer *file_in_mst = NULL; 217 struct GNUNET_MessageStreamTokenizer *file_in_mst = NULL;
218 struct GNUNET_TRANSPORT_WLAN_MacAddress macaddr; 218 struct GNUNET_TRANSPORT_WLAN_MacAddress macaddr;
219 int first; 219 int first;
220 220
@@ -340,8 +340,8 @@ main (int argc, char *argv[])
340 write_std.pos = 0; 340 write_std.pos = 0;
341 write_pout.size = 0; 341 write_pout.size = 0;
342 write_pout.pos = 0; 342 write_pout.pos = 0;
343 stdin_mst = GNUNET_SERVER_mst_create (&stdin_send, &write_pout); 343 stdin_mst = GNUNET_MST_create (&stdin_send, &write_pout);
344 file_in_mst = GNUNET_SERVER_mst_create (&file_in_send, &write_std); 344 file_in_mst = GNUNET_MST_create (&file_in_send, &write_std);
345 345
346 /* Send 'random' mac address */ 346 /* Send 'random' mac address */
347 macaddr.mac[0] = 0x13; 347 macaddr.mac[0] = 0x13;
@@ -453,8 +453,9 @@ main (int argc, char *argv[])
453 } 453 }
454 else if (0 < readsize) 454 else if (0 < readsize)
455 { 455 {
456 GNUNET_SERVER_mst_receive (stdin_mst, NULL, readbuf, readsize, 456 GNUNET_MST_from_buffer (stdin_mst,
457 GNUNET_NO, GNUNET_NO); 457 readbuf, readsize,
458 GNUNET_NO, GNUNET_NO);
458 459
459 } 460 }
460 else 461 else
@@ -475,8 +476,9 @@ main (int argc, char *argv[])
475 } 476 }
476 else if (0 < readsize) 477 else if (0 < readsize)
477 { 478 {
478 GNUNET_SERVER_mst_receive (file_in_mst, NULL, readbuf, readsize, 479 GNUNET_MST_from_buffer (file_in_mst,
479 GNUNET_NO, GNUNET_NO); 480 readbuf, readsize,
481 GNUNET_NO, GNUNET_NO);
480 } 482 }
481 else 483 else
482 { 484 {
@@ -489,9 +491,9 @@ main (int argc, char *argv[])
489end: 491end:
490 /* clean up */ 492 /* clean up */
491 if (NULL != stdin_mst) 493 if (NULL != stdin_mst)
492 GNUNET_SERVER_mst_destroy (stdin_mst); 494 GNUNET_MST_destroy (stdin_mst);
493 if (NULL != file_in_mst) 495 if (NULL != file_in_mst)
494 GNUNET_SERVER_mst_destroy (file_in_mst); 496 GNUNET_MST_destroy (file_in_mst);
495 497
496 if (NULL != fpout) 498 if (NULL != fpout)
497 fclose (fpout); 499 fclose (fpout);