| 240 | } |
| 241 | |
| 242 | std::shared_ptr<I2NPMessage> CreateDatabaseSearchReply (const i2p::data::IdentHash& ident, |
| 243 | std::vector<i2p::data::IdentHash> routers) |
| 244 | { |
| 245 | auto m = NewI2NPShortMessage (); |
| 246 | uint8_t * buf = m->GetPayload (); |
| 247 | size_t len = 0; |
| 248 | memcpy (buf, ident, 32); |
| 249 | len += 32; |
| 250 | buf[len] = routers.size (); |
| 251 | len++; |
| 252 | for (const auto& it: routers) |
| 253 | { |
| 254 | memcpy (buf + len, it, 32); |
| 255 | len += 32; |
| 256 | } |
| 257 | memcpy (buf + len, i2p::context.GetRouterInfo ().GetIdentHash (), 32); |
| 258 | len += 32; |
| 259 | m->len += len; |
| 260 | m->FillI2NPMessageHeader (eI2NPDatabaseSearchReply); |
| 261 | return m; |
| 262 | } |
| 263 | |
| 264 | std::shared_ptr<I2NPMessage> CreateDatabaseStoreMsg (std::shared_ptr<const i2p::data::RouterInfo> router, |
| 265 | uint32_t replyToken, std::shared_ptr<const i2p::tunnel::InboundTunnel> replyTunnel) |
no test coverage detected