]> git.meshlink.io Git - meshlink/blobdiff - src/mingw/device.c
Started the implementation of route_meshlink that at the moment routes packets based...
[meshlink] / src / mingw / device.c
index aa05972046d544e098914c234d76b83786cf067c..0642725fa5247b9440967ac788e68fd45d5ba407 100644 (file)
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#include "system.h"
+#include "../system.h"
 
 #include <windows.h>
 #include <winioctl.h>
 
-#include "conf.h"
-#include "device.h"
-#include "logger.h"
-#include "names.h"
-#include "net.h"
-#include "route.h"
-#include "utils.h"
-#include "xalloc.h"
+#include "../conf.h"
+#include "../device.h"
+#include "../logger.h"
+#include "../names.h"
+#include "../net.h"
+#include "../route.h"
+#include "../utils.h"
+#include "../xalloc.h"
 
-#include "mingw/common.h"
+#include "common.h"
 
 int device_fd = -1;
 static HANDLE device_handle = INVALID_HANDLE_VALUE;
@@ -80,6 +80,7 @@ static DWORD WINAPI tapreader(void *bla) {
                packet.len = len;
                packet.priority = 0;
                route(myself, &packet);
+               event_flush_output();
                LeaveCriticalSection(&mutex);
        }
 }
@@ -239,16 +240,9 @@ static bool write_packet(vpn_packet_t *packet) {
        return true;
 }
 
-static void dump_device_stats(void) {
-       logger(DEBUG_ALWAYS, LOG_DEBUG, "Statistics for %s %s:", device_info, device);
-       logger(DEBUG_ALWAYS, LOG_DEBUG, " total bytes in:  %10"PRIu64, device_total_in);
-       logger(DEBUG_ALWAYS, LOG_DEBUG, " total bytes out: %10"PRIu64, device_total_out);
-}
-
 const devops_t os_devops = {
        .setup = setup_device,
        .close = close_device,
        .read = read_packet,
        .write = write_packet,
-       .dump_stats = dump_device_stats,
 };