aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-05-30 22:36:49 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-05-30 22:36:49 +0200
commit1eebdf88a320824b8f155caa1d5c725c38d51de8 (patch)
treec405eff6416526a6627afa84291fa27660148f1a /src/main.go
parentInitial scaffolding (diff)
downloadwireguard-go-1eebdf88a320824b8f155caa1d5c725c38d51de8.tar.xz
wireguard-go-1eebdf88a320824b8f155caa1d5c725c38d51de8.zip
Beginning work on UAPI and routing table
Diffstat (limited to 'src/main.go')
-rw-r--r--src/main.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main.go b/src/main.go
new file mode 100644
index 0000000..0f5016d
--- /dev/null
+++ b/src/main.go
@@ -0,0 +1,28 @@
+package main
+
+import (
+ "fmt"
+ "log"
+ "net"
+)
+
+func main() {
+ l, err := net.Listen("unix", "/var/run/wireguard/wg0.sock")
+ if err != nil {
+ log.Fatal("listen error:", err)
+ }
+
+ for {
+ fd, err := l.Accept()
+ if err != nil {
+ log.Fatal("accept error:", err)
+ }
+
+ var dev Device
+ go func(conn net.Conn) {
+ err := ipcListen(&dev, conn)
+ fmt.Println(err)
+ }(fd)
+ }
+
+}