libe3 0.2.5
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
libe3 Namespace Reference

Namespaces

namespace  e3ap
namespace  py

Classes

class  DAppSubscriptionState
class  E3Agent
 E3Agent - Main façade for RAN vendor integration. More...
class  E3Connector
 Abstract base class for E3AP transport connectors. More...
class  E3Encoder
 Abstract base class for E3AP encoders. More...
class  E3Interface
 E3Interface - Internal protocol coordination. More...
class  LockFreeQueue
 Lock-free bounded blocking queue. More...
class  Logger
 Logger singleton class. More...
class  LogStream
 Log stream helper for efficient message construction. More...
class  MpmcQueue
 Lock-free bounded MPMC ring buffer. More...
class  ServiceModel
 Abstract Service Model interface. More...
class  SmRegistry
 SM Registry for managing registered Service Models. More...
struct  SubscriptionDetails
 Per-subscription metadata stored by the SubscriptionManager. More...
class  SubscriptionManager
 E3 Subscription Manager. More...
struct  EncodedMessage
 Encoded message wrapper. More...
struct  RanFunctionDefinition
 RAN Function definition (SM identification). More...
struct  SetupRequest
 E3AP Setup Request structure. More...
struct  RanFunctionDef
 RAN Function Definition for Setup Response. More...
struct  SetupResponse
 E3AP Setup Response structure. More...
struct  SubscriptionRequest
 E3AP Subscription Request structure. More...
struct  SubscriptionDelete
 E3AP Subscription Delete structure. More...
struct  SubscriptionResponse
 E3AP Subscription Response structure. More...
struct  IndicationMessage
 E3AP Indication Message structure. More...
struct  DAppControlAction
 E3AP dApp Control Action structure. More...
struct  MessageAck
 E3AP Message Acknowledgment structure. More...
struct  DAppReport
 E3AP dApp Report structure. More...
struct  XAppControlAction
 E3AP xApp Control Action structure. More...
struct  ReleaseMessage
 E3AP Release Message structure. More...
struct  Pdu
 Generic E3AP PDU structure. More...
struct  E3Config
 Configuration for E3Agent. More...
struct  DAppEntry
 dApp registration entry More...
struct  SubscriptionEntry
 Subscription entry representing dApp-RAN function association. More...
class  PosixE3Connector
 POSIX socket-based E3 connector. More...
class  ZmqE3Connector
 ZeroMQ-based E3 connector. More...
class  Asn1E3Encoder
 ASN.1 APER encoder implementation. More...
class  JsonE3Encoder
 JSON encoder for E3AP PDUs. More...
class  ProtobufE3Encoder
 Protocol Buffers encoder implementation. More...

Typedefs

using DAppReportHandler = std::function<void(const DAppReport&)>
using DAppStatusChangedHandler = std::function<void()>
using SetupResponseHandler = std::function<void(const SetupResponse&)>
using SubscriptionResponseHandler = std::function<void(const SubscriptionResponse&)>
using IndicationHandler = std::function<void(const IndicationMessage&)>
using XAppControlHandler = std::function<void(const XAppControlAction&)>
using MessageAckHandler = std::function<void(const MessageAck&)>
template<typename T>
using EncodeResult = tl::expected<T, ErrorCode>
 Result type for encoding/decoding operations.
using SetupRequestHandler = std::function<ResponseCode(const SetupRequest&, SetupResponse&)>
 Callback types for E3Interface events.
using SubscriptionRequestHandler = std::function<ResponseCode(const SubscriptionRequest&)>
using LogCallback = std::function<void(LogLevel level, const std::string& component, const std::string& message)>
 Log callback function type.
using SmFactory = std::function<std::unique_ptr<ServiceModel>()>
 Factory function type for creating SM instances.
using SmLifecycleCallback = std::function<void(uint32_t ran_function_id, bool should_start)>
 Callback type for SM lifecycle events.
using PduChoice
 Generic E3AP PDU using std::variant for type-safe union.
using Timestamp = std::chrono::time_point<std::chrono::steady_clock>
 Timestamp type using steady_clock for monotonic time.

Enumerations

enum class  LogLevel : int {
  NONE = 0 , ERROR = 1 , WARN = 2 , INFO = 3 ,
  DEBUG = 4 , TRACE = 5
}
 Logging levels. More...
enum class  EncodingFormat : uint8_t { ASN1 = 0 , JSON = 1 , PROTOBUF = 2 }
 E3AP encoding formats supported by the library. More...
