MCPcopy
hub / github.com/AdguardTeam/dnsproxy / MessageConstructor

Interface MessageConstructor

internal/dnsmsg/constructor.go:12–30  ·  view source on GitHub ↗

MessageConstructor creates DNS messages.

Source from the content-addressed store, hash-verified

10
11// MessageConstructor creates DNS messages.
12type MessageConstructor interface {
13 // NewMsgNXDOMAIN creates a new response message replying to req with the
14 // NXDOMAIN code.
15 NewMsgNXDOMAIN(req *dns.Msg) (resp *dns.Msg)
16
17 // NewMsgSERVFAIL creates a new response message replying to req with the
18 // SERVFAIL code.
19 NewMsgSERVFAIL(req *dns.Msg) (resp *dns.Msg)
20
21 // NewMsgNOTIMPLEMENTED creates a new response message replying to req with
22 // the NOTIMPLEMENTED code.
23 NewMsgNOTIMPLEMENTED(req *dns.Msg) (resp *dns.Msg)
24
25 // NewMsgNODATA creates a new empty response message replying to req with
26 // the NOERROR code.
27 //
28 // See https://www.rfc-editor.org/rfc/rfc2308#section-2.2.
29 NewMsgNODATA(req *dns.Msg) (resp *dns.Msg)
30}
31
32// DefaultMessageConstructor is a default implementation of
33// [MessageConstructor].

Callers 6

replyFromUpstreamMethod · 0.65
validateRequestMethod · 0.65
handleExchangeResultMethod · 0.65
validateRequestMethod · 0.65
validateRequestMethod · 0.65
haltAAAAMethod · 0.65

Implementers 2

DefaultMessageConstructorinternal/dnsmsg/constructor.go
MessageConstructorinternal/dnsproxytest/interface.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…