i2np structs

This commit is contained in:
Hayden
2017-07-02 15:53:10 -07:00
parent 1dc86bdbac
commit f3af385fc5
19 changed files with 1251 additions and 229 deletions

View File

@ -0,0 +1,63 @@
package i2np
import (
"github.com/hkparker/go-i2p/lib/common"
)
/*
I2P I2NP DatabaseSearchReply
https://geti2p.net/spec/i2np
Accurate for version 0.9.28
+----+----+----+----+----+----+----+----+
| SHA256 hash as query key |
+ +
| |
+ +
| |
+ +
| |
+----+----+----+----+----+----+----+----+
| num| peer_hashes |
+----+ +
| |
+ +
| |
+ +
| |
+ +----+----+----+----+----+----+----+
| | from |
+----+ +
| |
+ +
| |
+ +
| |
+ +----+----+----+----+----+----+----+
| |
+----+
key ::
32 bytes
SHA256 of the object being searched
num ::
1 byte Integer
number of peer hashes that follow, 0-255
peer_hashes ::
$num SHA256 hashes of 32 bytes each (total $num*32 bytes)
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
*/
type DatabaseSearchReply struct {
Key common.Hash
Count int
PeerHashes []common.Hash
From common.Hash
}