DNS.Parameter protocol (DNS v0.5.0)

View Source

Protocol for converting DNS entities to binary protocol data.

This protocol provides a standardized way to convert DNS entities (messages, records, domains, etc.) to their binary representation for network transmission according to DNS protocol specifications.

All DNS resource types implement this protocol to ensure consistent binary serialization across the library.

Summary

Types

t()

All the types that implement this protocol.

Functions

Convert a DNS entity to binary iodata suitable for network transmission.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

to_iodata(value)

@spec to_iodata(term()) :: iodata()

Convert a DNS entity to binary iodata suitable for network transmission.

Parameters

  • value - The DNS entity to convert (domain, record, message, etc.)

Returns

  • iodata() - Binary data representing the DNS entity in protocol format

Examples

iex> domain = DNS.Message.Domain.new("example.com")
iex> DNS.Parameter.to_iodata(domain)
<<13, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 0>>