Protocol.Dns.ResourceRecord (expcap v0.1.2) View Source
A parsed DNS resource record
Link to this section Summary
Functions
The dclass name of this packet
Prints rdata to a human readable string. Very few rr types are supported.
Reads an answer from the 'data' and returns a tuple of the resource record and remaining bytes.
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.
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.
Reads the 'len' number of bytes from the binary and returns a tuple of the bytes read the remaining bytes.
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.
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.
Reads a name from the data and returns a tuple of the name read and the reamining bytes that have not been read yet.
Reads a name (label or offset) from the data and returns a tuple with the name read and the remaining bytes not yet read.
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.
Reads a DNS question from the 'data'. Returns a tuple of the question and the remaining bytes.
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.
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.
The rr type
Link to this section Types
Specs
t() :: %Protocol.Dns.ResourceRecord{ class: non_neg_integer(), name: String.t(), rdata: binary(), rdlen: non_neg_integer(), ttl: non_neg_integer(), type: non_neg_integer() }
Link to this section Functions
Specs
class_name(non_neg_integer()) :: :IN | :CH | :""
The dclass name of this packet
Specs
Prints rdata to a human readable string. Very few rr types are supported.
Specs
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()) :: {[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(0, binary(), binary(), list()) :: {[t()], binary()}
read_answers(non_neg_integer(), binary(), binary(), list()) :: {[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()], [t()], [t()], [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
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
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
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
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(0, binary(), binary(), list()) :: {[Protocol.Dns.Question.t()], binary()}
read_questions(non_neg_integer(), 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