Method Protocols.DNS.protocol()->decode_entries()
- Method
decode_entries
arraydecode_entries(strings,intnum,array(int)next)- Description
Decode a set of entries from an answer.
- Parameter
s Encoded entries.
- Parameter
num Number of entires in
s.- Parameter
next Array with a single element containing the start position in
son entry and the continuation position on return.- Returns
Returns an array of mappings describing the decoded entires:
Array mapping0..Mapping describing a single entry:
"name":stringName the entry concerns.
"type":EntryTypeType of entry.
"cl":ResourceClassResource class. Typically C_IN.
"ttl":intTime to live for the entry in seconds.
"len":intLength in bytes of the encoded data section.
Depending on the type of entry the mapping may contain different additional fields:
T_CNAME"cname":stringT_PTR"ptr":stringT_NS"ns":stringT_MX"preference":int"mx":stringT_HINFO"cpu":string"os":stringT_SRV"priority":int"weight":int"port":int"target":string"service":string"proto":string"name":stringT_A"a":stringIPv4-address in dotted-decimal format.
T_AAAA"aaaa":stringIPv6-address in colon-separated hexadecimal format.
T_LOC"version":intVersion, currently only version
0(zero) is supported."size":float"h_perc":float"v_perc":float"lat":float"long":float"alt":floatT_SOA"mname":string"rname":string"serial":int"refresh":int"retry":int"expire":int"minimum":intNote: For historical reasons this entry is named
"minimum", but it contains the TTL for negative answers (RFC 2308).T_NAPTR"order":int"preference":int"flags":string"service":string"regexp":string"replacement":stringT_TXT"txt":stringNote: For historical reasons, when receiving decoded DNS entries from a client, this will be the first string in the TXT record only.
"txta":stringWhen receiving decoded DNS data from a client, txta is the array of all strings in the record. When sending multiple strings in a TXT record in a server, please supply an array as "txt" containing the strings, txta will be ignored.
T_SPF"spf":stringT_CAA"critical":intSets the critical bit of the flag field.
"flags":int"tag":stringCannot be empty.
"value":string