adidns

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DnsPropertyIds = []DNSPropertyId{
	{0x00000001, "TYPE"},
	{0x00000002, "ALLOW_UPDATE"},
	{0x00000008, "SECURE_TIME"},
	{0x00000010, "NOREFRESH_INTERVAL"},
	{0x00000020, "REFRESH_INTERVAL"},
	{0x00000040, "AGING_STATE"},
	{0x00000011, "SCAVENGING_SERVERS"},
	{0x00000012, "AGING_ENABLED_TIME"},
	{0x00000080, "DELETED_FROM_HOSTNAME"},
	{0x00000081, "MASTER_SERVERS"},
	{0x00000082, "AUTO_NS_SERVERS"},
	{0x00000083, "DCPROMO_CONVERT"},
	{0x00000090, "SCAVENGING_SERVERS_DA"},
	{0x00000091, "MASTER_SERVERS_DA"},
	{0x00000092, "AUTO_NS_SERVERS_DA"},
	{0x00000100, "NODE_DBFLAGS"},
}
View Source
var DnsRecordTypes map[uint16]string = map[uint16]string{
	0x0000: "ZERO",
	0x0001: "A",
	0x0002: "NS",
	0x0003: "MD",
	0x0004: "MF",
	0x0005: "CNAME",
	0x0006: "SOA",
	0x0007: "MB",
	0x0008: "MG",
	0x0009: "MR",
	0x000A: "NULL",
	0x000B: "WKS",
	0x000C: "PTR",
	0x000D: "HINFO",
	0x000E: "MINFO",
	0x000F: "MX",
	0x0010: "TXT",
	0x0011: "RP",
	0x0012: "AFSDB",
	0x0013: "X25",
	0x0014: "ISDN",
	0x0015: "RT",
	0x0018: "SIG",
	0x0019: "KEY",
	0x001C: "AAAA",
	0x001D: "LOC",
	0x001E: "NXT",
	0x0021: "SRV",
	0x0022: "ATMA",
	0x0023: "NAPTR",
	0x0027: "DNAME",
	0x002B: "DS",
	0x002E: "RRSIG",
	0x002F: "NSEC",
	0x0030: "DNSKEY",
	0x0031: "DHCID",
	0x0032: "NSEC3",
	0x0033: "NSEC3PARAM",
	0x0034: "TLSA",
	0x00FF: "ALL",
	0xFF01: "WINS",
	0xFF02: "WINSR",
}

Helper values

Functions

func FindDcPromoDescription

func FindDcPromoDescription(value uint32) string

func FindPropName

func FindPropName(id uint32) string

func FormatHours

func FormatHours(val uint64) string

func GetPropCellColor

func GetPropCellColor(propId uint32, cellValue string) (string, bool)

func MSTimeToUnixTimestamp

func MSTimeToUnixTimestamp(msTime uint64) int64

msTime is defined as the number of seconds since Jan 1th of 1601 to calculate it we just compute a unix timestamp after removing the difference in seconds between 01/01/1601 and 01/01/1970

func ParseAddrArray

func ParseAddrArray(data []byte) []string

func ParseCountName

func ParseCountName(buf *bytes.Reader) (string, error)

DNS_COUNT_NAME parser

func ParseCountNameSingle

func ParseCountNameSingle(data []byte) (string, error)

func ParseIP

func ParseIP(data []byte) string

func ParseIP4Array

func ParseIP4Array(data []byte) []string

func ParseRpcName

func ParseRpcName(buf *bytes.Reader) (string, error)

DNS_RPC_NAME parser

func ParseRpcNameSingle

func ParseRpcNameSingle(data []byte) (string, error)

Types

type AAAARecord

type AAAARecord struct {
	Address string // Parsed from a [16]byte
}

2.2.2.2.4.16 DNS_RPC_RECORD_AAAA

func (*AAAARecord) Parse

func (v6r *AAAARecord) Parse(data []byte)

type AFSDBRecord

type AFSDBRecord = RecordNamePreference

type ARecord

type ARecord struct {
	Address string // Parsed from a [4]byte
}

2.2.2.2.4.1 DNS_RPC_RECORD_A

func (*ARecord) Parse

func (v4r *ARecord) Parse(data []byte)

type ATMARecord

type ATMARecord struct {
	Format  uint8
	Address string
}

2.2.2.2.4.19 DNS_RPC_RECORD_ATMA

func (*ATMARecord) Parse

func (r *ATMARecord) Parse(data []byte)

type CNAMERecord

type CNAMERecord = RecordNodeName

type DHCIDRecord

type DHCIDRecord struct {
	Digest []byte
}

2.2.2.2.4.14 DNS_RPC_RECORD_DHCID

func (*DHCIDRecord) Parse

func (r *DHCIDRecord) Parse(data []byte)

type DNAMERecord

type DNAMERecord = RecordNodeName

type DNSKEYRecord

