edns

package
Version: v0.0.0-...-dd32194 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package edns provides EDNS0 (RFC6891) support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	Code OptionCode
	Data []byte
}

Option is a EDNS0 option.

func (Option) Length

func (o Option) Length() int

Length returns the encoded RDATA size.

func (Option) Pack

func (o Option) Pack(b []byte) ([]byte, error)

Pack encodes o as RDATA.

func (*Option) Unpack

func (o *Option) Unpack(b []byte) ([]byte, error)

Unpack decodes o from RDATA in b.

type OptionCode

type OptionCode uint16

An OptionCode is a EDNS0 option code.

const (
	// 0	Reserved		[RFC6891]
	OptionCodeLLQ  OptionCode = 1 // On-hold  [RFC6891]
	OptionCodeUL   OptionCode = 2 // On-hold  [http://files.dns-sd.org/draft-sekar-dns-llq.txt]
	OptionCodeNSID OptionCode = 3 // Standard [http://files.dns-sd.org/draft-sekar-dns-ul.txt]
	// 4	Reserved		[draft-cheshire-edns0-owner-option]
	OptionCodeDAU              OptionCode = 5  // Standard [RFC6975]
	OptionCodeDHU              OptionCode = 6  // Standard [RFC6975]
	OptionCodeN3U              OptionCode = 7  // Standard [RFC6975]
	OptionCodeEDNSClientSubnet OptionCode = 8  // Optional [RFC7871]
	OptionCodeEDNSExpire       OptionCode = 9  // Optional [RFC7314]
	OptionCodeCookie           OptionCode = 10 // Standard [RFC7873]
	OptionCodeEDNSTCPKeepAlive OptionCode = 11 // Standard [RFC7828]
	OptionCodePadding          OptionCode = 12 // Standard [RFC7830]
	OptionCodeChain            OptionCode = 13 // Standard [RFC7901]
	OptionCodeEDNSKeyTag       OptionCode = 14 // Optional [RFC8145]
	// 15-26945	Unassigned
	OptionCodeDeviceID OptionCode = 26946 // Optional [https://docs.umbrella.com/developer/networkdevices-api/identifying-dns-traffic2][Brian_Hartvigsen]

)

DNS EDNS0 Option Codes (OPT).

Taken from https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-11

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL