12#ifndef LIBE3_E3_CONNECTOR_HPP
13#define LIBE3_E3_CONNECTOR_HPP
80 virtual int receive(std::vector<uint8_t>& buffer) = 0;
111 return ErrorCode::INVALID_PARAM;
118 return ErrorCode::INVALID_PARAM;
125 return static_cast<int>(ErrorCode::INVALID_PARAM);
133 return ErrorCode::INVALID_PARAM;
141 return ErrorCode::INVALID_PARAM;
223 const std::string& setup_endpoint,
224 const std::string& inbound_endpoint,
225 const std::string& outbound_endpoint,
227 uint16_t inbound_port,
228 uint16_t outbound_port,
229 size_t io_threads = 2,
virtual ErrorCode setup_inbound_connection()=0
Set up the inbound connection (SUB channel).
virtual ~E3Connector()=default
virtual int recv_setup_request(std::vector< uint8_t > &buffer)=0
Receive a setup request.
void set_role(E3Role role) noexcept
Set role (RAN or DAPP). Affects bind vs connect direction and cleanup behaviour. Must be set before a...
std::string inbound_endpoint_
std::string outbound_endpoint_
virtual bool is_connected() const noexcept=0
Check if connector is connected.
std::string setup_endpoint_
const std::string & inbound_endpoint() const noexcept
Get inbound endpoint.
E3Connector & operator=(E3Connector &&)=default
virtual ErrorCode setup_outbound_connection()=0
Set up the outbound connection (PUB channel).
const std::string & setup_endpoint() const noexcept
Get setup endpoint.
virtual void shutdown()
Interrupt blocking operations for shutdown.
virtual void dispose()=0
Clean up and release all resources.
virtual E3LinkLayer link_layer() const noexcept=0
Get the link layer type.
virtual ErrorCode send_response(const std::vector< uint8_t > &data)=0
Send a setup response.
virtual int receive(std::vector< uint8_t > &buffer)=0
Receive data from the inbound channel.
virtual E3TransportLayer transport_layer() const noexcept=0
Get the transport layer type.
const std::string & outbound_endpoint() const noexcept
Get outbound endpoint.
E3Connector(E3Connector &&)=default
virtual ErrorCode setup_initial_connection_client()
Connect the setup channel (dApp role: REQ connect).
E3Connector & operator=(const E3Connector &)=delete
virtual int recv_setup_response_client(std::vector< uint8_t > &)
Receive a SetupResponse on the setup channel (dApp role).
E3Connector(const E3Connector &)=delete
virtual ErrorCode send(const std::vector< uint8_t > &data)=0
Send data on the outbound channel.
virtual ErrorCode setup_initial_connection()=0
Set up the initial connection (setup channel).
virtual ErrorCode setup_outbound_connection_client()
Connect the outbound channel (dApp role: PUB connect to the RAN's subscriber endpoint).
E3Role role() const noexcept
Get current role.
virtual ErrorCode setup_inbound_connection_client()
Connect the inbound channel (dApp role: SUB connect to the RAN's publisher endpoint).
virtual ErrorCode send_setup_request_client(const std::vector< uint8_t > &)
Send a SetupRequest on the setup channel (dApp role).
ErrorCode
Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes....
E3TransportLayer
Transport layer types (matches Python E3TransportLayer).
E3Role
Role this E3 endpoint plays in the protocol.
@ RAN
RAN function (binds sockets; today's only behaviour).
E3LinkLayer
Link layer types (matches Python E3LinkLayer).
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.
E3AP Protocol Types - Vendor-neutral type definitions.