|
libe3 0.6.1
C++ library for E3AP RAN vendor integration
|
Abstract base class for E3AP transport connectors. More...
#include <e3_connector.hpp>
Public Member Functions | |
| virtual | ~E3Connector ()=default |
| E3Connector (const E3Connector &)=delete | |
| E3Connector & | operator= (const E3Connector &)=delete |
| E3Connector (E3Connector &&)=default | |
| Move constructor. | |
| E3Connector & | operator= (E3Connector &&)=default |
| Move assignment. | |
| virtual ErrorCode | setup_initial_connection ()=0 |
| Set up the initial connection (setup channel). | |
| virtual int | recv_setup_request (std::vector< uint8_t > &buffer)=0 |
| Receive a setup request. | |
| virtual ErrorCode | send_response (const std::vector< uint8_t > &data)=0 |
| Send a setup response. | |
| virtual ErrorCode | setup_inbound_connection ()=0 |
| Set up the inbound connection (SUB channel). | |
| virtual int | receive (std::vector< uint8_t > &buffer)=0 |
| Receive data from the inbound channel. | |
| virtual ErrorCode | setup_outbound_connection ()=0 |
| Set up the outbound connection (PUB channel). | |
| virtual ErrorCode | send (const std::vector< uint8_t > &data)=0 |
| Send data on the outbound channel. | |
| virtual ErrorCode | send_to (uint64_t peer_token, const std::vector< uint8_t > &data, PduClass kind) |
| Send data to one peer, or to all of them (RAN role). | |
| virtual ErrorCode | setup_initial_connection_client () |
| Connect the setup channel (dApp role: REQ connect). | |
| virtual ErrorCode | send_setup_request_client (const std::vector< uint8_t > &) |
| Send a SetupRequest on the setup channel (dApp role). | |
| virtual int | recv_setup_response_client (std::vector< uint8_t > &) |
| Receive a SetupResponse on the setup channel (dApp role). | |
| virtual ErrorCode | setup_inbound_connection_client () |
| Connect the inbound channel (dApp role: SUB connect to the RAN's publisher endpoint). | |
| virtual ErrorCode | setup_outbound_connection_client () |
| Connect the outbound channel (dApp role: PUB connect to the RAN's subscriber endpoint). | |
| virtual void | dispose ()=0 |
| Clean up and release all resources. | |
| virtual void | shutdown () |
| Interrupt blocking operations for shutdown. | |
| virtual uint64_t | last_peer_token () const |
| Which peer supplied the bytes the last receive() returned (RAN role). | |
| virtual uint64_t | last_setup_peer_token () const |
| Which peer sent the setup request the last recv_setup_request() returned (RAN role). | |
| virtual std::vector< uint64_t > | take_closed_peers () |
| Peers whose connection has closed since the last call (RAN role). | |
| virtual E3LinkLayer | link_layer () const noexcept=0 |
| Get the link layer type. | |
| virtual E3TransportLayer | transport_layer () const noexcept=0 |
| Get the transport layer type. | |
| virtual bool | is_connected () const noexcept=0 |
| Check if connector is connected. | |
| void | set_role (E3Role role) noexcept |
| Set role (RAN or DAPP). Affects bind vs connect direction and cleanup behaviour. Must be set before any setup_* call. Default RAN. | |
| E3Role | role () const noexcept |
| Get current role. | |
| const std::string & | setup_endpoint () const noexcept |
| Get setup endpoint. | |
| const std::string & | inbound_endpoint () const noexcept |
| Get inbound endpoint. | |
| const std::string & | outbound_endpoint () const noexcept |
| Get outbound endpoint. | |
Protected Member Functions | |
| E3Connector ()=default | |
Protected Attributes | |
| std::string | setup_endpoint_ |
| Endpoint of the setup channel. | |
| std::string | inbound_endpoint_ |
| Endpoint of the inbound channel. | |
| std::string | outbound_endpoint_ |
| Endpoint of the outbound channel. | |
| E3Role | role_ {E3Role::RAN} |
| Role of this peer. | |
Abstract base class for E3AP transport connectors.
This class defines the transport-agnostic interface that all connectors must implement. The design mirrors the original C implementation's function pointer approach, but uses virtual methods for type safety.
Derived classes:
Definition at line 64 of file e3_connector.hpp.
|
virtualdefault |
|
delete |
|
default |
Move constructor.
|
protecteddefault |
|
pure virtual |
Clean up and release all resources.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinenoexcept |
Get inbound endpoint.
Definition at line 294 of file e3_connector.hpp.
|
pure virtualnoexcept |
Check if connector is connected.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinevirtual |
Which peer supplied the bytes the last receive() returned (RAN role).
Call it on the thread that calls receive(), right after a receive() that returned bytes. A token names one accepted connection and is never reused by the same connector, so a closed peer's token cannot name a later one.
Reimplemented in libe3::PosixE3Connector.
Definition at line 227 of file e3_connector.hpp.
|
inlinevirtual |
Which peer sent the setup request the last recv_setup_request() returned (RAN role).
Call it on the thread that calls recv_setup_request(), right after a call that returned bytes. The token is the one last_peer_token() gives for the same peer's later bytes, so a RAN can tie a dApp to its connection at setup.
Reimplemented in libe3::PosixE3Connector.
Definition at line 239 of file e3_connector.hpp.
|
pure virtualnoexcept |
Get the link layer type.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
delete |
|
default |
Move assignment.
|
inlinenoexcept |
Get outbound endpoint.
Definition at line 300 of file e3_connector.hpp.
|
pure virtual |
Receive data from the inbound channel.
| buffer | Buffer to store received data |
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
pure virtual |
Receive a setup request.
Blocks until a setup request is received on the setup channel.
| buffer | Buffer to store received data |
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinevirtual |
Receive a SetupResponse on the setup channel (dApp role).
Reimplemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
Definition at line 182 of file e3_connector.hpp.
|
inlinenoexcept |
|
pure virtual |
Send data on the outbound channel.
| data | Data to send |
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
pure virtual |
Send a setup response.
| data | Response data to send |
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinevirtual |
Send a SetupRequest on the setup channel (dApp role).
Reimplemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
Definition at line 174 of file e3_connector.hpp.
|
inlinevirtual |
Send data to one peer, or to all of them (RAN role).
The default broadcasts with send(), which is what a connector that cannot tell its peers apart does.
| peer_token | The peer named by last_peer_token() or last_setup_peer_token(); 0 sends to every peer |
| data | Data to send |
| kind | What the PDU is for |
Reimplemented in libe3::PosixE3Connector.
Definition at line 146 of file e3_connector.hpp.
|
inlinenoexcept |
Set role (RAN or DAPP). Affects bind vs connect direction and cleanup behaviour. Must be set before any setup_* call. Default RAN.
| role | The role of this peer |
Definition at line 276 of file e3_connector.hpp.
|
inlinenoexcept |
Get setup endpoint.
Definition at line 288 of file e3_connector.hpp.
|
pure virtual |
Set up the inbound connection (SUB channel).
This establishes the channel for receiving control actions from dApps.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinevirtual |
Connect the inbound channel (dApp role: SUB connect to the RAN's publisher endpoint).
Reimplemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
Definition at line 191 of file e3_connector.hpp.
|
pure virtual |
Set up the initial connection (setup channel).
This establishes the REQ/REP channel used for E3 Setup procedures.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinevirtual |
Connect the setup channel (dApp role: REQ connect).
Reimplemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
Definition at line 166 of file e3_connector.hpp.
|
pure virtual |
Set up the outbound connection (PUB channel).
This establishes the channel for sending indications to dApps.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
inlinevirtual |
Connect the outbound channel (dApp role: PUB connect to the RAN's subscriber endpoint).
Reimplemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
Definition at line 200 of file e3_connector.hpp.
|
inlinevirtual |
Interrupt blocking operations for shutdown.
Called before joining threads to unblock any blocking socket operations. Default implementation does nothing (for connectors that use timeouts).
Reimplemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
Definition at line 215 of file e3_connector.hpp.
|
inlinevirtual |
Peers whose connection has closed since the last call (RAN role).
Call it on the thread that calls receive(). Each token is returned once, and only after the bytes that peer sent before closing were delivered. The default returns nothing: a connector that cannot tell its peers apart cannot tell that one left.
Reimplemented in libe3::PosixE3Connector.
Definition at line 251 of file e3_connector.hpp.
|
pure virtualnoexcept |
Get the transport layer type.
Implemented in libe3::PosixE3Connector, and libe3::ZmqE3Connector.
|
protected |
Endpoint of the inbound channel.
Definition at line 306 of file e3_connector.hpp.
|
protected |
Endpoint of the outbound channel.
Definition at line 307 of file e3_connector.hpp.
|
protected |
Role of this peer.
Definition at line 308 of file e3_connector.hpp.
|
protected |
Endpoint of the setup channel.
Definition at line 305 of file e3_connector.hpp.