func EncodeDNS(name string) ([kernel.DNSMaxLength]byte, error) {
	buf := [kernel.DNSMaxLength]byte{}
	if len(name)+1 > kernel.DNSMaxLength {
		return buf, errors.New("DNS name too long")
	}
	i := 0
	for _, label := range strings.Split(name, ".") {
		sublen := len(label)
		if sublen > kernel.DNSMaxLabelLength {
			return buf, errors.New("DNS label too long")
		}
		buf[i] = byte(sublen)
		copy(buf[i+1:], label)
		i = i + sublen + 1
	}
	return buf, nil
}
// EncodeDNS - Returns the DNS packet representation of a domain name
Returns the DNS packet representation of a domain name
// EncodeDNS - Returns the DNS packet representation of a domain name
func EncodeDNS(name string) ([kernel.DNSMaxLength]byte, error) {
	buf := [kernel.DNSMaxLength]byte{}
	if len(name)+1 > kernel.DNSMaxLength {
		return buf, errors.New("DNS name too long")
	}
	i := 0
	for _, label := range strings.Split(name, ".") {
		sublen := len(label)
		if sublen > kernel.DNSMaxLabelLength {
			return buf, errors.New("DNS label too long")
		}
		buf[i] = byte(sublen)
		copy(buf[i+1:], label)
		i = i + sublen + 1
	}
	return buf, nil
}
func EncodeDNS ( name string ) ( [ kernel . DNSMaxLength ] byte , error ) { buf := [ kernel . DNSMaxLength ] byte { } if len ( name ) + 1 > kernel . DNSMaxLength { return buf , errors . New ( " " ) } i := 0 for _ , label := range strings . Split ( name , " " ) { sublen := len ( label ) if sublen > kernel . DNSMaxLabelLength { return buf , errors . New ( " " ) } buf [ i ] = byte ( sublen ) copy ( buf [ i + 1 : ] , label ) i = i + sublen + 1 } return buf , nil }
Returns the DNS packet representation of a domain name
Returns the DNS packet representation of a domain name