Documentation ¶
Index ¶
- Variables
- func NewDeviceWithSorter(overlay device.Device, sorter *tunsorter.TunSorter) device.Device
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetEnablePromiscuousMode() bool
- func (x *Config) GetEnableSpoofing() bool
- func (x *Config) GetIps() []*routercommon.CIDR
- func (x *Config) GetMtu() uint32
- func (x *Config) GetName() string
- func (x *Config) GetPacketEncoding() packetaddr.PacketAddrType
- func (x *Config) GetRoutes() []*routercommon.CIDR
- func (x *Config) GetSniffingSettings() *proxyman.SniffingConfig
- func (x *Config) GetSocketSettings() *internet.SocketConfig
- func (x *Config) GetTag() 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 StackOption
- func AddProtocolAddress(id tcpip.NICID, ips []*routercommon.CIDR) StackOption
- func CreateNIC(id tcpip.NICID, linkEndpoint stack.LinkEndpoint) StackOption
- func SetPromiscuousMode(id tcpip.NICID, enable bool) StackOption
- func SetRouteTable(id tcpip.NICID, routes []*routercommon.CIDR) StackOption
- func SetSpoofing(id tcpip.NICID, enable bool) StackOption
- func SetTCPHandler(ctx context.Context, dispatcher routing.Dispatcher, ...) StackOption
- func SetTCPReceiveBufferSize(size int) StackOption
- func SetTCPSendBufferSize(size int) StackOption
- func SetUDPHandler(ctx context.Context, dispatcher routing.Dispatcher, ...) StackOption
- type TCPHandler
- type TUN
- type UDPHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var File_app_tun_config_proto protoreflect.FileDescriptor
Functions ¶
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"` PacketEncoding packetaddr.PacketAddrType `` /* 150-byte string literal not displayed */ Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"` Ips []*routercommon.CIDR `protobuf:"bytes,6,rep,name=ips,proto3" json:"ips,omitempty"` Routes []*routercommon.CIDR `protobuf:"bytes,7,rep,name=routes,proto3" json:"routes,omitempty"` EnablePromiscuousMode bool `` /* 127-byte string literal not displayed */ EnableSpoofing bool `protobuf:"varint,9,opt,name=enable_spoofing,json=enableSpoofing,proto3" json:"enable_spoofing,omitempty"` SocketSettings *internet.SocketConfig `protobuf:"bytes,10,opt,name=socket_settings,json=socketSettings,proto3" json:"socket_settings,omitempty"` SniffingSettings *proxyman.SniffingConfig `protobuf:"bytes,11,opt,name=sniffing_settings,json=sniffingSettings,proto3" json:"sniffing_settings,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetEnablePromiscuousMode ¶
func (*Config) GetEnableSpoofing ¶
func (*Config) GetIps ¶
func (x *Config) GetIps() []*routercommon.CIDR
func (*Config) GetPacketEncoding ¶
func (x *Config) GetPacketEncoding() packetaddr.PacketAddrType
func (*Config) GetRoutes ¶
func (x *Config) GetRoutes() []*routercommon.CIDR
func (*Config) GetSniffingSettings ¶ added in v5.11.0
func (x *Config) GetSniffingSettings() *proxyman.SniffingConfig
func (*Config) GetSocketSettings ¶
func (x *Config) GetSocketSettings() *internet.SocketConfig
func (*Config) GetUserLevel ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type StackOption ¶
func AddProtocolAddress ¶
func AddProtocolAddress(id tcpip.NICID, ips []*routercommon.CIDR) StackOption
func CreateNIC ¶
func CreateNIC(id tcpip.NICID, linkEndpoint stack.LinkEndpoint) StackOption
func SetPromiscuousMode ¶
func SetPromiscuousMode(id tcpip.NICID, enable bool) StackOption
func SetRouteTable ¶
func SetRouteTable(id tcpip.NICID, routes []*routercommon.CIDR) StackOption
func SetSpoofing ¶
func SetSpoofing(id tcpip.NICID, enable bool) StackOption
func SetTCPHandler ¶
func SetTCPHandler(ctx context.Context, dispatcher routing.Dispatcher, policyManager policy.Manager, config *Config) StackOption
func SetTCPReceiveBufferSize ¶
func SetTCPReceiveBufferSize(size int) StackOption
func SetTCPSendBufferSize ¶
func SetTCPSendBufferSize(size int) StackOption
func SetUDPHandler ¶
func SetUDPHandler(ctx context.Context, dispatcher routing.Dispatcher, policyManager policy.Manager, config *Config) StackOption
type TCPHandler ¶
type TCPHandler struct {
// contains filtered or unexported fields
}
type TUN ¶
type TUN struct {
// contains filtered or unexported fields
}
func (*TUN) CreateStack ¶
type UDPHandler ¶
type UDPHandler struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.