From a645ac0e129f5192260f86e0de327d2bffd6be65 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Wed, 18 Aug 2021 14:11:34 +0200 Subject: [PATCH] Added WIP, removed old thing --- source/libtun/adapter.d | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/libtun/adapter.d b/source/libtun/adapter.d index ac5ab19..92dd880 100644 --- a/source/libtun/adapter.d +++ b/source/libtun/adapter.d @@ -108,15 +108,16 @@ public class TUNAdapter tunWrite(tunFD, cast(char*)buffer.ptr, cast(int)buffer.length); } - public void close() - { - int status = destroyTun(tunFD); - if(status) - { - throw new TUNException("Closing tun interface failed"); - } + public void setDeviceMTU(ushort mtu) + { + /* TODO: Set the MTU on the device */ + + /* TODO: Set the scratchpad to match the MTU */ + scratch.length = mtu; } + + } public final class TUNException : Exception