messagehandler

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"fqdn-msg-handler",
	"FQDN Message handler functionality",

	cell.Provide(NewDNSMessageHandler),
)

Cell provides the FQDN Message handler functionality It is responsible for handling DNS messages(requests and responses) sent by the proxy and updating the DNS cache, metrics and policy rules accordingly using the DNSMessageHandler.

Functions

This section is empty.

Types

type DNSMessageHandler

type DNSMessageHandler interface {
	// NotifyOnDNSMsg handles DNS data when the in-agent DNS proxy sees a
	// DNS message. It emits monitor events, proxy metrics and stores DNS
	// data in the DNS cache. To update the DNS cache, it will call
	// UpdateOnDNSMsg() if the DNS message is a response.
	NotifyOnDNSMsg(lookupTime time.Time,
		ep *endpoint.Endpoint,
		epIPPort string,
		serverID identity.NumericIdentity,
		serverAddrPort netip.AddrPort,
		msg *dns.Msg,
		protocol string,
		allowed bool,
		stat *dnsproxy.ProxyRequestContext,
	) error

	// UpdateOnDNSMsg updates the DNS cache with the DNS message data.
	// It is called when the DNS message is a response. It is called by
	// NotifyOnDNSMsg() to update the DNS cache and standalone DNS
	// proxy grpc server with the DNS message data.
	UpdateOnDNSMsg(lookupTime time.Time,
		ep *endpoint.Endpoint,
		qname string,
		responseIPs []netip.Addr,
		TTL int,
		stat *dnsproxy.ProxyRequestContext,
	)

	SetBindPort(uint16)
}

func NewDNSMessageHandler

func NewDNSMessageHandler(params DNSMessageHandlerParams) DNSMessageHandler

type DNSMessageHandlerParams

type DNSMessageHandlerParams struct {
	cell.In

	Lifecycle         cell.Lifecycle
	Logger            *slog.Logger
	NameManager       namemanager.NameManager
	ProxyAccessLogger accesslog.ProxyAccessLogger
}

Jump to

Keyboard shortcuts

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