Documentation ¶
Index ¶
- Constants
- func OpenTun(ifn string) (io.ReadWriteCloser, error)
- type CloseWriter
- type LWIPTun
- func (t *LWIPTun) Connect(conn core.UDPConn, target *net.UDPAddr) error
- func (t *LWIPTun) Handle(conn net.Conn, target *net.TCPAddr) error
- func (t *LWIPTun) ReceiveTo(conn core.UDPConn, data []byte, addr *net.UDPAddr) error
- func (t *LWIPTun) WriteTo(data []byte, dst *net.UDPAddr, src *net.UDPAddr) (int, error)
- type TUNHandler
- type TunConfig
- type UDPHandler
- type UdpWriter
Constants ¶
View Source
const (
MTU = 1500
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloseWriter ¶
type CloseWriter interface {
CloseWrite() error
}
type LWIPTun ¶
type LWIPTun struct {
// contains filtered or unexported fields
}
LWIPTun adapts the LWIP interfaces - in particular UDPConn
func NewTUNFD ¶
func NewTUNFD(tunDev io.ReadWriteCloser, handler TUNHandler, udpNat UDPHandler) *LWIPTun
func (*LWIPTun) Connect ¶
Called by udp_conn.newUDPConn. conn will hold a chan of packets. If err != nil - conn will be closed Else ReceiveTo will be called on each pending packet.
type TUNHandler ¶
Interface implemented by TUNHandler. Important: for android the system makes sure tun is the default route, but packets from the VPN app are excluded.
On Linux we need a similar setup. This still requires iptables to mark packets from istio-proxy, and use 2 routing tables.
type TunConfig ¶
type TunConfig struct { Name string Sniff bool UDPHandler UDPHandler TCPHandler TUNHandler }
Click to show internal directories.
Click to hide internal directories.