go/src/vendor/golang.org/x/net/dns/dnsmessage/message.go

type Type

const TypeA

const TypeNS

const TypeCNAME

const TypeSOA

const TypePTR

const TypeMX

const TypeTXT

const TypeAAAA

const TypeSRV

const TypeOPT

const TypeWKS

const TypeHINFO

const TypeMINFO

const TypeAXFR

const TypeALL

var typeNames

// String implements fmt.Stringer.String.
func (t Type) String() string {}

// GoString implements fmt.GoStringer.GoString.
func (t Type) GoString() string {}

type Class

const ClassINET

const ClassCSNET

const ClassCHAOS

const ClassHESIOD

const ClassANY

var classNames

// String implements fmt.Stringer.String.
func (c Class) String() string {}

// GoString implements fmt.GoStringer.GoString.
func (c Class) GoString() string {}

type OpCode

// GoString implements fmt.GoStringer.GoString.
func (o OpCode) GoString() string {}

type RCode

const RCodeSuccess

const RCodeFormatError

const RCodeServerFailure

const RCodeNameError

const RCodeNotImplemented

const RCodeRefused

var rCodeNames

// String implements fmt.Stringer.String.
func (r RCode) String() string {}

// GoString implements fmt.GoStringer.GoString.
func (r RCode) GoString() string {}

func printPaddedUint8(i uint8) string {}

func printUint8Bytes(buf []byte, i uint8) []byte {}

func printByteSlice(b []byte) string {}

const hexDigits

func printString(str []byte) string {}

func printUint16(i uint16) string {}

func printUint32(i uint32) string {}

func printBool(b bool) string {}

var ErrNotStarted

var ErrSectionDone

var errBaseLen

var errCalcLen

var errReserved

var errTooManyPtr

var errInvalidPtr

var errInvalidName

var errNilResouceBody

var errResourceLen

var errSegTooLong

var errNameTooLong

var errZeroSegLen

var errResTooLong

var errTooManyQuestions

var errTooManyAnswers

var errTooManyAuthorities

var errTooManyAdditionals

var errNonCanonicalName

var errStringTooLong

const packStartingCap

const uint16Len

const uint32Len

const headerLen

type nestedError

// nestedError implements error.Error.
func (e *nestedError) Error() string {}

type Header

func (m *Header) pack() (id uint16, bits uint16) {}

// GoString implements fmt.GoStringer.GoString.
func (m *Header) GoString() string {}

type Message

type section

const sectionNotStarted

const sectionHeader

const sectionQuestions

const sectionAnswers

const sectionAuthorities

const sectionAdditionals

const sectionDone

const headerBitQR

const headerBitAA

const headerBitTC

const headerBitRD

const headerBitRA

const headerBitAD

const headerBitCD

var sectionNames

type header

func (h *header) count(sec section) uint16 {}

// pack appends the wire format of the header to msg.
func (h *header) pack(msg []byte) []byte {}

func (h *header) unpack(msg []byte, off int) (int, error) {}

func (h *header) header() Header {}

type Resource

func (r *Resource) GoString() string {}

type ResourceBody