type DNSKEYRecord struct {
	Flags     uint16
	Protocol  uint8
	Algorithm uint8
	Key       []byte
}

2.2.2.2.4.15 DNS_RPC_RECORD_DNSKEY

func (*DNSKEYRecord) Parse

func (r *DNSKEYRecord) Parse(data []byte)

type DNSNode

type DNSNode struct {
	DN      string
	Name    string
	Records []DNSRecord
}

type DNSProperty

type DNSProperty struct {
	DataLength uint32
	NameLength uint32
	Flag       uint32
	Version    uint32
	Id         uint32
	Data       []byte
	Name       uint8
}

func (*DNSProperty) Decode

func (p *DNSProperty) Decode(data []byte) error

func (*DNSProperty) Encode

func (p *DNSProperty) Encode() ([]byte, error)

func (*DNSProperty) Format

func (prop *DNSProperty) Format(timeFormat string) string

type DNSPropertyId

type DNSPropertyId struct {
	Id   uint32
	Name string
}

type DNSRecord

type DNSRecord struct {
	DataLength uint16
	Type       uint16
	Version    uint8
	Rank       uint8
	Flags      uint16
	Serial     uint32
	TTLSeconds uint32
	Reserved   uint32
	Timestamp  uint32
	Data       []byte
}

ADIDNS Structures

func (*DNSRecord) Decode

func (d *DNSRecord) Decode(data []byte) error

func (*DNSRecord) Encode

func (d *DNSRecord) Encode() ([]byte, error)

func (*DNSRecord) PrintType

func (d *DNSRecord) PrintType() string

func (*DNSRecord) UnixTimestamp

func (d *DNSRecord) UnixTimestamp() int64

type DNSZone

type DNSZone struct {
	DN    string
	Name  string
	Props []DNSProperty
}

type DSRecord

type DSRecord struct {
	KeyTag     uint16
	Algorithm  uint8
	DigestType uint8
	Digest     []byte
}

2.2.2.2.4.12 DNS_RPC_RECORD_DS

func (*DSRecord) Parse

func (r *DSRecord) Parse(data []byte)

type DcPromoFlag

type DcPromoFlag struct {
	Value       uint32
	Description string
}

type Field

type Field struct {
	Name  any
	Value any
}

type FriendlyRecord

type FriendlyRecord interface {
	// Parses a record from its byte array in the Data field of the
	// DNSRecord attribute
	Parse([]byte)
}

Interface/structure to hold the parsed record fields

type HINFORecord

type HINFORecord = RecordString

type ISDNRecord

type ISDNRecord = RecordString

type KEYRecord

type KEYRecord struct {
	Flags     uint16
	Protocol  uint8
	Algorithm uint8
	Key       []byte
}

2.2.2.2.4.13 DNS_RPC_RECORD_KEY

func (*KEYRecord) Parse

func (r *KEYRecord) Parse(data []byte)

type LOCRecord

type LOCRecord = RecordString

type MBRecord

type MBRecord = RecordNodeName

type MDRecord

type MDRecord = RecordNodeName

type MFRecord

type MFRecord = RecordNodeName

type MGRecord

type MGRecord = RecordNodeName

type MINFORecord

type MINFORecord = RecordMailError

type MRRecord

type MRRecord = RecordNodeName

type MXRecord

type MXRecord = RecordNamePreference

type NAPTRRecord

type NAPTRRecord struct {
	Order        uint16
	Preference   uint16
	Flags        string
	Service      string
	Substitution string
	Replacement  string
}

2.2.2.2.4.20 DNS_RPC_RECORD_NAPTR

func (*NAPTRRecord) Parse

func (r *NAPTRRecord) Parse(data []byte)

type NSEC3PARAMRecord

type NSEC3PARAMRecord struct {
	Algorithm  uint8
	Flags      uint8
	Iterations uint16
	SaltLength uint8
	Salt       []byte
}

2.2.2.2.4.25 DNS_RPC_RECORD_NSEC3PARAM

func (*NSEC3PARAMRecord) Parse

func (r *NSEC3PARAMRecord) Parse(data []byte)

type NSEC3Record

type NSEC3Record struct {
	Algorithm           uint8
	Flags               uint8
	Iterations          uint16
	SaltLength          uint8
	HashLength          uint8
	Salt                []byte
	NextHashedOwnerName []byte
	Bitmaps             []byte
}

2.2.2.2.4.24 DNS_RPC_RECORD_NSEC3

func (*NSEC3Record) Parse

func (r *NSEC3Record) Parse(data []byte)

type NSECRecord

type NSECRecord struct {
	NameSigner string
	NSECBitmap []byte
}

2.2.2.2.4.11 DNS_RPC_RECORD_NSEC

func (*NSECRecord) Parse

func (r *NSECRecord) Parse(data []byte)

type NSRecord

type NSRecord = RecordNodeName

type NULLRecord

type NULLRecord struct {
	Data []byte
}

