dnscheck

package
v0.0.0-...-f39c4bf Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// if buffer is full, additional dns requests will not be sent to the watcher
	WebsocketWatcherBufferLength = 500
	WebsocketWatcherMaxLife      = 2 * time.Minute
	WebsocketCloseWait           = time.Second
	WebsocketWriteWait           = time.Second
)
View Source
const TxtFillString = "0000000000000000000000000000000000000000000000000000000000000000000000000" +
	"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +
	"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

Variables

This section is empty.

Functions

This section is empty.

Types

type BadDnssecProvider

type BadDnssecProvider struct {
	KeyTagOverride uint16
	*dnsutil.DnssecProvider
}

func (*BadDnssecProvider) Prove

func (p *BadDnssecProvider) Prove(req, resp *dns.Msg, validFrom, validTo uint32) error

type DnscheckHandler

type DnscheckHandler struct {
	Zone                 string
	Ns                   []string
	HostMasterMbox       string
	Addrs                []net.IP
	ChallengeTarget      string
	LargeResponseLimiter *rate.Limiter
	Watchers             WatcherHub
	BadDnssecProvider    *BadDnssecProvider
	*dnsutil.DnssecProvider
}

func (*DnscheckHandler) Init

func (h *DnscheckHandler) Init(privKeyBytes []byte) *DnscheckHandler

func (*DnscheckHandler) ParseName

func (h *DnscheckHandler) ParseName(name string) *NameProperties

func (*DnscheckHandler) SOA

func (h *DnscheckHandler) SOA(q *dns.Question) dns.RR

func (*DnscheckHandler) ServeDNS

func (h *DnscheckHandler) ServeDNS(w dns.ResponseWriter, req *dns.Msg)

type NameProperties

type NameProperties struct {
	IsApex          bool
	IsAcmeChallenge bool
	Options
}

type Options

type Options struct {
	//
	Random     string // hex
	Watch      bool
	Compress   bool
	Truncate   bool
	NoTruncate bool
	//
	Rcode   int
	NoReply bool
	NullIP  bool
	//
	Padding int // 1 - 4000
	TxtFill int // 1 - 4000
	//
	IPv4Only bool
	IPv6Only bool
	//
	NoSig      bool
	BadSig     bool
	ExpiredSig int // 1 - 99999999; default 86400
}

func (*Options) ParseOptions

func (o *Options) ParseOptions(s string) bool

type SimpleWatcherHub

type SimpleWatcherHub struct {
	MaxSize int
	// contains filtered or unexported fields
}

func (*SimpleWatcherHub) IsRegistered

func (s *SimpleWatcherHub) IsRegistered(watcherId string) bool

func (*SimpleWatcherHub) Register

func (s *SimpleWatcherHub) Register(watcherId string, watcher Watcher) error

func (*SimpleWatcherHub) Send

func (s *SimpleWatcherHub) Send(watcherId string, req *dns.Msg, remoteAddr net.Addr, connState *tls.ConnectionState)

func (*SimpleWatcherHub) Size

func (s *SimpleWatcherHub) Size() int

func (*SimpleWatcherHub) Unregister

func (s *SimpleWatcherHub) Unregister(watcherId string)

type Watcher

type Watcher interface {
	Send(req *dns.Msg, remoteAddr net.Addr, connState *tls.ConnectionState)
}

type WatcherHub

type WatcherHub interface {
	IsRegistered(watcherId string) bool
	Register(watcherId string, watcher Watcher) error
	Send(watcherId string, req *dns.Msg, remoteAddr net.Addr, connState *tls.ConnectionState)
	Unregister(watcherId string)
}

type WebsocketHandler

type WebsocketHandler struct {
	// PathRegex must fully validate the path and capture the watcher key
	PathRegex *regexp.Regexp
	*websocket.Upgrader
	WatcherHub
}

func (*WebsocketHandler) ServeHTTP

func (h *WebsocketHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type WebsocketWatcher

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

func NewWebsocketWatcher

func NewWebsocketWatcher() *WebsocketWatcher

func (*WebsocketWatcher) Send

func (ws *WebsocketWatcher) Send(req *dns.Msg, remoteAddr net.Addr, connState *tls.ConnectionState)

func (*WebsocketWatcher) WriteLoop

func (ws *WebsocketWatcher) WriteLoop(ctx context.Context, conn *websocket.Conn)

type WebsocketWatcherMessage

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

func (*WebsocketWatcherMessage) MarshalJSON

func (msg *WebsocketWatcherMessage) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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