general: move proxy to separate package

This commit is contained in:
nadoo committed 2018-06-26 16:15:48 +08:00
1 parent 3e09aa9ce0
commit fbbae71314
35 files changed
+1127 -932

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
package redir
import (
"syscall"
"unsafe"
)
// https://github.com/golang/go/blob/9e6b79a5dfb2f6fe4301ced956419a0da83bd025/src/syscall/syscall_linux_386.go#L196
const GETSOCKOPT = 15
func socketcall(call, a0, a1, a2, a3, a4, a5 uintptr) error {
var a [6]uintptr
a[0], a[1], a[2], a[3], a[4], a[5] = a0, a1, a2, a3, a4, a5
if _, _, errno := syscall.Syscall6(syscall.SYS_SOCKETCALL, call, uintptr(unsafe.Pointer(&a)), 0, 0, 0, 0); errno != 0 {
return errno
}
return nil
}