Beginning work on UAPI and routing table
This commit is contained in:
parent
6bd0b2fbe2
commit
1eebdf88a3
8 changed files with 529 additions and 0 deletions
28
src/main.go
Normal file
28
src/main.go
Normal file
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue