⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

encode_name

Function encode_name 

Source
pub fn encode_name(name: &str, buf: &mut [u8]) -> Result<usize, DnsError>
Expand description

Encode a dotted domain name into DNS label format.

Example: “www.example.com” -> [3, ‘w’, ‘w’, ‘w’, 7, ‘e’, ‘x’, ‘a’, ‘m’, ‘p’, ‘l’, ‘e’, 3, ‘c’, ‘o’, ‘m’, 0]