// pack appends the wire format of the Resource to msg.
func (r *Resource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

type Parser

// Start parses the header and enables the parsing of Questions.
func (p *Parser) Start(msg []byte) (Header, error) {}

func (p *Parser) checkAdvance(sec section) error {}

func (p *Parser) resource(sec section) (Resource, error) {}

func (p *Parser) resourceHeader(sec section) (ResourceHeader, error) {}

func (p *Parser) skipResource(sec section) error {}

// Question parses a single Question.
func (p *Parser) Question() (Question, error) {}

// AllQuestions parses all Questions.
func (p *Parser) AllQuestions() ([]Question, error) {}

// SkipQuestion skips a single Question.
func (p *Parser) SkipQuestion() error {}

// SkipAllQuestions skips all Questions.
func (p *Parser) SkipAllQuestions() error {}

// AnswerHeader parses a single Answer ResourceHeader.
func (p *Parser) AnswerHeader() (ResourceHeader, error) {}

// Answer parses a single Answer Resource.
func (p *Parser) Answer() (Resource, error) {}

// AllAnswers parses all Answer Resources.
func (p *Parser) AllAnswers() ([]Resource, error) {}

// SkipAnswer skips a single Answer Resource.
//
// It does not perform a complete validation of the resource header, which means
// it may return a nil error when the [AnswerHeader] would actually return an error.
func (p *Parser) SkipAnswer() error {}

// SkipAllAnswers skips all Answer Resources.
func (p *Parser) SkipAllAnswers() error {}

// AuthorityHeader parses a single Authority ResourceHeader.
func (p *Parser) AuthorityHeader() (ResourceHeader, error) {}

// Authority parses a single Authority Resource.
func (p *Parser) Authority() (Resource, error) {}

// AllAuthorities parses all Authority Resources.
func (p *Parser) AllAuthorities() ([]Resource, error) {}

// SkipAuthority skips a single Authority Resource.
//
// It does not perform a complete validation of the resource header, which means
// it may return a nil error when the [AuthorityHeader] would actually return an error.
func (p *Parser) SkipAuthority() error {}

// SkipAllAuthorities skips all Authority Resources.
func (p *Parser) SkipAllAuthorities() error {}

// AdditionalHeader parses a single Additional ResourceHeader.
func (p *Parser) AdditionalHeader() (ResourceHeader, error) {}

// Additional parses a single Additional Resource.
func (p *Parser) Additional() (Resource, error) {}

// AllAdditionals parses all Additional Resources.
func (p *Parser) AllAdditionals() ([]Resource, error) {}

// SkipAdditional skips a single Additional Resource.
//
// It does not perform a complete validation of the resource header, which means
// it may return a nil error when the [AdditionalHeader] would actually return an error.
func (p *Parser) SkipAdditional() error {}

// SkipAllAdditionals skips all Additional Resources.
func (p *Parser) SkipAllAdditionals() error {}

// CNAMEResource parses a single CNAMEResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) CNAMEResource() (CNAMEResource, error) {}

// MXResource parses a single MXResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) MXResource() (MXResource, error) {}

// NSResource parses a single NSResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) NSResource() (NSResource, error) {}

// PTRResource parses a single PTRResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) PTRResource() (PTRResource, error) {}

// SOAResource parses a single SOAResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) SOAResource() (SOAResource, error) {}

// TXTResource parses a single TXTResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) TXTResource() (TXTResource, error) {}

// SRVResource parses a single SRVResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) SRVResource() (SRVResource, error) {}

// AResource parses a single AResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) AResource() (AResource, error) {}

// AAAAResource parses a single AAAAResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) AAAAResource() (AAAAResource, error) {}

// OPTResource parses a single OPTResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) OPTResource() (OPTResource, error) {}

// UnknownResource parses a single UnknownResource.
//
// One of the XXXHeader methods must have been called before calling this
// method.
func (p *Parser) UnknownResource() (UnknownResource, error) {}

// Unpack parses a full Message.
func (m *Message) Unpack(msg []byte) error {}

// Pack packs a full Message.
func (m *Message) Pack() ([]byte, error) {}

// AppendPack is like Pack but appends the full Message to b and returns the
// extended buffer.
func (m *Message) AppendPack(b []byte) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (m *Message) GoString() string {}

type Builder

// NewBuilder creates a new builder with compression disabled.
//
// Note: Most users will want to immediately enable compression with the
// EnableCompression method. See that method's comment for why you may or may
// not want to enable compression.
//
// The DNS message is appended to the provided initial buffer buf (which may be
// nil) as it is built. The final message is returned by the (*Builder).Finish
// method, which includes buf[:len(buf)] and may return the same underlying
// array if there was sufficient capacity in the slice.
func NewBuilder(buf []byte, h Header) Builder {}

// EnableCompression enables compression in the Builder.
//
// Leaving compression disabled avoids compression related allocations, but can
// result in larger message sizes. Be careful with this mode as it can cause
// messages to exceed the UDP size limit.
//
// According to RFC 1035, section 4.1.4, the use of compression is optional, but
// all implementations must accept both compressed and uncompressed DNS
// messages.
//
// Compression should be enabled before any sections are added for best results.
func (b *Builder) EnableCompression() {}

func (b *Builder) startCheck(s section) error {}

// StartQuestions prepares the builder for packing Questions.
func (b *Builder) StartQuestions() error {}

// StartAnswers prepares the builder for packing Answers.
func (b *Builder) StartAnswers() error {}

// StartAuthorities prepares the builder for packing Authorities.
func (b *Builder) StartAuthorities() error {}

// StartAdditionals prepares the builder for packing Additionals.
func (b *Builder) StartAdditionals() error {}

func (b *Builder) incrementSectionCount() error {}

// Question adds a single Question.
func (b *Builder) Question(q Question) error {}

func (b *Builder) checkResourceSection() error {}

// CNAMEResource adds a single CNAMEResource.
func (b *Builder) CNAMEResource(h ResourceHeader, r CNAMEResource) error {}

// MXResource adds a single MXResource.
func (b *Builder) MXResource(h ResourceHeader, r MXResource) error {}

// NSResource adds a single NSResource.
func (b *Builder) NSResource(h ResourceHeader, r NSResource) error {}

// PTRResource adds a single PTRResource.
func (b *Builder) PTRResource(h ResourceHeader, r PTRResource) error {}

// SOAResource adds a single SOAResource.
func (b *Builder) SOAResource(h ResourceHeader, r SOAResource) error {}

// TXTResource adds a single TXTResource.
func (b *Builder) TXTResource(h ResourceHeader, r TXTResource) error {}

// SRVResource adds a single SRVResource.
func (b *Builder) SRVResource(h ResourceHeader, r SRVResource) error {}

// AResource adds a single AResource.
func (b *Builder) AResource(h ResourceHeader, r AResource) error {}

// AAAAResource adds a single AAAAResource.
func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error {}

// OPTResource adds a single OPTResource.
func (b *Builder) OPTResource(h ResourceHeader, r OPTResource) error {}

// UnknownResource adds a single UnknownResource.
func (b *Builder) UnknownResource(h ResourceHeader, r UnknownResource) error {}

// Finish ends message building and generates a binary message.
func (b *Builder) Finish() ([]byte, error) {}

type ResourceHeader

// GoString implements fmt.GoStringer.GoString.
func (h *ResourceHeader) GoString() string {}

// pack appends the wire format of the ResourceHeader to oldMsg.
//
// lenOff is the offset in msg where the Length field was packed.
func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]uint16, compressionOff int) (msg []byte, lenOff int, err error) {}

