diff options
Diffstat (limited to 'src/main.go')
-rw-r--r-- | src/main.go | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/src/main.go b/src/main.go index b6f6deb..7c58972 100644 --- a/src/main.go +++ b/src/main.go @@ -1,36 +1,30 @@ package main import ( - "fmt" + "log" + "net" ) +/* + * + * TODO: Fix logging + */ + func main() { - fd, err := CreateTUN("test0") - fmt.Println(fd, err) + // Open TUN device - queue := make(chan []byte, 1000) + // TODO: Fix capabilities - // var device Device + tun, err := CreateTUN("test0") + log.Println(tun, err) + if err != nil { + return + } - // go OutgoingRoutingWorker(&device, queue) + device := NewDevice(tun) - for { - tmp := make([]byte, 1<<16) - n, err := fd.Read(tmp) - if err != nil { - break - } - queue <- tmp[:n] - } -} + // Start configuration lister -/* -import ( - "fmt" - "log" - "net" -) -func main() { l, err := net.Listen("unix", "/var/run/wireguard/wg0.sock") if err != nil { log.Fatal("listen error:", err) @@ -41,12 +35,9 @@ func main() { if err != nil { log.Fatal("accept error:", err) } - - var dev Device go func(conn net.Conn) { - err := ipcListen(&dev, conn) - fmt.Println(err) + err := ipcListen(device, conn) + log.Println(err) }(fd) } } -*/ |