netstack-smoltcp 0.2.2

A netstack for the special purpose of turning packets from/to a TUN interface into TCP streams and UDP packets. It uses smoltcp-rs as the backend netstack.
Documentation
#__author__: cavivie

param(
    [string]$Cmd = "help",
    [string]$TunName = "utun8",
    [string]$TunGateway = "10.10.10.1"
)

$ErrorActionPreference = "Stop"

# START MAIN-OPTIONS
switch ($Cmd) {
    "add" {
        # tun2 do like this automatically
        New-NetRoute -DestinationPrefix "0.0.0.0/1" -InterfaceAlias $TunName -NextHop "$TunGateway"
        New-NetRoute -DestinationPrefix "128.0.0.0/1" -InterfaceAlias $TunName -NextHop "$TunGateway"
    }
    "del" {
        # tun2 do like this automatically
        Get-NetRoute -DestinationPrefix "0.0.0.0/1" -InterfaceAlias $TunName | Remove-NetRoute
        Get-NetRoute -DestinationPrefix "128.0.0.0/1" -InterfaceAlias $TunName | Remove-NetRoute
    }
    default {
        Write-Host "Usage:
    route add    add tun routes to system route table
    route del    delete routes from system route table
    route help   display all usages of the shell script"
    }
}
# END MAIN-OPTIONS