Protocol.Dns.ResourceRecord

A parsed DNS resource record

Source

Summary

class_name(class)

The dclass name of this packet

rdata_string(dns)

Prints rdata to a human readable string. Very few rr types are supported

read_answer(message, data)

Reads an answer from the ‘data’ and returns a tuple of the resource record and remaining bytes

read_answers(answer_count, message, data)

Returns a list of the answers (resource records) in this section of the DNS packet. The section may be the answer, authoritative or additional sections, this code is generic so it doesn’t care which section is being read

read_answers(answer_count, message, data, acc)

Returns a list of the answers (resource records) in this section of the DNS packet. The section may be the answer, authoritative or additional sections, this code is generic so it doesn’t care which section is being read

read_bytes(data, len)

Reads the ‘len’ number of bytes from the binary and returns a tuple of the bytes read the remaining bytes

read_dns(header, message, data)

Returns the list of questions in the DNS packet and answer, authoritative and additional sections. Finally, the tuple returned contains the remaining bytes if there are any

read_label(message, data, acc, at_end)

Reads a label (such as ‘ns1.google.com’). It technically reads one label at a time and recurs until the end of the label is reached

read_name(message, data)

Reads a name from the data and returns a tuple of the name read and the reamining bytes that have not been read yet

read_name(message, data, acc, at_end)

Reads a name (label or offset) from the data and returns a tuple with the name read and the remaining bytes not yet read

read_offset(message, data, acc)

Reads the offset position and then returns the label at the offset in the entire ‘message’. Returns a tuple of the label read and the remaining bytes not yet read

read_question(message, data)

Reads a DNS question from the ‘data’. Returns a tuple of the question and the remaining bytes

read_questions(question_count, message, data)

Returns a tuple with the list of the questions in this DNS packet and a binary of the remaining bytes that have not yet been read

read_questions(question_count, message, data, acc)

Returns a tuple with the list of the questions in this DNS packet and a binary of the remaining bytes that have not yet been read

type_name(type)

The rr type

Types

t :: %Protocol.Dns.ResourceRecord{name: String.t, type: non_neg_integer, class: non_neg_integer, ttl: non_neg_integer, rdlen: non_neg_integer, rdata: binary}

Functions

class_name(class)

Specs:

  • class_name(non_neg_integer) :: :IN | :CH | :""

The dclass name of this packet

Source
rdata_string(dns)

Specs:

Prints rdata to a human readable string. Very few rr types are supported.

Source
read_answer(message, data)

Specs:

Reads an answer from the ‘data’ and returns a tuple of the resource record and remaining bytes.

Source
read_answers(answer_count, message, data)

Specs:

Returns a list of the answers (resource records) in this section of the DNS packet. The section may be the answer, authoritative or additional sections, this code is generic so it doesn’t care which section is being read.

Source
read_answers(answer_count, message, data, acc)

Specs:

Returns a list of the answers (resource records) in this section of the DNS packet. The section may be the answer, authoritative or additional sections, this code is generic so it doesn’t care which section is being read.

Source
read_bytes(data, len)

Specs:

  • read_bytes(binary, non_neg_integer) :: {binary, binary}

Reads the ‘len’ number of bytes from the binary and returns a tuple of the bytes read the remaining bytes.

Source
read_dns(header, message, data)

Specs:

Returns the list of questions in the DNS packet and answer, authoritative and additional sections. Finally, the tuple returned contains the remaining bytes if there are any.

Source
read_label(message, data, acc, at_end)

Specs:

  • read_label(binary, binary, list, boolean) :: {String.t, binary}

Reads a label (such as ‘ns1.google.com’). It technically reads one label at a time and recurs until the end of the label is reached.

Source
read_name(message, data)

Specs:

  • read_name(binary, binary) :: {String.t, binary}

Reads a name from the data and returns a tuple of the name read and the reamining bytes that have not been read yet.

Source
read_name(message, data, acc, at_end)

Specs:

  • read_name(binary, binary, list, boolean) :: {String.t, binary}

Reads a name (label or offset) from the data and returns a tuple with the name read and the remaining bytes not yet read.

Source
read_offset(message, data, acc)

Specs:

  • read_offset(binary, binary, list) :: {String.t, binary}

Reads the offset position and then returns the label at the offset in the entire ‘message’. Returns a tuple of the label read and the remaining bytes not yet read.

Source
read_question(message, data)

Specs:

Reads a DNS question from the ‘data’. Returns a tuple of the question and the remaining bytes.

Source
read_questions(question_count, message, data)

Specs:

Returns a tuple with the list of the questions in this DNS packet and a binary of the remaining bytes that have not yet been read.

Source
read_questions(question_count, message, data, acc)

Specs:

Returns a tuple with the list of the questions in this DNS packet and a binary of the remaining bytes that have not yet been read.

Source
type_name(type)

Specs:

  • type_name(non_neg_integer) :: :atom

The rr type

Source