enum class  E3LinkLayer : uint8_t { ZMQ = 0 , POSIX = 1 }
 Link layer types (matches Python E3LinkLayer). More...
enum class  E3Role : uint8_t { RAN = 0 , DAPP = 1 }
 Role this E3 endpoint plays in the protocol. More...
enum class  E3TransportLayer : uint8_t { SCTP = 0 , TCP = 1 , IPC = 2 }
 Transport layer types (matches Python E3TransportLayer). More...
enum class  ActionType : uint8_t { INSERT = 0 , UPDATE = 1 , DELETE = 2 }
 E3AP action types for Setup and Subscription requests. More...
enum class  ResponseCode : uint8_t { POSITIVE = 0 , NEGATIVE = 1 }
 E3AP response codes. More...
enum class  PduType : uint8_t {
  SETUP_REQUEST = 0 , SETUP_RESPONSE = 1 , SUBSCRIPTION_REQUEST = 2 , SUBSCRIPTION_DELETE = 3 ,
  SUBSCRIPTION_RESPONSE = 4 , INDICATION_MESSAGE = 5 , DAPP_CONTROL_ACTION = 6 , DAPP_REPORT = 7 ,
  XAPP_CONTROL_ACTION = 8 , RELEASE_MESSAGE = 9 , MESSAGE_ACK = 10
}
 E3AP PDU types. More...
enum class  AgentState : uint8_t {
  UNINITIALIZED = 0 , INITIALIZED = 1 , CONNECTING = 2 , CONNECTED = 3 ,
  RUNNING = 4 , STOPPING = 5 , STOPPED = 6 , ERROR = 7
}
 Agent state machine states. More...
enum class  ErrorCode : int { LIBE3_ERROR_CODE_LIST }
 Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes.h). More...

Functions

const char * version () noexcept
 Get libe3 version string.
void version (int &major, int &minor, int &patch) noexcept
 Get libe3 version as components.
std::unique_ptr< E3Connector > create_connector (E3LinkLayer link_layer, E3TransportLayer transport_layer, const std::string &setup_endpoint, const std::string &inbound_endpoint, const std::string &outbound_endpoint, uint16_t setup_port, uint16_t inbound_port, uint16_t outbound_port, size_t io_threads=2, E3Role role=E3Role::RAN)
 Factory function to create appropriate connector.
std::unique_ptr< E3Encoder > create_encoder (EncodingFormat format)
 Factory function to create appropriate encoder.
void cpu_relax () noexcept
 Emit a CPU-level pause/yield hint inside spin-wait loops.
uint64_t now_realtime_ns () noexcept
 Current realtime clock reading, in nanoseconds since the Unix epoch.
const char * ErrorCodeToString (ErrorCode code)
 Convert ErrorCode to string name (C++ wrapper).
const char * pdu_type_to_string (PduType type) noexcept
 Convert PduType to string representation.
const char * action_type_to_string (ActionType type) noexcept
 Convert ActionType to string representation.
const char * response_code_to_string (ResponseCode code) noexcept
 Convert ResponseCode to string representation.
const char * error_code_to_string (ErrorCode code) noexcept
 Convert ErrorCode to string representation.
const char * agent_state_to_string (AgentState state) noexcept
 Convert AgentState to string representation.
const char * role_to_string (E3Role role) noexcept
 Convert E3Role to string representation.
const char * link_layer_to_string (E3LinkLayer layer) noexcept
 Convert E3LinkLayer to string representation.
const char * transport_layer_to_string (E3TransportLayer layer) noexcept
 Convert E3TransportLayer to string representation.

Variables

static constexpr size_t CACHE_LINE_SIZE = 64
 Assumed cache-line size (bytes) used for alignment padding.
constexpr size_t MAX_PROTOCOL_DATA_SIZE = 32768
constexpr size_t MAX_ACTION_DATA_SIZE = 32768
constexpr size_t MAX_DAPP_REPORT_DATA_SIZE = 32768
constexpr size_t MAX_XAPP_CTRL_DATA_SIZE = 32768
constexpr size_t MAX_RAN_FUNCTIONS = 255
constexpr size_t DEFAULT_BUFFER_SIZE = 60000
constexpr uint32_t LIBE3_PROTOCOL_VERSION = 1

Typedef Documentation

◆ DAppReportHandler

typedef std::function< void(const DAppReport &)> libe3::DAppReportHandler = std::function<void(const DAppReport&)>

Callback for incoming dApp reports (dApp → RAN). Set before start() to handle reports.

Definition at line 30 of file e3_agent.hpp.

◆ DAppStatusChangedHandler

typedef std::function< void()> libe3::DAppStatusChangedHandler = std::function<void()>

Callback when dApp status changes (connect, disconnect, subscribe, unsubscribe).

Definition at line 33 of file e3_agent.hpp.

◆ EncodeResult

template<typename T>
using libe3::EncodeResult = tl::expected<T, ErrorCode>

Result type for encoding/decoding operations.

Definition at line 26 of file e3_encoder.hpp.

◆ IndicationHandler

typedef std::function< void(const IndicationMessage &)> libe3::IndicationHandler = std::function<void(const IndicationMessage&)>

Definition at line 38 of file e3_agent.hpp.

◆ LogCallback

using libe3::LogCallback = std::function<void(LogLevel level, const std::string& component, const std::string& message)>

Log callback function type.

Allows external logging frameworks to receive log messages.

Parameters
levelLog level
componentComponent name (e.g., "E3Agent", "Connector")
messageLog message

Definition at line 50 of file logger.hpp.

◆ MessageAckHandler

typedef std::function< void(const MessageAck &)> libe3::MessageAckHandler = std::function<void(const MessageAck&)>

Definition at line 40 of file e3_agent.hpp.

◆ PduChoice

Initial value:
std::variant<
>
E3AP dApp Control Action structure.
Definition types.hpp:272
E3AP dApp Report structure.
Definition types.hpp:293
E3AP Indication Message structure.
Definition types.hpp:263
E3AP Message Acknowledgment structure.
Definition types.hpp:285
E3AP Release Message structure.
Definition types.hpp:321
E3AP Setup Request structure.
Definition types.hpp:201
E3AP Setup Response structure.
Definition types.hpp:221
E3AP Subscription Delete structure.
Definition types.hpp:245
E3AP Subscription Request structure.
Definition types.hpp:233
E3AP Subscription Response structure.
Definition types.hpp:253
E3AP xApp Control Action structure.
Definition types.hpp:306

Generic E3AP PDU using std::variant for type-safe union.

Definition at line 328 of file types.hpp.

◆ SetupRequestHandler

Callback types for E3Interface events.

Definition at line 41 of file e3_interface.hpp.

◆ SetupResponseHandler

typedef std::function< void(const SetupResponse &)> libe3::SetupResponseHandler = std::function<void(const SetupResponse&)>

Definition at line 36 of file e3_agent.hpp.

◆ SmFactory

using libe3::SmFactory = std::function<std::unique_ptr<ServiceModel>()>

Factory function type for creating SM instances.

Definition at line 219 of file sm_interface.hpp.

◆ SmLifecycleCallback

using libe3::SmLifecycleCallback = std::function<void(uint32_t ran_function_id, bool should_start)>

Callback type for SM lifecycle events.

Called when a RAN function gains its first subscriber or loses its last subscriber. This allows the E3Agent to start/stop Service Models as needed.

Parameters
ran_function_idThe RAN function ID
should_startTrue if SM should start, false if it should stop

Definition at line 45 of file subscription_manager.hpp.

◆ SubscriptionRequestHandler

Definition at line 42 of file e3_interface.hpp.

◆ SubscriptionResponseHandler

typedef std::function< void(const SubscriptionResponse &)> libe3::SubscriptionResponseHandler = std::function<void(const SubscriptionResponse&)>

Definition at line 37 of file e3_agent.hpp.

◆ Timestamp

using libe3::Timestamp = std::chrono::time_point<std::chrono::steady_clock>

Timestamp type using steady_clock for monotonic time.

Definition at line 491 of file types.hpp.

◆ XAppControlHandler

typedef std::function< void(const XAppControlAction &)> libe3::XAppControlHandler = std::function<void(const XAppControlAction&)>

Definition at line 39 of file e3_agent.hpp.

Enumeration Type Documentation

◆ ActionType

enum class libe3::ActionType : uint8_t
strong

E3AP action types for Setup and Subscription requests.

Enumerator
INSERT 

Insert/create new entry.

UPDATE 

Update existing entry.

DELETE 

Delete existing entry.

Definition at line 92 of file types.hpp.

◆ AgentState

enum class libe3::AgentState : uint8_t
strong

Agent state machine states.

Enumerator
UNINITIALIZED 

Agent not yet initialized.

INITIALIZED 

Agent initialized but not connected.

CONNECTING 

Connection in progress.

CONNECTED 

Connected and ready for operations.

RUNNING 

Main processing loop active.

STOPPING 

Shutdown in progress.

STOPPED 

Agent fully stopped.

ERROR 

Error state.

Definition at line 126 of file types.hpp.

◆ E3LinkLayer

enum class libe3::E3LinkLayer : uint8_t
strong

Link layer types (matches Python E3LinkLayer).

Enumerator
ZMQ 

ZeroMQ-based transport.

POSIX 

POSIX socket-based transport.

Definition at line 60 of file types.hpp.

◆ E3Role

enum class libe3::E3Role : uint8_t
strong

Role this E3 endpoint plays in the protocol.

RAN is the existing behaviour: the agent binds the setup/inbound/outbound sockets and answers dApp requests. DAPP is the symmetric client side: the agent connects to those endpoints and drives setup/subscribe/release.

Default is RAN so that any caller compiled against earlier libe3 headers keeps today's behaviour.

Enumerator
RAN 

RAN function (binds sockets; today's only behaviour).

DAPP 

dApp (connects to a RAN agent)

Definition at line 75 of file types.hpp.

◆ E3TransportLayer

enum class libe3::E3TransportLayer : uint8_t
strong

Transport layer types (matches Python E3TransportLayer).

Enumerator
SCTP 

SCTP (O-RAN standard).

TCP 

TCP.

IPC 

Unix Domain Sockets / IPC.

Definition at line 83 of file types.hpp.

◆ EncodingFormat

enum class libe3::EncodingFormat : uint8_t
strong

E3AP encoding formats supported by the library.

Enumerator
ASN1 

ASN.1 PER encoding (standard O-RAN format).

JSON 

JSON encoding (for development/debugging).

PROTOBUF 

Protocol Buffers encoding.

Definition at line 51 of file types.hpp.

◆ ErrorCode

enum class libe3::ErrorCode : int
strong

Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes.h).

Enumerator
LIBE3_ERROR_CODE_LIST 

Definition at line 141 of file types.hpp.

◆ LogLevel

enum class libe3::LogLevel : int
strong

Logging levels.

Enumerator
NONE 
ERROR 
WARN 
INFO 
DEBUG 
TRACE 

Definition at line 33 of file logger.hpp.

◆ PduType

enum class libe3::PduType : uint8_t
strong

E3AP PDU types.

Enumerator
SETUP_REQUEST 
SETUP_RESPONSE 
SUBSCRIPTION_REQUEST 
SUBSCRIPTION_DELETE 
SUBSCRIPTION_RESPONSE 
INDICATION_MESSAGE 
DAPP_CONTROL_ACTION 
DAPP_REPORT 
XAPP_CONTROL_ACTION 
RELEASE_MESSAGE 
MESSAGE_ACK 

Definition at line 109 of file types.hpp.

◆ ResponseCode

enum class libe3::ResponseCode : uint8_t
strong

E3AP response codes.

Enumerator
POSITIVE 

Request accepted.

NEGATIVE 

Request rejected.

Definition at line 101 of file types.hpp.

Function Documentation

◆ action_type_to_string()

const char * libe3::action_type_to_string ( ActionType type)
inlinenoexcept

Convert ActionType to string representation.

Definition at line 535 of file types.hpp.

◆ agent_state_to_string()

const char * libe3::agent_state_to_string ( AgentState state)
inlinenoexcept

Convert AgentState to string representation.

Definition at line 588 of file types.hpp.

◆ cpu_relax()

void libe3::cpu_relax ( )
inlinenoexcept

Emit a CPU-level pause/yield hint inside spin-wait loops.

Reduces power consumption and inter-core bus traffic while spinning. On architectures without a dedicated pause instruction this is a no-op.

Definition at line 202 of file mpmc_queue.hpp.

◆ create_connector()

std::unique_ptr< E3Connector > libe3::create_connector ( E3LinkLayer link_layer,
E3TransportLayer transport_layer,
const std::string & setup_endpoint,
const std::string & inbound_endpoint,
const std::string & outbound_endpoint,
uint16_t setup_port,
uint16_t inbound_port,
uint16_t outbound_port,
size_t io_threads = 2,
E3Role role = E3Role::RAN )

Factory function to create appropriate connector.

Creates a connector instance based on the link and transport layers specified.

Parameters
link_layerLink layer to use (ZMQ or POSIX)
transport_layerTransport layer to use (SCTP, TCP, or IPC)
setup_endpointEndpoint for setup channel
inbound_endpointEndpoint for inbound channel
outbound_endpointEndpoint for outbound channel
io_threadsNumber of I/O threads (for ZMQ)
Returns
Unique pointer to created connector, nullptr on failure

