Protocol.Dns.ResourceRecord
A parsed DNS resource record
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 ↑
Functions
Specs:
- class_name(non_neg_integer) :: :IN | :CH | :""
The dclass name of this packet
Specs:
- rdata_string(binary) :: String.t
Prints rdata to a human readable string. Very few rr types are supported.
Specs:
- read_answer(binary, binary) :: {Protocol.Dns.ResourceRecord.t, binary}
Reads an answer from the ‘data’ and returns a tuple of the resource record and remaining bytes.
Specs:
- read_answers(non_neg_integer, binary, binary) :: {[Protocol.Dns.ResourceRecord.t], binary}
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.
Specs:
- read_answers(non_neg_integer, binary, binary, list) :: {[Protocol.Dns.ResourceRecord.t], binary}
- read_answers(0, binary, binary, list) :: {[Protocol.Dns.ResourceRecord.t], binary}
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.
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.
Specs:
- read_dns(Protocol.Dns.Header.t, binary, binary) :: {[Protocol.Dns.Question.t], [Protocol.Dns.ResourceRecord.t], [Protocol.Dns.ResourceRecord.t], [Protocol.Dns.ResourceRecord.t], binary}
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.
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.
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.
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.
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.
Specs:
- read_question(binary, binary) :: {Protocol.Dns.Question.t, binary}
Reads a DNS question from the ‘data’. Returns a tuple of the question and the remaining bytes.
Specs:
- read_questions(non_neg_integer, binary, binary) :: {[Protocol.Dns.Question.t], binary}
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.
Specs:
- read_questions(non_neg_integer, binary, binary, list) :: {[Protocol.Dns.Question.t], binary}
- read_questions(0, binary, binary, list) :: {[Protocol.Dns.Question.t], binary}
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.
Specs:
- type_name(non_neg_integer) :: :atom
The rr type