Documentation ¶
Index ¶
- Variables
- func EncodeCountName(buf *bytes.Buffer, name string) error
- func EncodeRpcName(buf *bytes.Buffer, name string)
- func FindDcPromoDescription(value uint32) string
- func FindPropName(id uint32) string
- func FindRecordType(rTypeStr string) uint16
- func FormatHours(val uint64) string
- func GetCurrentMSTime() uint32
- func GetPropCellColor(propId uint32, cellValue string) (string, bool)
- func MSTimeToUnixTimestamp(msTime uint64) int64
- func ParseAddrArray(data []byte) []string
- func ParseCountName(buf *bytes.Reader) (string, error)
- func ParseCountNameSingle(data []byte) (string, error)
- func ParseIP(data []byte) string
- func ParseIP4Array(data []byte) []string
- func ParseRpcName(buf *bytes.Reader) (string, error)
- func ParseRpcNameSingle(data []byte) (string, error)
- type AAAARecord
- type AFSDBRecord
- type ARecord
- type ATMARecord
- type CNAMERecord
- type DHCIDRecord
- type DNAMERecord
- type DNSKEYRecord
- type DNSNode
- type DNSProperty
- type DNSPropertyId
- type DNSRecord
- type DNSZone
- type DSRecord
- type DcPromoFlag
- type Field
- type FriendlyRecord
- type HINFORecord
- type ISDNRecord
- type KEYRecord
- type LOCRecord
- type MBRecord
- type MDRecord
- type MFRecord
- type MGRecord
- type MINFORecord
- type MRRecord
- type MXRecord
- type NAPTRRecord
- type NSEC3PARAMRecord
- type NSEC3Record
- type NSECRecord
- type NSRecord
- type NULLRecord
- type NXTRecord
- type PTRRecord
- type RPRecord
- type RRSIGRecord
- type RTRecord
- type RecordMailError
- type RecordNamePreference
- type RecordNodeName
- type RecordString
- type SIGRecord
- type SOARecord
- type SRVRecord
- type TLSARecord
- type TXTRecord
- type WINSRRecord
- type WINSRecord
- type WKSRecord
- type X25Record
- type ZERORecord
Constants ¶
This section is empty.
Variables ¶
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"},
}
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 EncodeRpcName ¶ added in v2.7.4
func FindDcPromoDescription ¶
func FindPropName ¶
func FindRecordType ¶ added in v2.7.4
func FormatHours ¶
func GetCurrentMSTime ¶ added in v2.7.4
func GetCurrentMSTime() uint32
func MSTimeToUnixTimestamp ¶
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 ParseCountNameSingle ¶
func ParseIP4Array ¶
func ParseRpcNameSingle ¶
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) Encode ¶ added in v2.7.4
func (v6r *AAAARecord) Encode() []byte
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
type ATMARecord ¶
2.2.2.2.4.19 DNS_RPC_RECORD_ATMA
func (*ATMARecord) Encode ¶ added in v2.7.4
func (r *ATMARecord) Encode() []byte
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) Encode ¶ added in v2.7.4
func (r *DHCIDRecord) Encode() []byte
func (*DHCIDRecord) Parse ¶
func (r *DHCIDRecord) Parse(data []byte)
type DNAMERecord ¶
type DNAMERecord = RecordNodeName
type DNSKEYRecord ¶
2.2.2.2.4.15 DNS_RPC_RECORD_DNSKEY
func (*DNSKEYRecord) Encode ¶ added in v2.7.4
func (r *DNSKEYRecord) Encode() []byte
func (*DNSKEYRecord) Parse ¶
func (r *DNSKEYRecord) Parse(data []byte)
type DNSProperty ¶
type DNSProperty struct { DataLength uint32 NameLength uint32 Flag uint32 Version uint32 Id uint32 Data []byte Name uint8 }
func MakeProp ¶ added in v2.7.4
func MakeProp(id uint32, data []byte) DNSProperty
func (*DNSProperty) Decode ¶
func (p *DNSProperty) Decode(data []byte) error
func (*DNSProperty) Encode ¶
func (p *DNSProperty) Encode() ([]byte, error)
func (*DNSProperty) ExportFormat ¶ added in v2.7.4
func (prop *DNSProperty) ExportFormat() any
func (*DNSProperty) PrintFormat ¶ added in v2.7.4
func (prop *DNSProperty) PrintFormat(timeFormat string) string
type DNSPropertyId ¶
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 MakeDNSRecord ¶ added in v2.7.4
func MakeDNSRecord(rec FriendlyRecord, recType uint16, ttl uint32) DNSRecord
func (*DNSRecord) UnixTimestamp ¶
type DNSZone ¶
type DNSZone struct { DN string Name string Props []DNSProperty }
type DcPromoFlag ¶
type Field ¶
Using a bit of reflection so that I don't have to manually implement a DumpField method on every type
func DumpRecordFields ¶ added in v2.7.4
func DumpRecordFields(fr FriendlyRecord) []Field
type FriendlyRecord ¶
type FriendlyRecord interface { // Parses a record from its byte array in the Data field of the // DNSRecord AD attribute Parse([]byte) // Encode the record into a byte array to be used in the Data field // of the DNSRecord AD attribute Encode() []byte }
Interface to hold the parsed record fields
type HINFORecord ¶
type HINFORecord = RecordString
type ISDNRecord ¶
type ISDNRecord = RecordString
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) Encode ¶ added in v2.7.4
func (r *NAPTRRecord) Encode() []byte
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) Encode ¶ added in v2.7.4
func (r *NSEC3PARAMRecord) Encode() []byte
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) Encode ¶ added in v2.7.4
func (r *NSEC3Record) Encode() []byte
func (*NSEC3Record) Parse ¶
func (r *NSEC3Record) Parse(data []byte)
type NSECRecord ¶
2.2.2.2.4.11 DNS_RPC_RECORD_NSEC
func (*NSECRecord) Encode ¶ added in v2.7.4
func (r *NSECRecord) Encode() []byte
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) Encode ¶ added in v2.7.4
func (r *NULLRecord) Encode() []byte
func (*NULLRecord) Parse ¶
func (r *NULLRecord) Parse(data []byte)
type PTRRecord ¶
type PTRRecord = RecordNodeName
type RPRecord ¶
type RPRecord = RecordMailError
type RTRecord ¶
type RTRecord = RecordNamePreference
type RecordMailError ¶
2.2.2.2.4.7 DNS_RPC_RECORD_MAIL_ERROR
func (*RecordMailError) Encode ¶ added in v2.7.4
func (rs *RecordMailError) Encode() []byte
func (*RecordMailError) Parse ¶
func (rs *RecordMailError) Parse(data []byte)
type RecordNamePreference ¶
2.2.2.2.4.8 DNS_RPC_RECORD_NAME_PREFERENCE
func (*RecordNamePreference) Encode ¶ added in v2.7.4
func (rnp *RecordNamePreference) Encode() []byte
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) Encode ¶ added in v2.7.4
func (rnn *RecordNodeName) Encode() []byte
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) Encode ¶ added in v2.7.4
func (rs *RecordString) Encode() []byte
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
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
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) Encode ¶ added in v2.7.4
func (r *TLSARecord) Encode() []byte
func (*TLSARecord) Parse ¶
func (r *TLSARecord) Parse(data []byte)
type TXTRecord ¶
type TXTRecord = RecordString
type WINSRRecord ¶
type WINSRRecord struct { MappingFlag uint32 LookupTimeout uint32 CacheTimeout uint32 NameResultDomain string }
2.2.2.2.4.22 DNS_RPC_RECORD_WINSR
func (*WINSRRecord) Encode ¶ added in v2.7.4
func (r *WINSRRecord) Encode() []byte
func (*WINSRRecord) Parse ¶
func (r *WINSRRecord) Parse(data []byte)
type WINSRecord ¶
type WINSRecord struct { MappingFlag uint32 LookupTimeout uint32 CacheTimeout uint32 WinsSrvCount uint32 WinsServers []uint32 }
2.2.2.2.4.21 DNS_RPC_RECORD_WINS
func (*WINSRecord) Encode ¶ added in v2.7.4
func (r *WINSRecord) Encode() []byte
func (*WINSRecord) Parse ¶
func (r *WINSRecord) 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) Encode ¶ added in v2.7.4
func (zr *ZERORecord) Encode() []byte
func (*ZERORecord) Parse ¶
func (zr *ZERORecord) Parse(data []byte)