2.2.2.2.4.4 DNS_RPC_RECORD_NULL

func (*NULLRecord) Parse

func (r *NULLRecord) Parse(data []byte)

type NXTRecord

type NXTRecord struct {
	NumRecordTypes uint16
	TypeWords      []uint16
	NextName       string
}

2.2.2.2.4.17 DNS_RPC_RECORD_NXT

func (*NXTRecord) Parse

func (r *NXTRecord) Parse(data []byte)

type PTRRecord

type PTRRecord = RecordNodeName

type RPRecord

type RPRecord = RecordMailError

type RRSIGRecord

type RRSIGRecord = SIGRecord

2.2.2.2.4.10 DNS_RPC_RECORD_RRSIG

type RTRecord

type RTRecord = RecordNamePreference

type RecordContainer

type RecordContainer struct {
	Name     string
	Contents FriendlyRecord
}

func (RecordContainer) DumpFields

func (rc RecordContainer) DumpFields() []Field

Using a bit of reflection so that I don't have to manually implement a DumpField method on every type

type RecordMailError

type RecordMailError struct {
	MailBX      string
	ErrorMailBX string
}

2.2.2.2.4.7 DNS_RPC_RECORD_MAIL_ERROR

func (*RecordMailError) Parse

func (rs *RecordMailError) Parse(data []byte)

type RecordNamePreference

type RecordNamePreference struct {
	Preference uint16
	Exchange   string
}

2.2.2.2.4.8 DNS_RPC_RECORD_NAME_PREFERENCE

func (*RecordNamePreference) Parse

func (rnp *RecordNamePreference) Parse(data []byte)

type RecordNodeName

type RecordNodeName struct {
	NameNode string
}

2.2.2.2.4.2 DNS_RPC_RECORD_NODE_NAME

func (*RecordNodeName) Parse

func (rnn *RecordNodeName) Parse(data []byte)

type RecordString

type RecordString struct {
	StrData []string
}

2.2.2.2.4.6 DNS_RPC_RECORD_STRING

func (*RecordString) Parse

func (rs *RecordString) Parse(data []byte)

type SIGRecord

type SIGRecord struct {
	TypeCovered   uint16
	Algorithm     uint8
	Labels        uint8
	OriginalTTL   uint32
	SigExpiration uint32
	SigInception  uint32
	KeyTag        uint16
	NameSigner    string
	SignatureInfo []byte
}

2.2.2.2.4.9 DNS_RPC_RECORD_SIG

func (*SIGRecord) Parse

func (r *SIGRecord) Parse(data []byte)

type SOARecord

type SOARecord struct {
	Serial            uint32
	Refresh           uint32
	Retry             uint32
	Expire            uint32
	MinimumTTL        uint32
	NamePrimaryServer string
	ZoneAdminEmail    string
}

2.2.2.2.4.3 DNS_RPC_RECORD_SOA

func (*SOARecord) Parse

func (r *SOARecord) Parse(data []byte)

type SRVRecord

type SRVRecord struct {
	Priority   uint16
	Weight     uint16
	Port       uint16
	NameTarget string
}

2.2.2.2.4.18 DNS_RPC_RECORD_SRV

func (*SRVRecord) Parse

func (r *SRVRecord) Parse(data []byte)

type TLSARecord

type TLSARecord struct {
	CertificateUsage           uint8
	Selector                   uint8
	MatchingType               uint8
	CertificateAssociationData []byte
}

2.2.2.2.4.26 DNS_RPC_RECORD_TLSA

func (*TLSARecord) Parse

func (r *TLSARecord) Parse(data []byte)

type TXTRecord

type TXTRecord = RecordString

type WINSRRecord

type WINSRRecord struct {
	Mapping          uint32
	LookupTimeout    uint32
	CacheTimeout     uint32
	NameResultDomain string
}

2.2.2.2.4.22 DNS_RPC_RECORD_WINSR

func (*WINSRRecord) Parse

func (r *WINSRRecord) Parse(data []byte)

type WINSRecord

type WINSRecord struct {
	MappingFlag   uint32
	LookupTimeout uint32
	CacheTimeout  uint32
	WinsServers   [4]uint32
}

2.2.2.2.4.21 DNS_RPC_RECORD_WINS

func (*WINSRecord) Parse

func (r *WINSRecord) Parse(data []byte)

type WKSRecord

type WKSRecord struct {
	Address  string
	Protocol uint8
	BitMask  []byte
}

2.2.2.2.4.5 DNS_RPC_RECORD_WKS

func (*WKSRecord) Parse

func (r *WKSRecord) Parse(data []byte)

type X25Record

type X25Record = RecordString

type ZERORecord

type ZERORecord struct{}

2.2.2.2.4.23 DNS_RPC_RECORD_TS

func (*ZERORecord) Parse

func (zr *ZERORecord) Parse(data []byte)

Jump to

Keyboard shortcuts

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