Versions in this module Expand all Collapse all v1 v1.2.1 Oct 12, 2018 Changes in this version + const BufSize + var OutputFn func([]byte) (int, error) = defaultOutputFn + func FreeBytes(b []byte) + func FreeConnKeyArg(p unsafe.Pointer) + func GetConnKeyVal(p unsafe.Pointer) uint32 + func GetIP4Addr(ipaddr C.struct_ip_addr) string + func GetSyncMapLen(m sync.Map) int + func Input(pkt []byte) error + func MustResolveTCPAddr(addr string, port uint16) net.Addr + func MustResolveUDPAddr(addr string, port uint16) net.Addr + func NewBytes(size int) []byte + func NewConnKeyArg() unsafe.Pointer + func NewTCPConnection(pcb *C.struct_tcp_pcb, handler tun2socks.ConnectionHandler) (tun2socks.Connection, error) + func NewUDPConnection(pcb *C.struct_udp_pcb, handler tun2socks.ConnectionHandler, ...) (tun2socks.Connection, error) + func Output(p *C.struct_pbuf) C.err_t + func RegisterOutputFn(fn func([]byte) (int, error)) + func RegisterTCPConnectionHandler(h tun2socks.ConnectionHandler) + func RegisterUDPConnectionHandler(h tun2socks.ConnectionHandler) + func SetConnKeyVal(p unsafe.Pointer, val uint32) + func SetTCPAcceptCallback(pcb *C.struct_tcp_pcb) + func SetTCPErrCallback(pcb *C.struct_tcp_pcb) + func SetTCPPollCallback(pcb *C.struct_tcp_pcb, interval C.u8_t) + func SetTCPRecvCallback(pcb *C.struct_tcp_pcb) + func SetTCPSentCallback(pcb *C.struct_tcp_pcb) + func SetUDPRecvCallback(pcb *C.struct_udp_pcb, recvArg unsafe.Pointer) + func Setup() + func TCPAcceptFn(arg unsafe.Pointer, newpcb *C.struct_tcp_pcb, err C.err_t) C.err_t + func TCPErrFn(arg unsafe.Pointer, err C.err_t) + func TCPPollFn(arg unsafe.Pointer, tpcb *C.struct_tcp_pcb) C.err_t + func TCPRecvFn(arg unsafe.Pointer, tpcb *C.struct_tcp_pcb, p *C.struct_pbuf, err C.err_t) C.err_t + func TCPSentFn(arg unsafe.Pointer, tpcb *C.struct_tcp_pcb, len C.u16_t) C.err_t + func UDPRecvFn(arg unsafe.Pointer, pcb *C.struct_udp_pcb, p *C.struct_pbuf, addr *C.ip_addr_t, ...)