Age | Commit message (Collapse) | Author | |
---|---|---|---|
2019-09-08 | main: simplify warnings | Jason A. Donenfeld | |
2019-06-14 | tun: remove TUN prefix from types to reduce stutter elsewhere | Matt Layher | |
Signed-off-by: Matt Layher <mdlayher@gmail.com> | |||
2019-05-14 | global: regroup all imports | Jason A. Donenfeld | |
2019-04-19 | main: revise warnings | Jason A. Donenfeld | |
2019-03-03 | global: begin modularization | Jason A. Donenfeld | |
2019-02-27 | tun: use netpoll instead of rwcancel | Jason A. Donenfeld | |
The new sysconn function of Go 1.12 makes this possible: package main import "log" import "os" import "unsafe" import "time" import "syscall" import "sync" import "golang.org/x/sys/unix" func main() { fd, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 0) if err != nil { log.Fatal(err) } var ifr [unix.IFNAMSIZ + 64]byte copy(ifr[:], []byte("cheese")) *(*uint16)(unsafe.Pointer(&ifr[unix.IFNAMSIZ])) = unix.IFF_TUN var errno syscall.Errno s, _ := fd.SyscallConn() s.Control(func(fd uintptr) { _, _, errno = unix.Syscall( unix.SYS_IOCTL, fd, uintptr(unix.TUNSETIFF), uintptr(unsafe.Pointer(&ifr[0])), ) }) if errno != 0 { log.Fatal(errno) } b := [4]byte{} wait := sync.WaitGroup{} wait.Add(1) go func() { _, err := fd.Read(b[:]) log.Print("Read errored: ", err) wait.Done() }() time.Sleep(time.Second) log.Print("Closing") err = fd.Close() if err != nil { log.Print("Close errored: " , err) } wait.Wait() log.Print("Exiting") } | |||
2019-02-18 | Change package path | Jason A. Donenfeld | |
2019-02-05 | Import windows scafolding | Jason A. Donenfeld | |
2019-02-05 | Update copyright | Jason A. Donenfeld | |
2018-09-16 | global: fix up copyright headers | Jason A. Donenfeld | |
2018-05-30 | Print version number in log | Jason A. Donenfeld | |
2018-05-24 | Catch EINTR | Jason A. Donenfeld | |
2018-05-24 | Add undocumented --version flag | Jason A. Donenfeld | |
2018-05-23 | Adopt GOPATH | Jason A. Donenfeld | |
GOPATH is annoying, but the Go community pushing me to adopt it is even more annoying. | |||
2018-05-23 | Move tun to subpackage | Jason A. Donenfeld | |
2018-05-21 | Minor main.go signal fixes | Filippo Valsorda | |
* Buffer the signal channel as it's non-blocking on the sender side * Notify on SIGTERM instead of the uncatchable SIGKILL License: MIT Signed-off-by: Filippo Valsorda <valsorda@google.com> | |||
2018-05-19 | Add copyright headers | Mathias Hall-Andersen | |
2018-05-14 | Use /dev/null as place holder | Jason A. Donenfeld | |
2018-05-14 | Ugly hack to suppress warning on backgrounded process | Jason A. Donenfeld | |
2018-05-14 | Netlink sockets can't be shutdown | Jason A. Donenfeld | |
2018-05-14 | Clean more | Jason A. Donenfeld | |
2018-05-14 | Optional logging even in background | Jason A. Donenfeld | |
2018-05-10 | Rewrite timers and related state machines | Jason A. Donenfeld | |
2018-05-05 | Removed remaining signals from peer | Mathias Hall-Andersen | |
1. Removed remaining signals from peer struct 2. Made needAnotherKeepalive local 3. Removed environment check from warning text (annoying when debugging) | |||
2018-05-05 | Removed old signals | Mathias Hall-Andersen | |
2018-05-04 | uapi: use kqueue for sock deletion on darwin | Jason A. Donenfeld | |
2018-05-04 | tun: allow darwin to auto assign names | Jason A. Donenfeld | |
2018-05-04 | warning: put into main | Jason A. Donenfeld | |
2018-05-03 | global: Add SPDX tags and copyright header | Jason A. Donenfeld | |
Mathias should probably add his copyright headers to each file too. | |||
2018-05-03 | Daemonize with environment variable | Jason A. Donenfeld | |
2018-05-03 | Start to dust off Darwin | Jason A. Donenfeld | |
2018-04-19 | We can determine the interface name ourselves | Jason A. Donenfeld | |
2018-02-04 | Align with go library layout | Mathias Hall-Andersen | |