func (h *ResourceHeader) unpack(msg []byte, off int) (int, error) {}

// fixLen updates a packed ResourceHeader to include the length of the
// ResourceBody.
//
// lenOff is the offset of the ResourceHeader.Length field in msg.
//
// preLen is the length that msg was before the ResourceBody was packed.
func (h *ResourceHeader) fixLen(msg []byte, lenOff int, preLen int) error {}

const edns0Version

const edns0DNSSECOK

const ednsVersionMask

const edns0DNSSECOKMask

// SetEDNS0 configures h for EDNS(0).
//
// The provided extRCode must be an extended RCode.
func (h *ResourceHeader) SetEDNS0(udpPayloadLen int, extRCode RCode, dnssecOK bool) error {}

// DNSSECAllowed reports whether the DNSSEC OK bit is set.
func (h *ResourceHeader) DNSSECAllowed() bool {}

// ExtendedRCode returns an extended RCode.
//
// The provided rcode must be the RCode in DNS message header.
func (h *ResourceHeader) ExtendedRCode(rcode RCode) RCode {}

func skipResource(msg []byte, off int) (int, error) {}

// packUint16 appends the wire format of field to msg.
func packUint16(msg []byte, field uint16) []byte {}

func unpackUint16(msg []byte, off int) (uint16, int, error) {}

func skipUint16(msg []byte, off int) (int, error) {}

// packType appends the wire format of field to msg.
func packType(msg []byte, field Type) []byte {}

func unpackType(msg []byte, off int) (Type, int, error) {}

func skipType(msg []byte, off int) (int, error) {}

// packClass appends the wire format of field to msg.
func packClass(msg []byte, field Class) []byte {}

func unpackClass(msg []byte, off int) (Class, int, error) {}

func skipClass(msg []byte, off int) (int, error) {}

// packUint32 appends the wire format of field to msg.
func packUint32(msg []byte, field uint32) []byte {}

func unpackUint32(msg []byte, off int) (uint32, int, error) {}

func skipUint32(msg []byte, off int) (int, error) {}

// packText appends the wire format of field to msg.
func packText(msg []byte, field string) ([]byte, error) {}

