fakeip

package
v1.6.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2023 License: GPL-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(name string, ctx context.Context, logger logger.ContextLogger, dialer N.Dialer, link string) (dns.Transport, error)

Types

type MemoryStorage

type MemoryStorage struct {
	// contains filtered or unexported fields
}

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) FakeIPLoad

func (s *MemoryStorage) FakeIPLoad(address netip.Addr) (string, bool)

func (*MemoryStorage) FakeIPLoadDomain added in v1.3.3

func (s *MemoryStorage) FakeIPLoadDomain(domain string, isIPv6 bool) (netip.Addr, bool)

func (*MemoryStorage) FakeIPMetadata

func (s *MemoryStorage) FakeIPMetadata() *adapter.FakeIPMetadata

func (*MemoryStorage) FakeIPReset

func (s *MemoryStorage) FakeIPReset() error

func (*MemoryStorage) FakeIPSaveMetadata

func (s *MemoryStorage) FakeIPSaveMetadata(metadata *adapter.FakeIPMetadata) error

func (*MemoryStorage) FakeIPSaveMetadataAsync added in v1.4.0

func (s *MemoryStorage) FakeIPSaveMetadataAsync(metadata *adapter.FakeIPMetadata)

func (*MemoryStorage) FakeIPStore

func (s *MemoryStorage) FakeIPStore(address netip.Addr, domain string) error

func (*MemoryStorage) FakeIPStoreAsync added in v1.3.3

func (s *MemoryStorage) FakeIPStoreAsync(address netip.Addr, domain string, logger logger.Logger)

type NATPacketConn

type NATPacketConn struct {
	N.PacketConn
	// contains filtered or unexported fields
}

func NewNATPacketConn

func NewNATPacketConn(conn N.PacketConn, origin M.Socksaddr, destination M.Socksaddr) *NATPacketConn

func (*NATPacketConn) CreatePacketReadWaiter

func (c *NATPacketConn) CreatePacketReadWaiter() (N.PacketReadWaiter, bool)

func (*NATPacketConn) ReadPacket

func (c *NATPacketConn) ReadPacket(buffer *buf.Buffer) (destination M.Socksaddr, err error)

func (*NATPacketConn) Upstream

func (c *NATPacketConn) Upstream() any

func (*NATPacketConn) WritePacket

func (c *NATPacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(router adapter.Router, logger logger.Logger, inet4Range netip.Prefix, inet6Range netip.Prefix) *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) Contains

func (s *Store) Contains(address netip.Addr) bool

func (*Store) Create

func (s *Store) Create(domain string, isIPv6 bool) (netip.Addr, error)

func (*Store) Lookup

func (s *Store) Lookup(address netip.Addr) (string, bool)

func (*Store) Reset

func (s *Store) Reset() error

func (*Store) Start

func (s *Store) Start() error

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func (*Transport) Close

func (s *Transport) Close() error

func (*Transport) Exchange

func (s *Transport) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, error)

func (*Transport) Lookup

func (s *Transport) Lookup(ctx context.Context, domain string, strategy dns.DomainStrategy) ([]netip.Addr, error)

func (*Transport) Name

func (s *Transport) Name() string

func (*Transport) Raw

func (s *Transport) Raw() bool

func (*Transport) Reset added in v1.4.0

func (s *Transport) Reset()

func (*Transport) Start

func (s *Transport) Start() error

func (*Transport) Store

func (s *Transport) Store() adapter.FakeIPStore

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL