| 3041 | } |
| 3042 | |
| 3043 | size_t SSU2Session::CreateI2NPBlock (uint8_t * buf, size_t len, std::shared_ptr<I2NPMessage>&& msg) |
| 3044 | { |
| 3045 | msg->ToNTCP2 (); |
| 3046 | auto msgBuf = msg->GetNTCP2Header (); |
| 3047 | auto msgLen = msg->GetNTCP2Length (); |
| 3048 | if (msgLen + 3 > len) msgLen = len - 3; |
| 3049 | buf[0] = eSSU2BlkI2NPMessage; |
| 3050 | htobe16buf (buf + 1, msgLen); // size |
| 3051 | memcpy (buf + 3, msgBuf, msgLen); |
| 3052 | return msgLen + 3; |
| 3053 | } |
| 3054 | |
| 3055 | size_t SSU2Session::CreateFirstFragmentBlock (uint8_t * buf, size_t len, std::shared_ptr<I2NPMessage> msg) |
| 3056 | { |
nothing calls this directly
no test coverage detected