Monero
Loading...
Searching...
No Matches
levin_base.h File Reference
#include <cstdint>
#include "byte_stream.h"
#include "net_utils_base.h"
#include "span.h"
Include dependency graph for levin_base.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  epee::levin::bucket_head
struct  epee::levin::bucket_head2
struct  epee::levin::levin_commands_handler< t_connection_context >
class  epee::levin::message_writer
 Provides space for levin (p2p) header, so that payload can be sent without copy. More...

Namespaces

namespace  epee
 TODO: (mj-xmr) This will be reduced in an another PR.
namespace  epee::levin

Macros

#define LEVIN_SIGNATURE   0x0101010101012101LL
#define LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED   0
#define LEVIN_INITIAL_MAX_PACKET_SIZE   256*1024
#define LEVIN_DEFAULT_MAX_PACKET_SIZE   100000000
#define LEVIN_PACKET_REQUEST   0x00000001
#define LEVIN_PACKET_RESPONSE   0x00000002
#define LEVIN_PACKET_BEGIN   0x00000004
#define LEVIN_PACKET_END   0x00000008
#define LEVIN_PROTOCOL_VER_0   0
#define LEVIN_PROTOCOL_VER_1   1
#define LEVIN_OK   0
#define LEVIN_ERROR_CONNECTION   -1
#define LEVIN_ERROR_CONNECTION_NOT_FOUND   -2
#define LEVIN_ERROR_CONNECTION_DESTROYED   -3
#define LEVIN_ERROR_CONNECTION_TIMEDOUT   -4
#define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL   -5
#define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED   -6
#define LEVIN_ERROR_FORMAT   -7
#define DESCRIBE_RET_CODE(code)

Functions

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

Macro Definition Documentation

◆ DESCRIBE_RET_CODE

#define DESCRIBE_RET_CODE ( code)
Value:
case code: return #code;
const portMappingElt code
Definition portlistingparse.c:22

◆ LEVIN_DEFAULT_MAX_PACKET_SIZE

#define LEVIN_DEFAULT_MAX_PACKET_SIZE   100000000

◆ LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED

#define LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED   0

◆ LEVIN_ERROR_CONNECTION

#define LEVIN_ERROR_CONNECTION   -1

◆ LEVIN_ERROR_CONNECTION_DESTROYED

#define LEVIN_ERROR_CONNECTION_DESTROYED   -3

◆ LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED

#define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED   -6

◆ LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL

#define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL   -5

◆ LEVIN_ERROR_CONNECTION_NOT_FOUND

#define LEVIN_ERROR_CONNECTION_NOT_FOUND   -2

◆ LEVIN_ERROR_CONNECTION_TIMEDOUT

#define LEVIN_ERROR_CONNECTION_TIMEDOUT   -4

◆ LEVIN_ERROR_FORMAT

#define LEVIN_ERROR_FORMAT   -7

◆ LEVIN_INITIAL_MAX_PACKET_SIZE

#define LEVIN_INITIAL_MAX_PACKET_SIZE   256*1024

◆ LEVIN_OK

#define LEVIN_OK   0

◆ LEVIN_PACKET_BEGIN

#define LEVIN_PACKET_BEGIN   0x00000004

◆ LEVIN_PACKET_END

#define LEVIN_PACKET_END   0x00000008

◆ LEVIN_PACKET_REQUEST

#define LEVIN_PACKET_REQUEST   0x00000001

◆ LEVIN_PACKET_RESPONSE

#define LEVIN_PACKET_RESPONSE   0x00000002

◆ LEVIN_PROTOCOL_VER_0

#define LEVIN_PROTOCOL_VER_0   0

◆ LEVIN_PROTOCOL_VER_1

#define LEVIN_PROTOCOL_VER_1   1

◆ LEVIN_SIGNATURE

#define LEVIN_SIGNATURE   0x0101010101012101LL