dnsmsg

package
v0.75.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package dnsmsg contains common constants, functions, and types for inspecting and constructing DNS messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultMessageConstructor

type DefaultMessageConstructor struct{}

DefaultMessageConstructor is a default implementation of MessageConstructor.

func (DefaultMessageConstructor) NewMsgNODATA

func (DefaultMessageConstructor) NewMsgNODATA(req *dns.Msg) (resp *dns.Msg)

NewMsgNODATA implements the MessageConstructor interface for DefaultMessageConstructor.

func (DefaultMessageConstructor) NewMsgNOTIMPLEMENTED

func (DefaultMessageConstructor) NewMsgNOTIMPLEMENTED(req *dns.Msg) (resp *dns.Msg)

NewMsgNOTIMPLEMENTED implements the MessageConstructor interface for DefaultMessageConstructor.

func (DefaultMessageConstructor) NewMsgNXDOMAIN

func (DefaultMessageConstructor) NewMsgNXDOMAIN(req *dns.Msg) (resp *dns.Msg)

NewMsgNXDOMAIN implements the MessageConstructor interface for DefaultMessageConstructor.

func (DefaultMessageConstructor) NewMsgSERVFAIL

func (DefaultMessageConstructor) NewMsgSERVFAIL(req *dns.Msg) (resp *dns.Msg)

NewMsgSERVFAIL implements the MessageConstructor interface for DefaultMessageConstructor.

type MessageConstructor

type MessageConstructor interface {
	// NewMsgNXDOMAIN creates a new response message replying to req with the
	// NXDOMAIN code.
	NewMsgNXDOMAIN(req *dns.Msg) (resp *dns.Msg)

	// NewMsgSERVFAIL creates a new response message replying to req with the
	// SERVFAIL code.
	NewMsgSERVFAIL(req *dns.Msg) (resp *dns.Msg)

	// NewMsgNOTIMPLEMENTED creates a new response message replying to req with
	// the NOTIMPLEMENTED code.
	NewMsgNOTIMPLEMENTED(req *dns.Msg) (resp *dns.Msg)

	// NewMsgNODATA creates a new empty response message replying to req with
	// the NOERROR code.
	//
	// See https://www.rfc-editor.org/rfc/rfc2308#section-2.2.
	NewMsgNODATA(req *dns.Msg) (resp *dns.Msg)
}

MessageConstructor creates DNS messages.

Jump to

Keyboard shortcuts

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