Documentation
¶
Index ¶
- func NewLinkWriterToWriter(writer stack.LinkWriter) io.Writer
- type FilterLinkEndpoint
- func (l *FilterLinkEndpoint) Attach(dispatcher stack.NetworkDispatcher)
- func (f *FilterLinkEndpoint) DeliverLinkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
- func (d *FilterLinkEndpoint) DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
- func (d *FilterLinkEndpoint) ReadPacket() (*buf.Buffer, error)
- func (d *FilterLinkEndpoint) WritePacket(p *buf.Buffer) error
- type FilterLinkEndpointToTunDevice
- type GvisorInboundOption
- type IOLinkEndpoint
- type IOLinkEndpointOption
- type ReadWriteCloserSplitUdp
- func (u *ReadWriteCloserSplitUdp) Close() error
- func (u *ReadWriteCloserSplitUdp) Name() string
- func (u *ReadWriteCloserSplitUdp) Read(p []byte) (int, error)
- func (u *ReadWriteCloserSplitUdp) ReadPacket() (*buf.Buffer, error)
- func (u *ReadWriteCloserSplitUdp) Start() error
- func (u *ReadWriteCloserSplitUdp) Write(p []byte) (int, error)
- func (u *ReadWriteCloserSplitUdp) WritePacket(p *buf.Buffer) error
- type StackOption
- func AddProtocolAddress(id tcpip.NICID, ips []*geo.CIDR) StackOption
- func CreateNIC(id tcpip.NICID, linkEndpoint stack.LinkEndpoint) StackOption
- func SetPromiscuousMode(id tcpip.NICID) StackOption
- func SetRouteTable(id tcpip.NICID) StackOption
- func SetSpoofing(id tcpip.NICID) StackOption
- func SetTCPHandler(in *TunGvisorInbound) StackOption
- func SetTCPReceiveBufferSize(defaultSize, maxSize int) StackOption
- func SetTCPSendBufferSize(defaultSize, maxSize int) StackOption
- func SetUDPHandler(in *TunGvisorInbound) StackOption
- type TunGvisorInbound
- func (gi *TunGvisorInbound) Close() error
- func (gi *TunGvisorInbound) CloseBlocking() error
- func (h *TunGvisorInbound) Handle(conn tun_net.TCPConn)
- func (h *TunGvisorInbound) HandleUdp(conn tun_net.UDPConn)
- func (h *TunGvisorInbound) HandleUdpFlow(conn tun_net.UDPConn, src, dest net.Destination)
- func (h *TunGvisorInbound) HandleUdpPacketConn(conn tun_net.UDPConn, src, dest net.Destination)
- func (gi *TunGvisorInbound) Start() error
- func (gi *TunGvisorInbound) Tag() string
- func (gi *TunGvisorInbound) WithHandler(h i.Handler)
- type TunLinkEndpoint
- type TunLinkEndpointOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLinkWriterToWriter ¶
func NewLinkWriterToWriter(writer stack.LinkWriter) io.Writer
Types ¶
type FilterLinkEndpoint ¶
type FilterLinkEndpoint struct {
stack.LinkEndpoint
// contains filtered or unexported fields
}
func NewFilterLinkEndpoint ¶
func NewFilterLinkEndpoint(linkEndpoint stack.LinkEndpoint, reject inboundcommon.Rejector, retainUdp bool) *FilterLinkEndpoint
func (*FilterLinkEndpoint) Attach ¶
func (l *FilterLinkEndpoint) Attach(dispatcher stack.NetworkDispatcher)
func (*FilterLinkEndpoint) DeliverLinkPacket ¶
func (f *FilterLinkEndpoint) DeliverLinkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
func (*FilterLinkEndpoint) DeliverNetworkPacket ¶
func (d *FilterLinkEndpoint) DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
TODO: use dns conn
func (*FilterLinkEndpoint) ReadPacket ¶
func (d *FilterLinkEndpoint) ReadPacket() (*buf.Buffer, error)
func (*FilterLinkEndpoint) WritePacket ¶
func (d *FilterLinkEndpoint) WritePacket(p *buf.Buffer) error
type FilterLinkEndpointToTunDevice ¶
type FilterLinkEndpointToTunDevice struct {
*FilterLinkEndpoint
// contains filtered or unexported fields
}
func NewFilterLinkEndpointToRunnable ¶
func NewFilterLinkEndpointToRunnable(linkEndpoint *FilterLinkEndpoint, name string) *FilterLinkEndpointToTunDevice
func (*FilterLinkEndpointToTunDevice) Close ¶
func (l *FilterLinkEndpointToTunDevice) Close() error
func (*FilterLinkEndpointToTunDevice) Name ¶
func (l *FilterLinkEndpointToTunDevice) Name() string
func (*FilterLinkEndpointToTunDevice) Start ¶
func (l *FilterLinkEndpointToTunDevice) Start() error
type GvisorInboundOption ¶
type IOLinkEndpoint ¶
Read packets from ReadWriter, send the packets to gvisor stack; meanwhile, read packets from gvisor stack, write the packets to ReadWriter rw is owned by IOLinkEndpoint
func NewIOLinkEndpoint ¶
func NewIOLinkEndpoint(rw io.ReadWriteCloser, opts ...IOLinkEndpointOption) *IOLinkEndpoint
rw's ownership is transfered
func (*IOLinkEndpoint) Close ¶
func (e *IOLinkEndpoint) Close()
func (*IOLinkEndpoint) Start ¶
func (e *IOLinkEndpoint) Start() error
type IOLinkEndpointOption ¶
type IOLinkEndpointOption func(*IOLinkEndpoint)
func IOLinkEndpointWithMtu ¶
func IOLinkEndpointWithMtu(mtu uint32) IOLinkEndpointOption
func IOLinkEndpointWithOffset ¶
func IOLinkEndpointWithOffset(offset uint32) IOLinkEndpointOption
func IOLinkEndpointWithRejector ¶
func IOLinkEndpointWithRejector(reject inboundcommon.Rejector) IOLinkEndpointOption
type ReadWriteCloserSplitUdp ¶
type ReadWriteCloserSplitUdp struct {
Rw io.ReadWriteCloser
Offset int32
// contains filtered or unexported fields
}
func NewReadWriteCloserSplitUdp ¶
func NewReadWriteCloserSplitUdp(rw io.ReadWriteCloser, offset int32) *ReadWriteCloserSplitUdp
func (*ReadWriteCloserSplitUdp) Close ¶
func (u *ReadWriteCloserSplitUdp) Close() error
func (*ReadWriteCloserSplitUdp) Name ¶
func (u *ReadWriteCloserSplitUdp) Name() string
func (*ReadWriteCloserSplitUdp) Read ¶
func (u *ReadWriteCloserSplitUdp) Read(p []byte) (int, error)
func (*ReadWriteCloserSplitUdp) ReadPacket ¶
func (u *ReadWriteCloserSplitUdp) ReadPacket() (*buf.Buffer, error)
func (*ReadWriteCloserSplitUdp) Start ¶
func (u *ReadWriteCloserSplitUdp) Start() error
func (*ReadWriteCloserSplitUdp) Write ¶
func (u *ReadWriteCloserSplitUdp) Write(p []byte) (int, error)
func (*ReadWriteCloserSplitUdp) WritePacket ¶
func (u *ReadWriteCloserSplitUdp) WritePacket(p *buf.Buffer) error
type StackOption ¶
func AddProtocolAddress ¶
func AddProtocolAddress(id tcpip.NICID, ips []*geo.CIDR) StackOption
func CreateNIC ¶
func CreateNIC(id tcpip.NICID, linkEndpoint stack.LinkEndpoint) StackOption
func SetPromiscuousMode ¶
func SetPromiscuousMode(id tcpip.NICID) StackOption
func SetRouteTable ¶
func SetRouteTable(id tcpip.NICID) StackOption
func SetSpoofing ¶
func SetSpoofing(id tcpip.NICID) StackOption
func SetTCPHandler ¶
func SetTCPHandler(in *TunGvisorInbound) StackOption
func SetTCPReceiveBufferSize ¶
func SetTCPReceiveBufferSize(defaultSize, maxSize int) StackOption
func SetTCPSendBufferSize ¶
func SetTCPSendBufferSize(defaultSize, maxSize int) StackOption
func SetUDPHandler ¶
func SetUDPHandler(in *TunGvisorInbound) StackOption
type TunGvisorInbound ¶
func NewGvisorInbound ¶
func NewGvisorInbound(option *GvisorInboundOption) (*TunGvisorInbound, error)
func (*TunGvisorInbound) Close ¶
func (gi *TunGvisorInbound) Close() error
func (*TunGvisorInbound) CloseBlocking ¶
func (gi *TunGvisorInbound) CloseBlocking() error
func (*TunGvisorInbound) Handle ¶
func (h *TunGvisorInbound) Handle(conn tun_net.TCPConn)
func (*TunGvisorInbound) HandleUdp ¶
func (h *TunGvisorInbound) HandleUdp(conn tun_net.UDPConn)
func (*TunGvisorInbound) HandleUdpFlow ¶
func (h *TunGvisorInbound) HandleUdpFlow(conn tun_net.UDPConn, src, dest net.Destination)
func (*TunGvisorInbound) HandleUdpPacketConn ¶
func (h *TunGvisorInbound) HandleUdpPacketConn(conn tun_net.UDPConn, src, dest net.Destination)
func (*TunGvisorInbound) Start ¶
func (gi *TunGvisorInbound) Start() error
func (*TunGvisorInbound) Tag ¶
func (gi *TunGvisorInbound) Tag() string
func (*TunGvisorInbound) WithHandler ¶
func (gi *TunGvisorInbound) WithHandler(h i.Handler)
type TunLinkEndpoint ¶
Read packets from ReadWriter, send the packets to gvisor stack; meanwhile, read packets from gvisor stack, write the packets to ReadWriter
func NewTunLinkEndpoint ¶
func NewTunLinkEndpoint(prw tun.TunDeviceWithInfo, mtu uint32, opts ...TunLinkEndpointOption) *TunLinkEndpoint
func (*TunLinkEndpoint) Close ¶
func (e *TunLinkEndpoint) Close()
func (*TunLinkEndpoint) Start ¶
func (e *TunLinkEndpoint) Start() error
type TunLinkEndpointOption ¶
type TunLinkEndpointOption func(*TunLinkEndpoint)
func TunLinkEndpointWithRejector ¶
func TunLinkEndpointWithRejector(reject inboundcommon.Rejector) TunLinkEndpointOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.