View Source MdnsLite.DNS (mdns_lite v0.8.10)

Bring Erlang's DNS record definitions into Elixir

Summary

Types

@type dns_query() ::
  {:dns_query, domain :: term(), type :: term(), class :: term(),
   unicast_response :: term()}
@type dns_rec() ::
  {:dns_rec, header :: term(), qdlist :: term(), anlist :: term(),
   nslist :: term(), arlist :: term()}
@type dns_rr() ::
  {:dns_rr, domain :: term(), type :: term(), class :: term(), cnt :: term(),
   ttl :: term(), data :: term(), tm :: term(), bm :: term(), func :: term()}

Functions

@spec decode(binary()) :: {:ok, dns_rec()} | {:error, any()}

Decode a packet that contains a DNS message

Link to this macro

dns_header(args \\ [])

View Source (macro)
Link to this macro

dns_header(record, args)

View Source (macro)
Link to this macro

dns_query(args \\ [])

View Source (macro)
Link to this macro

dns_query(record, args)

View Source (macro)
Link to this macro

dns_rec(args \\ [])

View Source (macro)
Link to this macro

dns_rec(record, args)

View Source (macro)
Link to this macro

dns_rr(args \\ [])

View Source (macro)
Link to this macro

dns_rr(record, args)

View Source (macro)
@spec encode(dns_rec()) :: binary()

Encode a DNS record

@spec pretty(dns_rr()) :: String.t()

Format a DNS record as a nice string for the user