Merge pull request #29 from pstray/master

Corrections to the ABNF and a few field type spesifications
This commit is contained in:
Alexandre Dulaunoy 2022-09-10 16:08:21 +02:00 committed by GitHub
commit 5986f1f904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,33 +178,35 @@ The document does not describe the protocol (e.g. <xref target="RFC3912">WHOIS</
<section title="ABNF grammar">
<figure><preamble>Formal grammar as defined in <xref target="RFC2234">ABNF</xref></preamble><artwork><![CDATA[
answer = entries
entries = * ( entry CR)
entry = "{" keyvallist "}"
entries = * ( entry newline )
entry = ws "{" ws keyvallist ws "}" ws
keyvallist = [ member *( value-separator member ) ]
member = qm field qm name-separator value
name-separator = ws %x3A ws ; a ":" colon
value = value ; as defined in the JSON RFC
value-separator = ws %x2C ws ; , comma. As defined in JSON
field = "rrname" | "rrtype" | "rdata" | "time_first" |
member = field name-separator value
name-separator = ws %x3A ws ; : colon
value-separator = ws %x2C ws ; , comma
field = field-name | futureField
field-name = "rrname" | "rrtype" | "rdata" | "time_first" |
"time_last" | "count" | "bailiwick" | "sensor_id" |
"zone_time_first" | "zone_time_last" | "origin" |
"time_first_ms" | "time_last_ms" | futureField
"time_first_ms" | "time_last_ms"
futureField = string
CR = %x0D
qm = %x22 ; " a quotation mark
newline = [ CR ] LF
CR = %x0D ; Carrige return
LF = %x0A ; Line feed or New line
qm = %x22 ; " Quotation mark
ws = *(
%x20 | ; Space
%x09 ; Horizontal tab
)
]]></artwork></figure>
<t>Note that value is defined in <xref target="RFC4627">JSON</xref> and has the exact same specification as there. The same goes for the definition of string.</t>
<t>Note that value is defined in <xref target="RFC4627">JSON</xref> and has the exact same specification as there. The same goes for the definition of string. Note the changed definition of ws dows not include CR or LF as those are NOT allowed in NDJSON, and thus the definition here MUST be used for other ABNF defitions in <xref target="RFC4627">JSON</xref>.</t>
</section>
<section title="Mandatory Fields">
<t>Implementation MUST support all the mandatory fields.</t>
<t>Uniqueness property: the tuple (rrname,rrtype,rdata) will always be unique within one answer per server. While rrname and rrtype are always individual JSON primitive types (strings, numbers, booleans or null), rdata MAY return multiple resource records or a single record. When multiple resource records are returned, rdata MUST be a JSON array. In the case of a single resource record is returned, rdata MUST be a JSON string or a JSON array containing one JSON string. Senders SHOULD send an array for rdata, but receivers MUST be able to accept a single-string result for rdata.</t>
<section title="rrname">
<t>This field returns the name of the queried resource. <xref target="RFC4627">JSON</xref> string.</t>
<t>This field returns the name of the queried resource. Represented as a <xref target="RFC4627">JSON</xref> string.</t>
</section>
<section title="rrtype">
<t>This field returns the resource record type as seen by the passive DNS. The key is rrtype and the value is in the interpreted record type represented as a <xref target="RFC4627">JSON</xref> string. If the value cannot be interpreted, the decimal value is returned following the principle of transparency as described in <xref target="RFC3597">RFC 3597</xref>. Then the decimal value is represented as a <xref target="RFC4627">JSON</xref> number.
@ -230,7 +232,7 @@ ws = *(
<t>Specifies how many authoritative DNS answers were received at the Passive DNS Server's collectors with exactly the given set of values as answers (i.e. same data in the answer set - compare with the uniqueness property in "Mandatory Fields"). The number of requests is expressed as a decimal value. This field is represented as a <xref target="RFC4627">JSON</xref> number.</t>
</section>
<section title="bailiwick">
<t>The bailiwick is the best estimate of the apex of the zone where this data is authoritative.</t>
<t>The bailiwick is the best estimate of the apex of the zone where this data is authoritative. This field is represented as a <xref target="RFC4627">JSON</xref> string.</t>
</section>
</section>
<section title="Additional Fields">
@ -246,7 +248,7 @@ ws = *(
<t>This field returns the last time that the unique tuple (rrname, rrtype, rdata) record has been seen via master file import. The date is expressed in seconds (decimal) since 1st of January 1970 (Unix timestamp). The time zone MUST be UTC. This field is represented as a <xref target="RFC4627">JSON</xref> number.</t>
</section>
<section title="origin">
<t>Specifies the resource origin of the Passive DNS response. This field is represented as a <xref target="RFC3986">Uniform Resource Identifier</xref> (URI).
<t>Specifies the resource origin of the Passive DNS response. This field is represented as a <xref target="RFC3986">Uniform Resource Identifier</xref> (URI) in the form of a <xref target="RFC4627">JSON</xref> string.
</t>
</section>
<section title="time_first_ms">