Handbook
Glossary
parse-message ( byte-array -- message )
Vocabulary
dns
Inputs
byte-array
an
object
Outputs
message
an
object
Definition
USING:
accessors
combinators
endian
io
io.encodings.binary
io.streams.byte-array
kernel
sequences
;
IN:
dns
:
parse-message
( byte-array -- message )
[
message
new
]
dip
binary
[
2
read
be>
>>id
2
read
be>
header>message-parts
{
[
>>qr
]
[
>>opcode
]
[
>>aa
]
[
>>tc
]
[
>>rd
]
[
>>ra
]
[
>>z
]
[
>>rcode
]
}
spread
2
read
be>
>>query
2
read
be>
>>answer-section
2
read
be>
>>authority-section
2
read
be>
>>additional-section
[
[
parse-query
]
replicate
]
change-query
[
[
parse-rr
]
replicate
]
change-answer-section
[
[
parse-rr
]
replicate
]
change-authority-section
[
[
parse-rr
]
replicate
]
change-additional-section
]
with-byte-reader
;