net: recognize TORv3/I2P/CJDNS networks

Recognizing addresses from those networks allows us to accept and gossip
them, even though we don't know how to connect to them (yet).

Co-authored-by: eriknylund <erik@daychanged.com>
This commit is contained in:
Vasil Dimov
2020-08-27 11:03:21 +02:00
parent e0d73573a3
commit 7be6ff6187
7 changed files with 365 additions and 57 deletions

View File

@@ -53,6 +53,13 @@ void static inline WriteLE64(unsigned char* ptr, uint64_t x)
memcpy(ptr, (char*)&v, 8);
}
uint16_t static inline ReadBE16(const unsigned char* ptr)
{
uint16_t x;
memcpy((char*)&x, ptr, 2);
return be16toh(x);
}
uint32_t static inline ReadBE32(const unsigned char* ptr)
{
uint32_t x;