fakedns

package
v4.45.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_app_dns_fakedns_fakedns_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type FakeDnsPool

type FakeDnsPool struct {
	IpPool  string `protobuf:"bytes,1,opt,name=ip_pool,json=ipPool,proto3" json:"ip_pool,omitempty"` //CIDR of IP pool used as fake DNS IP
	LruSize int64  `protobuf:"varint,2,opt,name=lruSize,proto3" json:"lruSize,omitempty"`            //Size of Pool for remembering relationship between domain name and IP address
	// contains filtered or unexported fields
}

func (*FakeDnsPool) Descriptor deprecated

func (*FakeDnsPool) Descriptor() ([]byte, []int)

Deprecated: Use FakeDnsPool.ProtoReflect.Descriptor instead.

func (*FakeDnsPool) GetIpPool

func (x *FakeDnsPool) GetIpPool() string

func (*FakeDnsPool) GetLruSize

func (x *FakeDnsPool) GetLruSize() int64

func (*FakeDnsPool) ProtoMessage

func (*FakeDnsPool) ProtoMessage()

func (*FakeDnsPool) ProtoReflect

func (x *FakeDnsPool) ProtoReflect() protoreflect.Message

func (*FakeDnsPool) Reset

func (x *FakeDnsPool) Reset()

func (*FakeDnsPool) String

func (x *FakeDnsPool) String() string

type FakeDnsPoolMulti added in v4.38.0

type FakeDnsPoolMulti struct {
	Pools []*FakeDnsPool `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools,omitempty"`
	// contains filtered or unexported fields
}

func (*FakeDnsPoolMulti) Descriptor deprecated added in v4.38.0

func (*FakeDnsPoolMulti) Descriptor() ([]byte, []int)

Deprecated: Use FakeDnsPoolMulti.ProtoReflect.Descriptor instead.

func (*FakeDnsPoolMulti) GetPools added in v4.38.0

func (x *FakeDnsPoolMulti) GetPools() []*FakeDnsPool

func (*FakeDnsPoolMulti) ProtoMessage added in v4.38.0

func (*FakeDnsPoolMulti) ProtoMessage()

func (*FakeDnsPoolMulti) ProtoReflect added in v4.38.0

func (x *FakeDnsPoolMulti) ProtoReflect() protoreflect.Message

func (*FakeDnsPoolMulti) Reset added in v4.38.0

func (x *FakeDnsPoolMulti) Reset()

func (*FakeDnsPoolMulti) String added in v4.38.0

func (x *FakeDnsPoolMulti) String() string

type Holder

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

func NewFakeDNSHolder

func NewFakeDNSHolder() (*Holder, error)

func NewFakeDNSHolderConfigOnly

func NewFakeDNSHolderConfigOnly(conf *FakeDnsPool) (*Holder, error)

func (*Holder) Close

func (fkdns *Holder) Close() error

func (*Holder) GetDomainFromFakeDNS

func (fkdns *Holder) GetDomainFromFakeDNS(ip net.Address) string

GetDomainFromFakeDNS check if an IP is a fake IP and have corresponding domain name

func (*Holder) GetFakeIPForDomain

func (fkdns *Holder) GetFakeIPForDomain(domain string) []net.Address

GetFakeIPForDomain check and generate a fake IP for a domain name

func (*Holder) GetFakeIPForDomain3 added in v4.38.0

func (fkdns *Holder) GetFakeIPForDomain3(domain string, ipv4, ipv6 bool) []net.Address

func (*Holder) IsIPInIPPool added in v4.38.0

func (fkdns *Holder) IsIPInIPPool(ip net.Address) bool

func (*Holder) Start

func (fkdns *Holder) Start() error

func (*Holder) Type

func (*Holder) Type() interface{}

type HolderMulti added in v4.38.0

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

func NewFakeDNSHolderMulti added in v4.38.0

func NewFakeDNSHolderMulti(conf *FakeDnsPoolMulti) (*HolderMulti, error)

func (*HolderMulti) Close added in v4.38.0

func (h *HolderMulti) Close() error

func (*HolderMulti) GetDomainFromFakeDNS added in v4.38.0

func (h *HolderMulti) GetDomainFromFakeDNS(ip net.Address) string

func (*HolderMulti) GetFakeIPForDomain added in v4.38.0

func (h *HolderMulti) GetFakeIPForDomain(domain string) []net.Address

func (*HolderMulti) GetFakeIPForDomain3 added in v4.38.0

func (h *HolderMulti) GetFakeIPForDomain3(domain string, ipv4, ipv6 bool) []net.Address

func (*HolderMulti) IsIPInIPPool added in v4.38.0

func (h *HolderMulti) IsIPInIPPool(ip net.Address) bool

func (*HolderMulti) Start added in v4.38.0

func (h *HolderMulti) Start() error

func (*HolderMulti) Type added in v4.38.0

func (h *HolderMulti) Type() interface{}

Jump to

Keyboard shortcuts

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