|
libe3 0.2.5
C++ library for E3AP RAN vendor integration
|
POSIX socket-based E3 connector. More...
#include <posix_connector.hpp>
Public Member Functions | |
| PosixE3Connector (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) | |
| ~PosixE3Connector () override | |
| ErrorCode | setup_initial_connection () override |
| Set up the initial connection (setup channel). | |
| int | recv_setup_request (std::vector< uint8_t > &buffer) override |
| Receive a setup request. | |
| ErrorCode | send_response (const std::vector< uint8_t > &data) override |
| Send a setup response. | |
| ErrorCode | setup_inbound_connection () override |
| Set up the inbound connection (SUB channel). | |
| int | receive (std::vector< uint8_t > &buffer) override |
| Receive data from the inbound channel. | |
| ErrorCode | setup_outbound_connection () override |
| Set up the outbound connection (PUB channel). | |
| ErrorCode | send (const std::vector< uint8_t > &data) override |
| Send data on the outbound channel. | |
| ErrorCode | setup_initial_connection_client () override |
| Connect the setup channel (dApp role: REQ connect). | |
| ErrorCode | send_setup_request_client (const std::vector< uint8_t > &data) override |
| Send a SetupRequest on the setup channel (dApp role). | |
| int | recv_setup_response_client (std::vector< uint8_t > &buffer) override |
| Receive a SetupResponse on the setup channel (dApp role). | |
| ErrorCode | setup_inbound_connection_client () override |
| Connect the inbound channel (dApp role: SUB connect to the RAN's publisher endpoint). | |
| ErrorCode | setup_outbound_connection_client () override |
| Connect the outbound channel (dApp role: PUB connect to the RAN's subscriber endpoint). | |
| void | dispose () override |
| Clean up and release all resources. | |
| void | shutdown () override |
| Interrupt blocking operations for shutdown. | |
| E3LinkLayer | link_layer () const noexcept override |
| Get the link layer type. | |
| E3TransportLayer | transport_layer () const noexcept override |
| Get the transport layer type. | |
| bool | is_connected () const noexcept override |
| Check if connector is connected. | |
| Public Member Functions inherited from libe3::E3Connector | |
| virtual | ~E3Connector ()=default |
| E3Connector (const E3Connector &)=delete | |
| E3Connector & | operator= (const E3Connector &)=delete |
| E3Connector (E3Connector &&)=default | |
| E3Connector & | operator= (E3Connector &&)=default |
| 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. | |
Additional Inherited Members | |
| Protected Member Functions inherited from libe3::E3Connector | |
| E3Connector ()=default | |
| Protected Attributes inherited from libe3::E3Connector | |
| std::string | setup_endpoint_ |
| std::string | inbound_endpoint_ |
| std::string | outbound_endpoint_ |
| E3Role | role_ {E3Role::RAN} |
POSIX socket-based E3 connector.
Provides transport using POSIX sockets. Supports TCP, SCTP, and IPC transports. Ported from the original C implementation's posix_* functions.
RAN role serves multiple dApp peers: both data listeners keep accepting for the connector's lifetime, receive() polls every accepted subscriber socket, and send() broadcasts each framed message to every accepted indication socket (mirroring the ZMQ PUB/SUB semantics, where the RAN broadcasts and each dApp filters by its own dApp identifier). Peer sockets are only touched by their owning I/O thread: inbound sockets by the inbound loop, outbound sockets by the outbound loop.
Definition at line 33 of file posix_connector.hpp.
| libe3::PosixE3Connector::PosixE3Connector | ( | 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 ) |
Definition at line 208 of file posix_connector.cpp.
|
override |
Definition at line 238 of file posix_connector.cpp.
|
overridevirtual |
Clean up and release all resources.
Implements libe3::E3Connector.
Definition at line 855 of file posix_connector.cpp.
|
inlineoverridevirtualnoexcept |
Check if connector is connected.
Implements libe3::E3Connector.
Definition at line 73 of file posix_connector.hpp.
|
inlineoverridevirtualnoexcept |
Get the link layer type.
Implements libe3::E3Connector.
Definition at line 65 of file posix_connector.hpp.
|
overridevirtual |
Receive data from the inbound channel.
| buffer | Buffer to store received data |
Implements libe3::E3Connector.
Definition at line 462 of file posix_connector.cpp.
|
overridevirtual |
Receive a setup request.
Blocks until a setup request is received on the setup channel.
| buffer | Buffer to store received data |
Implements libe3::E3Connector.
Definition at line 313 of file posix_connector.cpp.
|
overridevirtual |
Receive a SetupResponse on the setup channel (dApp role).
Reimplemented from libe3::E3Connector.
Definition at line 786 of file posix_connector.cpp.
|
overridevirtual |
Send data on the outbound channel.
| data | Data to send |
Implements libe3::E3Connector.
Definition at line 642 of file posix_connector.cpp.
|
overridevirtual |
Send a setup response.
| data | Response data to send |
Implements libe3::E3Connector.
Definition at line 375 of file posix_connector.cpp.
|
overridevirtual |
Send a SetupRequest on the setup channel (dApp role).
Reimplemented from libe3::E3Connector.
Definition at line 772 of file posix_connector.cpp.
|
overridevirtual |
Set up the inbound connection (SUB channel).
This establishes the channel for receiving control actions from dApps.
Implements libe3::E3Connector.
Definition at line 389 of file posix_connector.cpp.
|
overridevirtual |
Connect the inbound channel (dApp role: SUB connect to the RAN's publisher endpoint).
Reimplemented from libe3::E3Connector.
Definition at line 797 of file posix_connector.cpp.
|
overridevirtual |
Set up the initial connection (setup channel).
This establishes the REQ/REP channel used for E3 Setup procedures.
Implements libe3::E3Connector.
Definition at line 242 of file posix_connector.cpp.
|
overridevirtual |
Connect the setup channel (dApp role: REQ connect).
Reimplemented from libe3::E3Connector.
Definition at line 751 of file posix_connector.cpp.
|
overridevirtual |
Set up the outbound connection (PUB channel).
This establishes the channel for sending indications to dApps.
Implements libe3::E3Connector.
Definition at line 573 of file posix_connector.cpp.
|
overridevirtual |
Connect the outbound channel (dApp role: PUB connect to the RAN's subscriber endpoint).
Reimplemented from libe3::E3Connector.
Definition at line 817 of file posix_connector.cpp.
|
overridevirtual |
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 from libe3::E3Connector.
Definition at line 837 of file posix_connector.cpp.
|
inlineoverridevirtualnoexcept |
Get the transport layer type.
Implements libe3::E3Connector.
Definition at line 69 of file posix_connector.hpp.