aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_wlan.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-07 20:48:22 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-07 20:48:22 +0000
commit6425a698e0470491ef0ac5b44e58e0ba069bc156 (patch)
tree9da94f473958264f534e9078a7854676141daa20 /src/transport/plugin_transport_wlan.c
parent1f0049fedb1762160919ba1038624dd3595f42f1 (diff)
downloadgnunet-6425a698e0470491ef0ac5b44e58e0ba069bc156.tar.gz
gnunet-6425a698e0470491ef0ac5b44e58e0ba069bc156.zip
-ugh
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r--src/transport/plugin_transport_wlan.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 0e59b6852..a6da2f688 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -513,6 +513,17 @@ struct Session
513 */ 513 */
514struct MacEndpoint 514struct MacEndpoint
515{ 515{
516
517 /**
518 * dll next
519 */
520 struct MacEndpoint *next;
521
522 /**
523 * dll prev
524 */
525 struct MacEndpoint *prev;
526
516 /** 527 /**
517 * Pointer to the global plugin struct. 528 * Pointer to the global plugin struct.
518 */ 529 */
@@ -541,16 +552,6 @@ struct MacEndpoint
541 struct FragmentMessage *sending_messages_tail; 552 struct FragmentMessage *sending_messages_tail;
542 553
543 /** 554 /**
544 * dll next
545 */
546 struct MacEndpoint *next;
547
548 /**
549 * dll prev
550 */
551 struct MacEndpoint *prev;
552
553 /**
554 * peer mac address 555 * peer mac address
555 */ 556 */
556 struct GNUNET_TRANSPORT_WLAN_MacAddress addr; 557 struct GNUNET_TRANSPORT_WLAN_MacAddress addr;
@@ -1460,33 +1461,27 @@ wlan_transport_stop_wlan_helper (struct Plugin *plugin)
1460 "wlan_transport_stop_wlan_helper not needed, helper already stopped!"); 1461 "wlan_transport_stop_wlan_helper not needed, helper already stopped!");
1461 return GNUNET_YES; 1462 return GNUNET_YES;
1462 } 1463 }
1463
1464 if (plugin->server_write_delay_task != GNUNET_SCHEDULER_NO_TASK) 1464 if (plugin->server_write_delay_task != GNUNET_SCHEDULER_NO_TASK)
1465 { 1465 {
1466 GNUNET_SCHEDULER_cancel (plugin->server_write_delay_task); 1466 GNUNET_SCHEDULER_cancel (plugin->server_write_delay_task);
1467 plugin->server_write_delay_task = GNUNET_SCHEDULER_NO_TASK; 1467 plugin->server_write_delay_task = GNUNET_SCHEDULER_NO_TASK;
1468 } 1468 }
1469
1470 if (plugin->server_write_task != GNUNET_SCHEDULER_NO_TASK) 1469 if (plugin->server_write_task != GNUNET_SCHEDULER_NO_TASK)
1471 { 1470 {
1472 GNUNET_SCHEDULER_cancel (plugin->server_write_task); 1471 GNUNET_SCHEDULER_cancel (plugin->server_write_task);
1473 plugin->server_write_task = GNUNET_SCHEDULER_NO_TASK; 1472 plugin->server_write_task = GNUNET_SCHEDULER_NO_TASK;
1474 } 1473 }
1475
1476 if (plugin->server_read_task != GNUNET_SCHEDULER_NO_TASK) 1474 if (plugin->server_read_task != GNUNET_SCHEDULER_NO_TASK)
1477 { 1475 {
1478 GNUNET_SCHEDULER_cancel (plugin->server_read_task); 1476 GNUNET_SCHEDULER_cancel (plugin->server_read_task);
1479 plugin->server_read_task = GNUNET_SCHEDULER_NO_TASK; 1477 plugin->server_read_task = GNUNET_SCHEDULER_NO_TASK;
1480 } 1478 }
1481
1482 GNUNET_DISK_pipe_close (plugin->server_stdout); 1479 GNUNET_DISK_pipe_close (plugin->server_stdout);
1483 GNUNET_DISK_pipe_close (plugin->server_stdin); 1480 GNUNET_DISK_pipe_close (plugin->server_stdin);
1484 GNUNET_OS_process_kill (plugin->server_proc, SIGKILL); 1481 GNUNET_OS_process_kill (plugin->server_proc, SIGKILL);
1485 GNUNET_OS_process_wait (plugin->server_proc); 1482 GNUNET_OS_process_wait (plugin->server_proc);
1486 GNUNET_OS_process_close (plugin->server_proc); 1483 GNUNET_OS_process_close (plugin->server_proc);
1487
1488 plugin->helper_is_running = GNUNET_NO; 1484 plugin->helper_is_running = GNUNET_NO;
1489
1490 return GNUNET_YES; 1485 return GNUNET_YES;
1491} 1486}
1492 1487
@@ -1598,7 +1593,8 @@ finish_sending (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1598 1593
1599 1594
1600/** 1595/**
1601 * function to send a hello beacon 1596 * Function to send a HELLO beacon
1597 *
1602 * @param plugin pointer to the plugin struct 1598 * @param plugin pointer to the plugin struct
1603 */ 1599 */
1604static void 1600static void
@@ -1630,9 +1626,8 @@ send_hello_beacon (struct Plugin *plugin)
1630 if (bytes == GNUNET_SYSERR) 1626 if (bytes == GNUNET_SYSERR)
1631 { 1627 {
1632 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME, 1628 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME,
1633 _ 1629 _("Error writing to WLAN helper: %s\n"),
1634 ("Error writing to wlan helper. errno == %d, ERROR: %s\n"), 1630 STRERROR (errno));
1635 errno, strerror (errno));
1636 finish = GNUNET_malloc (sizeof (struct Finish_send)); 1631 finish = GNUNET_malloc (sizeof (struct Finish_send));
1637 finish->plugin = plugin; 1632 finish->plugin = plugin;
1638 finish->head_of_next_write = NULL; 1633 finish->head_of_next_write = NULL;
@@ -1866,7 +1861,7 @@ do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1866 set_next_send (plugin); 1861 set_next_send (plugin);
1867 return; 1862 return;
1868 } 1863 }
1869 GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan fragments send"), 1, 1864 GNUNET_STATISTICS_update (plugin->env->stats, _("# WLAN fragments sent"), 1,
1870 GNUNET_NO); 1865 GNUNET_NO);
1871 1866
1872 fmq = plugin->sending_messages_head; 1867 fmq = plugin->sending_messages_head;
@@ -1893,9 +1888,8 @@ do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1893 if (bytes == GNUNET_SYSERR) 1888 if (bytes == GNUNET_SYSERR)
1894 { 1889 {
1895 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME, 1890 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME,
1896 _ 1891 _("Error writing to WLAN helper: %s\n"),
1897 ("Error writing to wlan helper. errno == %d, ERROR: %s\n"), 1892 STRERROR (errno));
1898 errno, strerror (errno));
1899 finish->head_of_next_write = (char*) fm->radioHeader; 1893 finish->head_of_next_write = (char*) fm->radioHeader;
1900 finish->size = ntohs (fm->radioHeader->header.size); 1894 finish->size = ntohs (fm->radioHeader->header.size);
1901 restart_helper (plugin, finish); 1895 restart_helper (plugin, finish);