deckard.aug: allow RAW along with SECTION (for matching)

parent 552ddef6
......@@ -329,8 +329,10 @@ Deckard does not expect any answer to RAW queries, so ``STEP CHECK_ANSWER`` is n
Main intent of this behavior is to check if binary under test is
able to process valid queries after getting series badly formed packets.
Using ``RAW`` section in conjunction of other sections is meaningless.
All sections other than ``RAW`` will be ignored.
It is also possible to use ``RAW`` in conjuction with ``SECTION`` for the
purpose of responding with raw data to a query that matches the ``SECTION``.
Raw data is sent as is and isn't manipulated in any way (e.g. by ``ADJUST``).
One ``ENTRY`` can contain only one ``RAW`` section.
Example
......
......@@ -57,14 +57,13 @@ let section_authority = [ label "authority" . del_str "SECTION AUTHORITY" .
let section_additional = [ label "additional" . del_str "SECTION ADDITIONAL" .
comment_or_eol . record* ]
let sections = [label "section" . section_question? . section_answer? . section_authority? . section_additional?]
let raw = [del_str "RAW" . comment_or_eol . label "raw" . store hex_re ] . comment_or_eol
(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)
(* This is quite dirty hack to match every combination of options given to entry since 'let dnsmsg = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)
let normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections
let dnsmsg = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections
let entry = [label "entry" . del_str "ENTRY_BEGIN" . comment_or_eol . ( normal | raw ) . del_str "ENTRY_END" . eol]
let entry = [label "entry" . del_str "ENTRY_BEGIN" . comment_or_eol . dnsmsg . raw? . del_str "ENTRY_END" . eol]
let single_address = [ label "address" . space . store ip_re ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment