fakedns

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

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

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

func (*FakeDnsPoolMulti) Descriptor deprecated

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

Deprecated: Use FakeDnsPoolMulti.ProtoReflect.Descriptor instead.

func (*FakeDnsPoolMulti) GetPools

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

func (*FakeDnsPoolMulti) ProtoMessage

func (*FakeDnsPoolMulti) ProtoMessage()

func (*FakeDnsPoolMulti) ProtoReflect

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

func (*FakeDnsPoolMulti) Reset

func (x *FakeDnsPoolMulti) Reset()

func (*FakeDnsPoolMulti) String

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 checks if an IP is a fake IP and have corresponding domain name

func (*Holder) GetFakeIPForDomain

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

GetFakeIPForDomain checks and generates a fake IP for a domain name

func (*Holder) GetFakeIPForDomain3

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

func (*Holder) IsIPInIPPool

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

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

func NewFakeDNSHolderMulti

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

func (*HolderMulti) Close

func (h *HolderMulti) Close() error

func (*HolderMulti) GetDomainFromFakeDNS

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

func (*HolderMulti) GetFakeIPForDomain

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

func (*HolderMulti) GetFakeIPForDomain3

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

func (*HolderMulti) IsIPInIPPool

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

func (*HolderMulti) Start

func (h *HolderMulti) Start() error

func (*HolderMulti) Type

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

Jump to

Keyboard shortcuts

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