|
libe3 0.6.1
C++ library for E3AP RAN vendor integration
|
Namespaces | |
| namespace | e2sm_dapp |
| namespace | e3ap |
| namespace | py |
Classes | |
| class | DAppSubscriptionState |
| class | E3Agent |
| E3Agent - Main façade for RAN vendor integration. More... | |
| struct | PosixOptions |
| Socket and admission options of the POSIX link. 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... | |
| struct | ExpiredSubscription |
| A subscription ended because its subscriptionTime ran out. 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 | ControlResponse |
| E3AP Control Response structure. More... | |
| struct | ControlResult |
| What a Service Model answers to a control (see ServiceModel::respond_to_control). 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: one endpoint per dApp. 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&)> |
| Called for a MessageAck. DEPRECATED TO BE REMOVED: libe3 does not send one, it reads one from another RAN. | |
| using | ControlResponseHandler = std::function<void(const ControlResponse&)> |
| Called for a ControlResponse: on a dApp, the RAN's answer to its control; on a RAN, the dApp's answer to an xApp control. | |
| using | DisconnectHandler = std::function<void(DisconnectReason)> |
| 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&)> |
| Called for a SubscriptionRequest; the returned code is the answer. | |
| 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 | SubscriptionClock = std::function<std::chrono::steady_clock::time_point()> |
| Source of "now" for subscription expiry. Empty means std::chrono::steady_clock. | |
| 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 | PduClass : uint8_t { PROCEDURE = 0 , INDICATION = 1 } |
| What a PDU is for, so that a link that has streams can pick one. More... | |
| 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 | Cause : uint8_t { UNSPECIFIED = 0 , PROTOCOL_ERROR = 1 , SETUP_REQUIRED = 2 , SETUP_ALREADY_COMPLETE = 3 , UNSUPPORTED_PROTOCOL_VERSION = 4 , UNSUPPORTED_RAN_FUNCTION = 5 , UNSUPPORTED_IDENTIFIER = 6 , INVALID_REQUEST = 7 , NOT_FOUND = 8 , DUPLICATE = 9 , RESOURCE_EXHAUSTED = 10 , AUTHORIZATION_REJECTED = 11 , PAYLOAD_TOO_LARGE = 12 , TRANSPORT_OVERRUN = 13 , SHUTTING_DOWN = 14 } |
| Why a RAN refused a request (E3-Cause). More... | |
| enum class | DisconnectReason : uint8_t { RELEASED_BY_RAN = 0 , CONNECTION_LOST = 1 } |
| Why a dApp's session with the RAN ended (see DisconnectHandler). 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 , CONTROL_RESPONSE = 11 } |
| 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, const PosixOptions &posix=PosixOptions{}) |
| 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 * | cause_to_string (Cause cause) noexcept |
| Convert Cause to the name E3AP gives it in JSON and in logs. | |
| Cause | cause_from_string (const std::string &name) noexcept |
| Read a Cause from its E3AP name. | |
| Cause | cause_from_value (long value) noexcept |
| Read a Cause from its wire value. | |
| 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 |
| Largest protocolData of an indication, in bytes. | |
| constexpr size_t | MAX_ACTION_DATA_SIZE = 32768 |
| Largest actionData of a dApp control action, in bytes. | |
| constexpr size_t | MAX_DAPP_REPORT_DATA_SIZE = 32768 |
| Largest reportData of a dApp report, in bytes. | |
| constexpr size_t | MAX_XAPP_CTRL_DATA_SIZE = 32768 |
| Largest xAppControlData of an xApp control action, in bytes. | |
| constexpr size_t | MAX_PENDING_CONTROLS = 1024 |
| Most dApp controls a RAN holds an answer for at once. | |
| constexpr size_t | MAX_CONTROL_OUTCOME_SIZE = 32768 |
| Largest controlOutcome of a control response, in bytes. | |
| constexpr size_t | MAX_RAN_FUNCTIONS = 64 |
| ranFunctionList SIZE (0..64) | |
| constexpr size_t | MAX_IDENTIFIER_LIST_SIZE = 256 |
| telemetry and control lists SIZE (0..256) | |
| constexpr size_t | DEFAULT_BUFFER_SIZE = 60000 |
| Default encode and receive buffer size, in bytes. | |
| constexpr size_t | MAX_DETAIL_SIZE = 512 |
| Largest detail text of a negative response, in bytes (E3-Text). | |
| constexpr uint32_t | LIBE3_PROTOCOL_VERSION = 1 |
| Protocol version this library speaks. | |
| typedef std::function< void(const ControlResponse &)> libe3::ControlResponseHandler = std::function<void(const ControlResponse&)> |
Called for a ControlResponse: on a dApp, the RAN's answer to its control; on a RAN, the dApp's answer to an xApp control.
Callback for a ControlResponse: the RAN's answer to a dApp control (RAN → dApp), or a dApp's answer to an xApp control (dApp → RAN).
Definition at line 47 of file e3_agent.hpp.
| 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.
| 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.
| typedef std::function< void(DisconnectReason)> libe3::DisconnectHandler = std::function<void(DisconnectReason)> |
Callback for the end of the dApp's session with the RAN, with the reason.
Definition at line 49 of file e3_agent.hpp.
| using libe3::EncodeResult = tl::expected<T, ErrorCode> |
Result type for encoding/decoding operations.
Definition at line 26 of file e3_encoder.hpp.
| typedef std::function< void(const IndicationMessage &)> libe3::IndicationHandler = std::function<void(const IndicationMessage&)> |
Callback for an IndicationMessage (RAN → dApp).
Definition at line 41 of file e3_agent.hpp.
| 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.
| level | Log level |
| component | Component name (e.g., "E3Agent", "Connector") |
| message | Log message |
Definition at line 50 of file logger.hpp.
| typedef std::function< void(const MessageAck &)> libe3::MessageAckHandler = std::function<void(const MessageAck&)> |
Called for a MessageAck. DEPRECATED TO BE REMOVED: libe3 does not send one, it reads one from another RAN.
Callback for a MessageAck (RAN → dApp). DEPRECATED TO BE REMOVED: libe3 does not send one.
Definition at line 45 of file e3_agent.hpp.
| using libe3::PduChoice |
Generic E3AP PDU using std::variant for type-safe union.
| using libe3::SetupRequestHandler = std::function<ResponseCode(const SetupRequest&, SetupResponse&)> |
Callback types for E3Interface events.
Definition at line 41 of file e3_interface.hpp.
| typedef std::function< void(const SetupResponse &)> libe3::SetupResponseHandler = std::function<void(const SetupResponse&)> |
Callback for a SetupResponse (RAN → dApp).
Definition at line 37 of file e3_agent.hpp.
| using libe3::SmFactory = std::function<std::unique_ptr<ServiceModel>()> |
Factory function type for creating SM instances.
Definition at line 300 of file sm_interface.hpp.
| 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.
| ran_function_id | The RAN function ID |
| should_start | True if SM should start, false if it should stop |
Definition at line 62 of file subscription_manager.hpp.
| using libe3::SubscriptionClock = std::function<std::chrono::steady_clock::time_point()> |
Source of "now" for subscription expiry. Empty means std::chrono::steady_clock.
Definition at line 50 of file subscription_manager.hpp.
| using libe3::SubscriptionRequestHandler = std::function<ResponseCode(const SubscriptionRequest&)> |
Called for a SubscriptionRequest; the returned code is the answer.
| request | The request |
Definition at line 43 of file e3_interface.hpp.
| typedef std::function< void(const SubscriptionResponse &)> libe3::SubscriptionResponseHandler = std::function<void(const SubscriptionResponse&)> |
Callback for a SubscriptionResponse (RAN → dApp).
Definition at line 39 of file e3_agent.hpp.
| using libe3::Timestamp = std::chrono::time_point<std::chrono::steady_clock> |
| typedef std::function< void(const XAppControlAction &)> libe3::XAppControlHandler = std::function<void(const XAppControlAction&)> |
Callback for an XAppControlAction (xApp → dApp via the RAN).
Definition at line 43 of file e3_agent.hpp.
|
strong |
|
strong |
Agent state machine states.
|
strong |
Why a RAN refused a request (E3-Cause).
Carried with a negative setup response, subscription response or message acknowledgment, next to a free-text detail. The names and values are the ones OCUDU's E3AP grammar uses; Aerial has no code and sends only text.
|
strong |
Why a dApp's session with the RAN ended (see DisconnectHandler).
| Enumerator | |
|---|---|
| RELEASED_BY_RAN | The RAN sent a ReleaseMessage for this dApp. |
| CONNECTION_LOST | The peer closed the connection or the link failed. |
|
strong |
Link layer types (matches Python E3LinkLayer).
| Enumerator | |
|---|---|
| ZMQ | ZeroMQ-based transport. |
| POSIX | POSIX socket-based transport. |
|
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) |
|
strong |
Transport layer types (matches Python E3TransportLayer).
| Enumerator | |
|---|---|
| SCTP | SCTP (O-RAN standard). |
| TCP | TCP. |
| IPC | Unix Domain Sockets / IPC. |
|
strong |
|
strong |
Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes.h).
| Enumerator | |
|---|---|
| LIBE3_ERROR_CODE_LIST | |
|
strong |
Logging levels.
| Enumerator | |
|---|---|
| NONE | |
| ERROR | |
| WARN | |
| INFO | |
| DEBUG | |
| TRACE | |
Definition at line 33 of file logger.hpp.
|
strong |
What a PDU is for, so that a link that has streams can pick one.
A connector does not decode the PDUs it carries. The caller says which kind a PDU is, and a link with more than one stream (SCTP) sends indications on one and everything else on the other.
| Enumerator | |
|---|---|
| PROCEDURE | A request, a response, a control, a release: anything but an indication. |
| INDICATION | An indication message. |
Definition at line 31 of file e3_connector.hpp.
|
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 | DEPRECATED TO BE REMOVED: libe3 no longer sends it, see CONTROL_RESPONSE. |
| CONTROL_RESPONSE | |
|
strong |
|
inlinenoexcept |
Convert ActionType to string representation.
| type | Action type |
|
inlinenoexcept |
Convert AgentState to string representation.
| state | Agent state |
|
inlinenoexcept |
Read a Cause from its E3AP name.
| name | camelCase name, for example "unsupportedIdentifier" |
|
inlinenoexcept |
Read a Cause from its wire value.
| value | Enumeration value as APER or Protocol Buffers carries it |
|
inlinenoexcept |
|
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.
| 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, | ||
| const PosixOptions & | posix = PosixOptions{} ) |
Factory function to create appropriate connector.
Creates a connector instance based on the link and transport layers specified.
| link_layer | Link layer to use (ZMQ or POSIX) |
| transport_layer | Transport layer to use (SCTP, TCP, or IPC) |
| setup_endpoint | Endpoint for setup channel |
| inbound_endpoint | Endpoint for inbound channel |
| outbound_endpoint | Endpoint for outbound channel |
| setup_port | Port of the setup channel (SCTP and TCP; IPC uses the endpoint path) |
| inbound_port | Port of the inbound channel (SCTP and TCP) |
| outbound_port | Port of the outbound channel (SCTP and TCP) |
| io_threads | Number of I/O threads (for ZMQ) |
| role | Role of the peer (RAN or dApp) |
| posix | Socket and admission options of the POSIX link (ignored by ZMQ) |
The POSIX link serves everything on the setup endpoint and port, and ignores the inbound and outbound ones.
Definition at line 18 of file connector_factory.cpp.
| 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.
| format | Encoding format to use |
Definition at line 46 of file encoder_factory.cpp.
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
Convert E3LinkLayer to string representation.
| layer | Link layer |
|
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.
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.
|
inlinenoexcept |
|
inlinenoexcept |
Convert ResponseCode to string representation.
| code | Response code |
|
inlinenoexcept |
|
inlinenoexcept |
Convert E3TransportLayer to string representation.
| layer | Transport layer |
|
inlinenoexcept |
|
inlinenoexcept |
|
staticconstexpr |
Assumed cache-line size (bytes) used for alignment padding.
Definition at line 30 of file mpmc_queue.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |