domain_name
import "github.com/TheManticoreProject/Manticore/network/llmnr/domain_name"
Index
- func DecodeDomainName(data []byte, offset int) (string, int, error)
- func EncodeDomainName(name string) ([]byte, error)
- func ValidateDomainName(name string) error
- type DomainName
func DecodeDomainName
func DecodeDomainName(data []byte, offset int) (string, int, error)
DecodeDomainName parses a domain name from LLMNR/DNS wire format starting at offset. It returns the decoded name, the new offset (past the encoded name in the original stream), and an error if decoding fails.
func EncodeDomainName
func EncodeDomainName(name string) ([]byte, error)
EncodeDomainName serializes a domain name into LLMNR/DNS wire format. Labels are length-prefixed and the sequence is terminated by a zero-length label.
func ValidateDomainName
func ValidateDomainName(name string) error
ValidateDomainName validates a domain name according to LLMNR/DNS label rules.
type DomainName
type DomainName string
func (*DomainName) Marshal
func (d *DomainName) Marshal() ([]byte, error)
func (*DomainName) Unmarshal
func (d *DomainName) Unmarshal(data []byte) (int, error)
Unmarshal decodes a domain name from data starting at offset 0 and sets the receiver. It returns the number of bytes consumed from data.
func (*DomainName) Validate
func (d *DomainName) Validate() error