Monero
Loading...
Searching...
No Matches
epee::levin Namespace Reference

Classes

struct  bucket_head
struct  bucket_head2
struct  levin_commands_handler
class  message_writer
 Provides space for levin (p2p) header, so that payload can be sent without copy. More...
struct  protocl_handler_config
class  protocol_handler
class  async_protocol_handler
class  async_protocol_handler_config

Functions

const char * get_err_descr (int err)
bucket_head2 make_header (uint32_t command, uint64_t msg_size, uint32_t flags, bool expect_response) noexcept
byte_slice make_noise_notify (std::size_t noise_bytes)
byte_slice make_fragmented_notify (const std::size_t noise_size, int command, message_writer message)

Function Documentation

◆ get_err_descr()

const char * epee::levin::get_err_descr ( int err)
inline

◆ make_fragmented_notify()

byte_slice epee::levin::make_fragmented_notify ( const std::size_t noise_size,
int command,
message_writer message )

Generate 1+ levin messages that are identical to the noise message size.

Parameters
noise_sizeEach levin message will be identical to this value.
Returns
nullptr if noise.size() is less than the levin header size. Otherwise, a levin notification message OR 2+ levin fragment messages. Each message is noise.size() in length.

◆ make_header()

bucket_head2 epee::levin::make_header ( uint32_t command,
uint64_t msg_size,
uint32_t flags,
bool expect_response )
noexcept
Returns
Intialized levin header.

◆ make_noise_notify()

byte_slice epee::levin::make_noise_notify ( std::size_t noise_bytes)

Generate a dummy levin message.

Parameters
noise_bytesTotal size of the returned byte_slice.
Returns
nullptr if noise_size is smaller than the levin header. Otherwise, a dummy levin message.