Definition at line 18 of file connector_factory.cpp.

◆ create_encoder()

std::unique_ptr< E3Encoder > libe3::create_encoder ( EncodingFormat format)

Factory function to create appropriate encoder.

Creates an encoder instance based on the encoding format specified.

Parameters
formatEncoding format to use
Returns
Unique pointer to created encoder, nullptr on failure

Definition at line 46 of file encoder_factory.cpp.

◆ error_code_to_string()

const char * libe3::error_code_to_string ( ErrorCode code)
inlinenoexcept

Convert ErrorCode to string representation.

Definition at line 558 of file types.hpp.

◆ ErrorCodeToString()

const char * libe3::ErrorCodeToString ( ErrorCode code)
inline

Convert ErrorCode to string name (C++ wrapper).

Definition at line 150 of file types.hpp.

◆ link_layer_to_string()

const char * libe3::link_layer_to_string ( E3LinkLayer layer)
inlinenoexcept

Convert E3LinkLayer to string representation.

Definition at line 616 of file types.hpp.

◆ now_realtime_ns()

uint64_t libe3::now_realtime_ns ( )
inlinenoexcept

Current realtime clock reading, in nanoseconds since the Unix epoch.

This is the clock behind every producer-side timestamp libE3 puts on the wire, chosen so the value stays comparable across hosts (bounded by whatever NTP or PTP discipline is in place) rather than being meaningful only within one process.

Warning
This is CLOCK_REALTIME, not a monotonic clock. It can step backwards or jump when the system clock is adjusted, and it must never be subtracted from a monotonic reading to derive a duration.

Definition at line 41 of file types.hpp.

◆ pdu_type_to_string()

const char * libe3::pdu_type_to_string ( PduType type)
inlinenoexcept

Convert PduType to string representation.

Definition at line 515 of file types.hpp.

◆ response_code_to_string()

const char * libe3::response_code_to_string ( ResponseCode code)
inlinenoexcept

Convert ResponseCode to string representation.

Definition at line 547 of file types.hpp.

◆ role_to_string()

const char * libe3::role_to_string ( E3Role role)
inlinenoexcept

Convert E3Role to string representation.

Definition at line 605 of file types.hpp.

◆ transport_layer_to_string()

const char * libe3::transport_layer_to_string ( E3TransportLayer layer)
inlinenoexcept

Convert E3TransportLayer to string representation.

Definition at line 627 of file types.hpp.

◆ version() [1/2]

const char * libe3::version ( )
inlinenoexcept

Get libe3 version string.

Get library version string.

Definition at line 34 of file libe3.hpp.

◆ version() [2/2]

void libe3::version ( int & major,
int & minor,
int & patch )
inlinenoexcept

Get libe3 version as components.

Get library version as integers.

Parameters
[out]majorMajor version number
[out]minorMinor version number
[out]patchPatch version number

Definition at line 41 of file libe3.hpp.

Variable Documentation

◆ CACHE_LINE_SIZE

size_t libe3::CACHE_LINE_SIZE = 64
staticconstexpr

Assumed cache-line size (bytes) used for alignment padding.

Definition at line 30 of file mpmc_queue.hpp.

◆ DEFAULT_BUFFER_SIZE

size_t libe3::DEFAULT_BUFFER_SIZE = 60000
constexpr

Definition at line 165 of file types.hpp.

◆ LIBE3_PROTOCOL_VERSION

uint32_t libe3::LIBE3_PROTOCOL_VERSION = 1
constexpr

Definition at line 168 of file types.hpp.

◆ MAX_ACTION_DATA_SIZE

size_t libe3::MAX_ACTION_DATA_SIZE = 32768
constexpr

Definition at line 161 of file types.hpp.

◆ MAX_DAPP_REPORT_DATA_SIZE

size_t libe3::MAX_DAPP_REPORT_DATA_SIZE = 32768
constexpr

Definition at line 162 of file types.hpp.

◆ MAX_PROTOCOL_DATA_SIZE

size_t libe3::MAX_PROTOCOL_DATA_SIZE = 32768
constexpr

Definition at line 160 of file types.hpp.

◆ MAX_RAN_FUNCTIONS

size_t libe3::MAX_RAN_FUNCTIONS = 255
constexpr

Definition at line 164 of file types.hpp.

◆ MAX_XAPP_CTRL_DATA_SIZE

size_t libe3::MAX_XAPP_CTRL_DATA_SIZE = 32768
constexpr

Definition at line 163 of file types.hpp.