Documentation
¶
Index ¶
- Variables
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAutoOutboundsInterface() string
- func (x *Config) GetAutoSystemRoutingTable() []string
- func (x *Config) GetDNS() []string
- func (x *Config) GetGateway() []string
- func (x *Config) GetMTU() uint32
- func (x *Config) GetName() string
- func (x *Config) GetUserLevel() uint32
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type ConnectionHandler
- type GVisorDevice
- type Handler
- func (t *Handler) Close() error
- func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination)
- func (t *Handler) Init(ctx context.Context, pm policy.Manager, dispatcher routing.Dispatcher) error
- func (t *Handler) Network() []net.Network
- func (t *Handler) Process(ctx context.Context, network net.Network, conn stat.Connection, ...) error
- func (t *Handler) Start() error
- type InterfaceUpdater
- type LinkEndpoint
- func (e *LinkEndpoint) ARPHardwareType() header.ARPHardwareType
- func (e *LinkEndpoint) AddHeader(buffer *stack.PacketBuffer)
- func (e *LinkEndpoint) Attach(dispatcher stack.NetworkDispatcher)
- func (e *LinkEndpoint) Capabilities() stack.LinkEndpointCapabilities
- func (e *LinkEndpoint) Close()
- func (e *LinkEndpoint) IsAttached() bool
- func (e *LinkEndpoint) LinkAddress() tcpip.LinkAddress
- func (e *LinkEndpoint) MTU() uint32
- func (e *LinkEndpoint) MaxHeaderLength() uint16
- func (e *LinkEndpoint) ParseHeader(ptr *stack.PacketBuffer) bool
- func (e *LinkEndpoint) SetLinkAddress(_ tcpip.LinkAddress)
- func (e *LinkEndpoint) SetMTU(_ uint32)
- func (e *LinkEndpoint) SetOnCloseAction(_ func())
- func (e *LinkEndpoint) Wait()
- func (e *LinkEndpoint) WritePackets(packetBufferList stack.PacketBufferList) (int, tcpip.Error)
- type LinuxTun
- type Stack
- type StackOptions
- type Tun
Constants ¶
This section is empty.
Variables ¶
var ErrQueueEmpty = errors.New("queue is empty")
var File_proxy_tun_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
MTU uint32 `protobuf:"varint,2,opt,name=MTU,proto3" json:"MTU,omitempty"`
Gateway []string `protobuf:"bytes,3,rep,name=gateway,proto3" json:"gateway,omitempty"`
DNS []string `protobuf:"bytes,4,rep,name=DNS,proto3" json:"DNS,omitempty"`
UserLevel uint32 `protobuf:"varint,5,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
AutoSystemRoutingTable []string `` /* 131-byte string literal not displayed */
AutoOutboundsInterface string `` /* 129-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Config) Descriptor
deprecated
func (*Config) GetAutoOutboundsInterface ¶
func (*Config) GetAutoSystemRoutingTable ¶
func (*Config) GetGateway ¶
func (*Config) GetUserLevel ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type ConnectionHandler ¶
type ConnectionHandler interface {
HandleConnection(conn net.Conn, destination net.Destination)
}
ConnectionHandler interface with the only method that stack is going to push new connections to
type GVisorDevice ¶
type GVisorDevice interface {
WritePacket(packet *stack.PacketBuffer) tcpip.Error
ReadPacket() (byte, *stack.PacketBuffer, error)
Wait()
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is managing object that tie together tun interface, ip stack and dispatch connections to the routing
func (*Handler) HandleConnection ¶
func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination)
HandleConnection pass the connection coming from the ip stack to the routing dispatcher
func (*Handler) Network ¶
Network implements proxy.Inbound and exists only to comply to proxy interface, declaring it doesn't listen on any network, making the process not open any port for this inbound (input will be network interface)
type InterfaceUpdater ¶
func (*InterfaceUpdater) Get ¶
func (updater *InterfaceUpdater) Get() *net.Interface
func (*InterfaceUpdater) Update ¶
func (updater *InterfaceUpdater) Update()
type LinkEndpoint ¶
type LinkEndpoint struct {
// contains filtered or unexported fields
}
func (*LinkEndpoint) ARPHardwareType ¶
func (e *LinkEndpoint) ARPHardwareType() header.ARPHardwareType
func (*LinkEndpoint) AddHeader ¶
func (e *LinkEndpoint) AddHeader(buffer *stack.PacketBuffer)
func (*LinkEndpoint) Attach ¶
func (e *LinkEndpoint) Attach(dispatcher stack.NetworkDispatcher)
func (*LinkEndpoint) Capabilities ¶
func (e *LinkEndpoint) Capabilities() stack.LinkEndpointCapabilities
func (*LinkEndpoint) Close ¶
func (e *LinkEndpoint) Close()
func (*LinkEndpoint) IsAttached ¶
func (e *LinkEndpoint) IsAttached() bool
func (*LinkEndpoint) LinkAddress ¶
func (e *LinkEndpoint) LinkAddress() tcpip.LinkAddress
func (*LinkEndpoint) MTU ¶
func (e *LinkEndpoint) MTU() uint32
func (*LinkEndpoint) MaxHeaderLength ¶
func (e *LinkEndpoint) MaxHeaderLength() uint16
func (*LinkEndpoint) ParseHeader ¶
func (e *LinkEndpoint) ParseHeader(ptr *stack.PacketBuffer) bool
func (*LinkEndpoint) SetLinkAddress ¶
func (e *LinkEndpoint) SetLinkAddress(_ tcpip.LinkAddress)
func (*LinkEndpoint) SetMTU ¶
func (e *LinkEndpoint) SetMTU(_ uint32)
func (*LinkEndpoint) SetOnCloseAction ¶
func (e *LinkEndpoint) SetOnCloseAction(_ func())
func (*LinkEndpoint) Wait ¶
func (e *LinkEndpoint) Wait()
func (*LinkEndpoint) WritePackets ¶
func (e *LinkEndpoint) WritePackets(packetBufferList stack.PacketBufferList) (int, tcpip.Error)
type LinuxTun ¶
type LinuxTun struct {
// contains filtered or unexported fields
}
LinuxTun is an object that handles tun network interface on linux current version is heavily stripped to do nothing more, then create a network interface, to be provided as file descriptor to gVisor ip stack
type Stack ¶
Stack interface implement ip protocol stack, bridging raw network packets and data streams
type StackOptions ¶
StackOptions for the stack implementation