dns

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSCache

type DNSCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*DNSCache) Update

func (c *DNSCache) Update(lookupTime time.Time, qname string, msg *dnsgo.Msg, fqdnsfield ...[]string) (bool, error)

Update DNS cache. It expects that there was only one question to DNS(majority of cases). So it picks first qname and skips all others(if there is).

type DNSHandler

type DNSHandler interface {
	ServeDNS(w dnsgo.ResponseWriter, r *dnsgo.Msg)
	UpdateDNSServerAddr(addr string) error
}

type DNSProxy

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

func NewDNSProxy

func NewDNSProxy(dns string, port *uint, log logr.Logger) (*DNSProxy, error)

func (*DNSProxy) CacheAddr added in v2.3.1

func (p *DNSProxy) CacheAddr() (string, error)

func (*DNSProxy) GetSetsForFQDN

func (p *DNSProxy) GetSetsForFQDN(fqdn firewallv1.FQDNSelector, fqdnSets []firewallv1.IPSet) (result []firewallv1.IPSet)

func (*DNSProxy) GetSetsForRendering

func (p *DNSProxy) GetSetsForRendering(fqdns []firewallv1.FQDNSelector) (result []RenderIPSet)

func (*DNSProxy) IsInitialized

func (p *DNSProxy) IsInitialized() bool

func (*DNSProxy) Run

func (p *DNSProxy) Run(ctx context.Context)

Run starts TCP/UDP servers

func (*DNSProxy) Stop

func (p *DNSProxy) Stop()

Stop starts TCP/UDP servers

func (*DNSProxy) UpdateDNSServerAddr

func (p *DNSProxy) UpdateDNSServerAddr(addr string) error

type DNSProxyHandler

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

func NewDNSProxyHandler

func NewDNSProxyHandler(log logr.Logger, cache *DNSCache) *DNSProxyHandler

func (*DNSProxyHandler) ServeDNS

func (h *DNSProxyHandler) ServeDNS(w dnsgo.ResponseWriter, request *dnsgo.Msg)

func (*DNSProxyHandler) UpdateDNSServerAddr

func (h *DNSProxyHandler) UpdateDNSServerAddr(addr string) error

UpdateDNSServerAddr validates and if successful updates DNS server address

type IPVersion

type IPVersion string
const (

	// Versions specifically for nftables rendering purposes
	IPv4 IPVersion = "ipv4_addr"
	IPv6 IPVersion = "ipv6_addr"
)

type RenderIPSet

type RenderIPSet struct {
	SetName string    `json:"setName,omitempty"`
	IPs     []string  `json:"ips,omitempty"`
	Version IPVersion `json:"version,omitempty"`
}

RenderIPSet stores set info for rendering

Jump to

Keyboard shortcuts

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