codec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassMapping

func ClassMapping(class dnsmessage.Class) string

func OpCodeMapping

func OpCodeMapping(code dnsmessage.OpCode) string

func StatusMapping

func StatusMapping(code dnsmessage.RCode) string

func TypeMapping

func TypeMapping(dt dnsmessage.Type) string

Types

type Additional

type Additional struct {
	Name   string `json:"name" yaml:"name"`
	Type   string `json:"type" yaml:"type"`
	Class  string `json:"class" yaml:"class"`
	Record string `json:"record" yaml:"record"`
}

Additional RRs holding additional information

type Answer

type Answer struct {
	Name   string `json:"name" yaml:"name"`
	Type   string `json:"type" yaml:"type"`
	TTL    uint32 `json:"ttl" yaml:"ttl"`
	Class  string `json:"class" yaml:"class"`
	Record string `json:"record" yaml:"record"`
}

Answer RRs answering the question

type Authority

type Authority struct {
	Name   string `json:"name" yaml:"name"`
	Type   string `json:"type" yaml:"type"`
	Class  string `json:"class" yaml:"class"`
	Record string `json:"record" yaml:"record"`
}

Authority RRs pointing toward an authority

type Header struct {
	ID       uint16 `json:"id" yaml:"id"`
	OpCode   string `json:"opcode" yaml:"opcode"`
	Status   string `json:"status" yaml:"status"`
	Response bool   `json:"-" yaml:"-"`
}

Header the header of the dns message

type Message

type Message struct {
	Header        Header       `json:"header" yaml:"header"`
	QuestionSec   Question     `json:"question" yaml:"question"`
	AnswerSec     []Answer     `json:"answer" yaml:"answer"`
	AuthoritySec  []Authority  `json:"authority" yaml:"authority"`
	AdditionalSec []Additional `json:"additional" yaml:"additional"`
}

func Decode

func Decode(b []byte) (*Message, error)

type Question

type Question struct {
	Name string `json:"name" yaml:"name"`
	Type string `json:"type" yaml:"type"`
}

Question the question for the name server

Jump to

Keyboard shortcuts

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