module Matter::MDNS::RecordBuilder

Overview

Helper for building DNS resource records for mDNS

Extended Modules

Defined in:

matter/mdns/record_builder.cr

Constant Summary

CLASS_IN = 1_u16

DNS class codes

CLASS_IN_CACHE_FLUSH = 32769_u16
TYPE_A = 1_u16

DNS record types

TYPE_AAAA = 28_u16
TYPE_PTR = 12_u16
TYPE_SRV = 33_u16
TYPE_TXT = 16_u16

Instance Method Summary

Instance Method Detail

def build_a(hostname : String, ip : Socket::IPAddress, ttl : Time::Span) : DNS::Packet::ResourceRecord #

Build A record (IPv4 address)


[View source]
def build_aaaa(hostname : String, ip : Socket::IPAddress, ttl : Time::Span) : DNS::Packet::ResourceRecord #

Build AAAA record (IPv6 address)


[View source]
def build_nsec(name : String, next_domain : String, types : Array(UInt16), ttl : Time::Span) : DNS::Packet::ResourceRecord #

Build NSEC record (for negative caching - optional but recommended) Indicates which record types exist for a name


[View source]
def build_ptr(service : String, instance : String, ttl : Time::Span, cache_flush : Bool = false) : DNS::Packet::ResourceRecord #

Build PTR record (for service enumeration) Points service type to instance name


[View source]
def build_srv(instance : String, port : Int32, target : String, ttl : Time::Span, priority : UInt16 = 0_u16, weight : UInt16 = 0_u16) : DNS::Packet::ResourceRecord #

Build SRV record (service location: priority, weight, port, target)


[View source]
def build_txt(instance : String, txt_records : Hash(String, String), ttl : Time::Span) : DNS::Packet::ResourceRecord #

Build TXT record (service metadata as key=value pairs)


[View source]