func unpackText(msg []byte, off int) (string, int, error) {}

// packBytes appends the wire format of field to msg.
func packBytes(msg []byte, field []byte) []byte {}

func unpackBytes(msg []byte, off int, field []byte) (int, error) {}

const nonEncodedNameMax

type Name

// NewName creates a new Name from a string.
func NewName(name string) (Name, error) {}

// MustNewName creates a new Name from a string and panics on error.
func MustNewName(name string) Name {}

// String implements fmt.Stringer.String.
//
// Note: characters inside the labels are not escaped in any way.
func (n Name) String() string {}

// GoString implements fmt.GoStringer.GoString.
func (n *Name) GoString() string {}

// pack appends the wire format of the Name to msg.
//
// Domain names are a sequence of counted strings split at the dots. They end
// with a zero-length string. Compression can be used to reuse domain suffixes.
//
// The compression map will be updated with new domain suffixes. If compression
// is nil, compression will not be used.
func (n *Name) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// unpack unpacks a domain name.
func (n *Name) unpack(msg []byte, off int) (int, error) {}

func skipName(msg []byte, off int) (int, error) {}

type Question

// pack appends the wire format of the Question to msg.
func (q *Question) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (q *Question) GoString() string {}

func unpackResourceBody(msg []byte, off int, hdr ResourceHeader) (ResourceBody, int, error) {}

type CNAMEResource

func (r *CNAMEResource) realType() Type {}

// pack appends the wire format of the CNAMEResource to msg.
func (r *CNAMEResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *CNAMEResource) GoString() string {}

func unpackCNAMEResource(msg []byte, off int) (CNAMEResource, error) {}

type MXResource

func (r *MXResource) realType() Type {}

// pack appends the wire format of the MXResource to msg.
func (r *MXResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *MXResource) GoString() string {}

func unpackMXResource(msg []byte, off int) (MXResource, error) {}

type NSResource

func (r *NSResource) realType() Type {}

// pack appends the wire format of the NSResource to msg.
func (r *NSResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *NSResource) GoString() string {}

func unpackNSResource(msg []byte, off int) (NSResource, error) {}

type PTRResource

func (r *PTRResource) realType() Type {}

// pack appends the wire format of the PTRResource to msg.
func (r *PTRResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *PTRResource) GoString() string {}

func unpackPTRResource(msg []byte, off int) (PTRResource, error) {}

type SOAResource

func (r *SOAResource) realType() Type {}

// pack appends the wire format of the SOAResource to msg.
func (r *SOAResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *SOAResource) GoString() string {}

func unpackSOAResource(msg []byte, off int) (SOAResource, error) {}

type TXTResource

func (r *TXTResource) realType() Type {}

// pack appends the wire format of the TXTResource to msg.
func (r *TXTResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *TXTResource) GoString() string {}

func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) {}

type SRVResource

func (r *SRVResource) realType() Type {}

// pack appends the wire format of the SRVResource to msg.
func (r *SRVResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *SRVResource) GoString() string {}

func unpackSRVResource(msg []byte, off int) (SRVResource, error) {}

type AResource

func (r *AResource) realType() Type {}

// pack appends the wire format of the AResource to msg.
func (r *AResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *AResource) GoString() string {}

func unpackAResource(msg []byte, off int) (AResource, error) {}

type AAAAResource

func (r *AAAAResource) realType() Type {}

// GoString implements fmt.GoStringer.GoString.
func (r *AAAAResource) GoString() string {}

// pack appends the wire format of the AAAAResource to msg.
func (r *AAAAResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

func unpackAAAAResource(msg []byte, off int) (AAAAResource, error) {}

type OPTResource

type Option

// GoString implements fmt.GoStringer.GoString.
func (o *Option) GoString() string {}

func (r *OPTResource) realType() Type {}

func (r *OPTResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *OPTResource) GoString() string {}

func unpackOPTResource(msg []byte, off int, length uint16) (OPTResource, error) {}

type UnknownResource

func (r *UnknownResource) realType() Type {}

// pack appends the wire format of the UnknownResource to msg.
func (r *UnknownResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {}

// GoString implements fmt.GoStringer.GoString.
func (r *UnknownResource) GoString() string {}

func unpackUnknownResource(recordType Type, msg []byte, off int, length uint16) (UnknownResource, error) {}