protocol

package
v0.0.0-...-1bf21ad Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSFlags

type DNSFlags struct {
	QueryResponse       fields.MessageType  `json:"query_response"`
	OpCode              fields.OpCode       `json:"op_code"`
	AuthoritativeAnswer bool                `json:"authoritative_answer"`
	Truncated           bool                `json:"truncated"`
	RecursionDesired    bool                `json:"recursion_desired"`
	RecursionAvailable  bool                `json:"recursion_available"`
	ResponseCode        fields.ResponseCode `json:"response_code"`
}

DNSFlags describe the flags of the DNS header

func (DNSFlags) Uint16

func (flags DNSFlags) Uint16() uint16

type DNSHeader

type DNSHeader struct {
	Identifier                     uint16 `json:"identifier"`
	Flags                          uint16 `json:"flags"`
	TotalQuestions                 uint16 `json:"num_questions"`
	TotalAnswerResourceRecords     uint16 `json:"num_answers"`
	TotalAuthorityResourceRecords  uint16 `json:"num_authority"`
	TotalAdditionalResourceRecords uint16 `json:"num_additional"`
}

DNSHeader describes the DNS header as documented in RFC 1035

type DNSPDU

type DNSPDU struct {
	Header                    DNSHeader           `json:"header"`
	Flags                     DNSFlags            `json:"flags"`
	Questions                 []DNSQuestion       `json:"questions"`
	AnswerResourceRecords     []DNSResourceRecord `json:"answers"`
	AuthorityResourceRecords  []DNSResourceRecord `json:"authority"`
	AdditionalResourceRecords []DNSResourceRecord `json:"additional"`
}

DNSPDU describes the DNS protocol data unit as documented in RFC 1035

func (DNSPDU) Bytes

func (pdu DNSPDU) Bytes() ([]byte, error)

type DNSQuestion

type DNSQuestion struct {
	Labels []string           `json:"labels"`
	Type   fields.RecordType  `json:"type"`
	Class  fields.RecordClass `json:"class"`
}

DNSQuestion describes individual records in the request and response of the DNS payload body

type DNSResourceRecord

type DNSResourceRecord struct {
	Labels             []string           `json:"labels"`
	Type               fields.RecordType  `json:"type"`
	Class              fields.RecordClass `json:"class"`
	TimeToLive         uint32             `json:"ttl"`
	ResourceDataLength uint16             `json:"rd_length"`
	ResourceData       []byte             `json:"rd"`
}

DNSResourceRecord describes individual records in the request and response of the DNS payload body

Jump to

Keyboard shortcuts

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