Updated dataspec lexer

This commit is contained in:
str4d
2014-01-08 07:01:41 +00:00
parent ca72c24b23
commit 0f103d6ef8
4 changed files with 87 additions and 87 deletions

View File

@@ -49,12 +49,12 @@ Short (SSU, 5 bytes):
<h4>Definition</h4>
{% highlight lang='dataspec' %}
type :: Integer
type :: `Integer`
length -> 1 byte
purpose -> identifies the message type (see table below)
msg_id :: Integer
msg_id :: `Integer`
length -> 4 bytes
purpose -> uniquely identifies this message (for some time at least)
@@ -62,20 +62,20 @@ msg_id :: Integer
outgoing tunnel build messages it may be derived from
the incoming message. See below.
expiration :: Date
expiration :: `Date`
8 bytes
date this message will expire
short_expiration :: Integer
short_expiration :: `Integer`
4 bytes
date this message will expire (seconds since the epoch)
size :: Integer
size :: `Integer`
length -> 2 bytes
purpose -> length of the payload
chks :: Integer
chks :: `Integer`
length -> 1 byte
purpose -> checksum of the payload
@@ -202,37 +202,37 @@ ElGamal and AES encrypted:
{% highlight lang='dataspec' %}
unencrypted:
receive_tunnel :: TunnelId
receive_tunnel :: `TunnelId`
length -> 4 bytes
our_ident :: Hash
our_ident :: `Hash`
length -> 32 bytes
next_tunnel :: TunnelId
next_tunnel :: `TunnelId`
length -> 4 bytes
next_ident :: Hash
next_ident :: `Hash`
length -> 32 bytes
layer_key :: SessionKey
layer_key :: `SessionKey`
length -> 32 bytes
iv_key :: SessionKey
iv_key :: `SessionKey`
length -> 32 bytes
reply_key :: SessionKey
reply_key :: `SessionKey`
length -> 32 bytes
reply_iv :: data
length -> 16 bytes
flag :: Integer
flag :: `Integer`
length -> 1 byte
request_time :: Integer
request_time :: `Integer`
length -> 4 bytes
Hours since the epoch, i.e. current time / 3600
send_message_id :: Integer
send_message_id :: `Integer`
length -> 4 bytes
padding :: Data
@@ -343,9 +343,9 @@ Delivery Instructions :: <a href="{{ site_url('docs/spec/tunnel-message') }}#del
I2NP Message :: Any I2NP Message
Clove ID :: 4 byte Integer
Clove ID :: 4 byte `Integer`
Expiration :: Date (8 bytes)
Expiration :: `Date` (8 bytes)
Certificate :: Always NULL in the current implementation (3 bytes total, all zeroes)
@@ -493,8 +493,8 @@ type:
1 byte
type identifier
mapping:
0 RouterInfo
1 LeaseSet
0 `RouterInfo`
1 `LeaseSet`
reply token:
4 bytes
@@ -504,7 +504,7 @@ reply token:
if the token is greater than zero.
reply tunnelId:
4 byte Tunnel ID
4 byte `TunnelID`
only included if reply token &gt; 0
This is the <a href="{{ site_url('docs/spec/common-structures') }}#type_TunnelID">tunnel ID</a> of the inbound gateway of the tunnel the response should be sent to
@@ -515,8 +515,8 @@ reply gateway:
This is the router hash of the inbound gateway of the tunnel the response should be sent to
data:
If type == 0, data is a 2-byte integer specifying the number of bytes that follow, followed by a gzip-compressed RouterInfo.
If type == 1, data is an uncompressed LeaseSet.
If type == 0, data is a 2-byte integer specifying the number of bytes that follow, followed by a gzip-compressed `RouterInfo`.
If type == 1, data is an uncompressed `LeaseSet`.
</pre>
<h4>Notes</h4>
@@ -615,12 +615,12 @@ flags ::
as of release 0.9.6, ignored, set to 0 for compatibility with future uses and with older routers
reply_tunnelId ::
4 byte Tunnel ID
4 byte `TunnelID`
only included if deliveryFlag == 1
tunnelId of the tunnel to send the reply to
size ::
2 byte Integer
2 byte `Integer`
valid range: 0-512
number of peers to exclude from the DatabaseSearchReply Message
@@ -632,17 +632,17 @@ excludedPeers ::
the DatabaseSearchReply Message is requested to list non-floodfill routers only.
reply_key ::
32 byte SessionKey
32 byte `SessionKey`
only included if encryptionFlag == 1, only as of release 0.9.7
tags ::
1 byte Integer
1 byte `Integer`
valid range: 1-32 (typically 1)
the number of reply tags that follow
only included if encryptionFlag == 1, only as of release 0.9.7
reply_tags ::
one or more 32 byte SessionTags (typically one)
one or more 32 byte `SessionTags` (typically one)
only included if encryptionFlag == 1, only as of release 0.9.7
{% endhighlight %}
@@ -715,16 +715,16 @@ key ::
SHA256 of the object being searched
num ::
1 byte Integer
1 byte `Integer`
number of peer hashes that follow, 0-255
peer_hash ($num entries) ::
32 bytes
SHA256 of the RouterIdentity that the other router thinks is close to the key
SHA256 of the `RouterIdentity` that the other router thinks is close to the key
from ::
32 bytes
SHA256 of the RouterInfo of the router this reply was sent from
SHA256 of the `RouterInfo` of the router this reply was sent from
{% endhighlight %}
<h4>Notes</h4>
@@ -837,15 +837,15 @@ data ::
Unencrypted data:
num ::
1 byte Integer number of GarlicCloves to follow
1 byte Integer number of `GarlicCloves` to follow
clove :: a GarlicClove
clove :: a `GarlicClove`
Certificate :: always NULL in the current implementation (3 bytes total, all zeroes)
Message_ID :: 4 byte Integer
Message_ID :: 4 byte `Integer`
Expiration :: Date (8 bytes)
Expiration :: `Date` (8 bytes)
{% endhighlight %}
@@ -899,7 +899,7 @@ Expiration :: Date (8 bytes)
<h4>Definition</h4>
{% highlight lang='dataspec' %}
tunnelId ::
4 byte Tunnel ID
4 byte `TunnelID`
identifies the tunnel this message is directed at
data ::
@@ -931,11 +931,11 @@ data ::
<h4>Definition</h4>
{% highlight lang='dataspec' %}
tunnelId ::
4 byte Tunnel ID
4 byte `TunnelID`
identifies the tunnel this message is directed at
length ::
2 byte Integer
2 byte `Integer`
length of the payload
data ::
@@ -995,7 +995,7 @@ data ::
<h4>Definition</h4>
{% highlight lang='dataspec' %}
Just 8 Build Request Records attached together
Just 8 `BuildRequestRecords` attached together
record size: 528 bytes
total size: 8*528 = 4224 bytes
{% endhighlight %}
@@ -1011,7 +1011,7 @@ total size: 8*528 = 4224 bytes
<h3 id="msg_TunnelBuildReply">TunnelBuildReply</h3>
{% highlight lang='dataspec' %}
same format as TunnelBuild message, with Build Response Records
same format as `TunnelBuild` message, with `BuildResponseRecords`
{% endhighlight %}
<h4>Notes</h4>
@@ -1034,7 +1034,7 @@ same format as TunnelBuild message, with Build Response Records
Same format as TunnelBuildMessage, except for the addition of an "num" field in front and $num number of Build Request Records instead of 8
num ::
1 byte Integer
1 byte `Integer`
Valid values: 1-8
record size: 528 bytes