Documentation
¶
Index ¶
- func NewNat() *nat
- type ICMPEchoHandler
- type ICMPEchoHandlerOption
- type ICMPHandler
- type Option
- func With4(natIP net.IP, listenIP net.IP, listenPort uint16) Option
- func With6(natIP net.IP, listenIP net.IP, listenPort uint16) Option
- func WithDns(dnsDispatcher dns.DnsConn, dnsAddress []mynet.Destination) Option
- func WithHandler(h i.Handler) Option
- func WithICMPHandler(h ICMPHandler) Option
- func WithRejector(rejector inboundcommon.Rejector) Option
- func WithTag(tag string) Option
- func WithTun(tun tunDevice) Option
- type SrcDst
- type TunSystemInbound
- func (t *TunSystemInbound) ClearICMPRoutes()
- func (t *TunSystemInbound) Close() error
- func (t *TunSystemInbound) Closed() bool
- func (t *TunSystemInbound) Context() context.Context
- func (ti *TunSystemInbound) Start() error
- func (t *TunSystemInbound) Tag() string
- func (t *TunSystemInbound) WritePacket(p *udp.Packet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ICMPEchoHandler ¶ added in v1.6.0
type ICMPEchoHandler struct {
// contains filtered or unexported fields
}
ICMPEchoHandler answers local echo and forwards others via router-selected ICMP outbounds.
func NewICMPEchoHandler ¶ added in v1.6.0
func NewICMPEchoHandler(opt ICMPEchoHandlerOption) *ICMPEchoHandler
func (*ICMPEchoHandler) ClearRoutes ¶ added in v1.6.0
func (h *ICMPEchoHandler) ClearRoutes()
ClearRoutes closes all cached ICMP outbound routes without shutting down the handler.
func (*ICMPEchoHandler) Close ¶ added in v1.6.0
func (h *ICMPEchoHandler) Close() error
type ICMPEchoHandlerOption ¶ added in v1.6.0
type ICMPHandler ¶ added in v1.6.0
type ICMPHandler interface {
Handle(p *buf.Buffer, ipPacket gtcpip.IPPacket)
// ClearRoutes drops cached outbound ICMP sockets so the next echo re-picks a handler.
ClearRoutes()
Close() error
}
ICMPHandler handles ICMP IP packets demuxed by TunSystemInbound. Handle takes ownership of p.
type Option ¶
type Option func(*TunSystemInbound)
func WithHandler ¶
func WithICMPHandler ¶ added in v1.6.0
func WithICMPHandler(h ICMPHandler) Option
func WithRejector ¶
func WithRejector(rejector inboundcommon.Rejector) Option
type TunSystemInbound ¶
type TunSystemInbound struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) *TunSystemInbound
func (*TunSystemInbound) ClearICMPRoutes ¶ added in v1.6.0
func (t *TunSystemInbound) ClearICMPRoutes()
ClearICMPRoutes drops cached ICMP outbound routes (e.g. after routing mode changes).
func (*TunSystemInbound) Close ¶
func (t *TunSystemInbound) Close() error
func (*TunSystemInbound) Closed ¶ added in v1.6.0
func (t *TunSystemInbound) Closed() bool
func (*TunSystemInbound) Context ¶ added in v1.6.0
func (t *TunSystemInbound) Context() context.Context
func (*TunSystemInbound) Start ¶
func (ti *TunSystemInbound) Start() error
func (*TunSystemInbound) Tag ¶
func (t *TunSystemInbound) Tag() string
func (*TunSystemInbound) WritePacket ¶
func (t *TunSystemInbound) WritePacket(p *udp.Packet) error
Click to show internal directories.
Click to hide internal directories.