Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
remote scry packet format
A scry packet is either a request packet, sent from requester to host, or
a response packet, sent from host to requester.
Some request packets and all response packets are signed.
Paths are encoded as null-terminated ASCII text, except for the host ship,
which is encoded the same way as in Ames,
so as not to slow down relaying with string parsing.
Scry packets are not responsible for peer discovery and
therefore do not include an "origin" field like Ames packets.
request packet
==============
32-bit header
-------------
3 bits: unused
1 bits: scry or ames?
3 bits: protocol version
1 bits: request or response
1 bits: signed?
2 bits: host address size
20 bits: checksum
1 bits: unused
body
----
request:
32 bits: fragment number
16/32/64/128 bits: host address
<variable number of octets>: path as ASCII, null-terminated
if signed:
512 bits: requester signature
32 bits: requester life
16/32/6s4/128 bits: requester address
response packet
===============
32-bit header
-------------
3 bits: unused
1 bits: scry or ames?
3 bits: protocol version
1 bits: request or response
2 bits: host address size
1 bits: unused
20 bits: checksum
1 bits: unused
body
----
request:
32 bits: fragment number (starting at 1)
16/32/64/128 bits: host address
<variable number of octets>: path as ASCII, null-terminated
response:
32 bits: responder life
16/32/64/128 bits: responder address
512 bits: responder signature
32 bits: number of fragments
<variable number of octets>: response data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment