mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-05 06:05:16 -04:00
i2np structs
This commit is contained in:
63
lib/i2np/database_search_reply.go
Normal file
63
lib/i2np/database_search_reply.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user