Documentation
¶
Index ¶
- Variables
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- 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 GVisorTun
- type Handler
- 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
- 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
- type TunOptions
Constants ¶
This section is empty.
Variables ¶
var ErrQueueEmpty = errors.New("queue is empty")
var File_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"`
UserLevel uint32 `protobuf:"varint,3,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
// contains filtered or unexported fields
}
func (*Config) Descriptor
deprecated
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 ¶ added in v1.260131.0
type GVisorDevice interface {
WritePacket(packet *stack.PacketBuffer) tcpip.Error
ReadPacket() (byte, *stack.PacketBuffer, error)
Wait()
}
type GVisorTun ¶
type GVisorTun interface {
// contains filtered or unexported methods
}
GVisorTun implements a bridge to connect gVisor ip stack to tun interface
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
type LinkEndpoint ¶ added in v1.260131.0
type LinkEndpoint struct {
// contains filtered or unexported fields
}
func (*LinkEndpoint) ARPHardwareType ¶ added in v1.260131.0
func (e *LinkEndpoint) ARPHardwareType() header.ARPHardwareType
func (*LinkEndpoint) AddHeader ¶ added in v1.260131.0
func (e *LinkEndpoint) AddHeader(buffer *stack.PacketBuffer)
func (*LinkEndpoint) Attach ¶ added in v1.260131.0
func (e *LinkEndpoint) Attach(dispatcher stack.NetworkDispatcher)
func (*LinkEndpoint) Capabilities ¶ added in v1.260131.0
func (e *LinkEndpoint) Capabilities() stack.LinkEndpointCapabilities
func (*LinkEndpoint) Close ¶ added in v1.260131.0
func (e *LinkEndpoint) Close()
func (*LinkEndpoint) IsAttached ¶ added in v1.260131.0
func (e *LinkEndpoint) IsAttached() bool
func (*LinkEndpoint) LinkAddress ¶ added in v1.260131.0
func (e *LinkEndpoint) LinkAddress() tcpip.LinkAddress
func (*LinkEndpoint) MTU ¶ added in v1.260131.0
func (e *LinkEndpoint) MTU() uint32
func (*LinkEndpoint) MaxHeaderLength ¶ added in v1.260131.0
func (e *LinkEndpoint) MaxHeaderLength() uint16
func (*LinkEndpoint) ParseHeader ¶ added in v1.260131.0
func (e *LinkEndpoint) ParseHeader(ptr *stack.PacketBuffer) bool
func (*LinkEndpoint) SetLinkAddress ¶ added in v1.260131.0
func (e *LinkEndpoint) SetLinkAddress(_ tcpip.LinkAddress)
func (*LinkEndpoint) SetMTU ¶ added in v1.260131.0
func (e *LinkEndpoint) SetMTU(_ uint32)
func (*LinkEndpoint) SetOnCloseAction ¶ added in v1.260131.0
func (e *LinkEndpoint) SetOnCloseAction(_ func())
func (*LinkEndpoint) Wait ¶ added in v1.260131.0
func (e *LinkEndpoint) Wait()
func (*LinkEndpoint) WritePackets ¶ added in v1.260131.0
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
type Tun ¶
Tun interface implements tun interface interaction
func NewTun ¶
func NewTun(options TunOptions) (Tun, error)
NewTun builds new tun interface handler (linux specific)
type TunOptions ¶
TunOptions for tun interface implementation