53 uint32_t request_message_id,
68 const uint8_t* report_data,
69 size_t report_data_len,
84 const uint8_t* outcome,
194 uint32_t ran_function_id,
235 const uint8_t* outcome,
444 uint32_t ran_function_id
461 uint32_t ran_function_id,
479 uint32_t ran_function_id,
501 uint32_t ran_function_id,
526 uint32_t ran_function_id,
527 const uint8_t* control_data,
528 size_t control_data_len,
529 uint32_t sequence_id,
530 uint32_t* out_message_id,
void(* e3_dapp_status_changed_cb)(void)
void e3_agent_free_uint32_array(uint32_t *arr)
Free an array previously returned by the e3_agent_get_* helpers.
e3_error_t e3_agent_register_sm(e3_agent_handle_t *agent, e3_service_model_handle_t *sm)
Register a ServiceModel implementation with the agent.
struct e3_agent_handle_s e3_agent_handle_t
e3_error_t e3_service_model_set_granted_periodicity_cb(e3_service_model_handle_t *sm, e3_sm_granted_periodicity_cb cb)
Let a C-backed ServiceModel report the interval it keeps between indications.
e3_service_model_handle_t * e3_service_model_create_from_c(const e3_c_service_model_desc_t *desc)
Create a ServiceModel implementation backed by C callbacks.
void(* e3_dapp_report_cb)(uint32_t dapp_id, uint32_t ran_function_id, const uint8_t *report_data, size_t report_data_len, uint32_t sequence_id)
uint32_t e3_agent_get_subscription_periodicity(e3_agent_handle_t *agent, uint32_t dapp_id, uint32_t ran_function_id)
Get the reporting periodicity a dApp requested for a RAN function.
e3_error_t e3_agent_set_control_response_handler(e3_agent_handle_t *agent, e3_control_response_cb handler)
Set callback for incoming control responses (dApp -> RAN): a dApp's answer to an xApp control that as...
uint32_t * e3_agent_get_ran_function_subscribers(e3_agent_handle_t *agent, uint32_t ran_function_id, size_t *out_len)
Return a newly-allocated array of dApp IDs subscribed to a RAN function.
void e3_agent_destroy(e3_agent_handle_t *agent)
Destroy an E3Agent handle.
e3_error_t(* e3_sm_process_control_cb)(e3_service_model_handle_t *sm_handle, void *sm_context, uint32_t request_message_id, uint32_t dapp_id, uint32_t ran_function_id, uint32_t control_id, const uint8_t *data, size_t data_len, uint32_t sequence_id)
void(* e3_sm_destroy_cb)(void *sm_context)
void e3_agent_stop(e3_agent_handle_t *agent)
Stop the agent and release runtime resources.
size_t e3_agent_subscription_count(e3_agent_handle_t *agent)
Total number of active subscriptions tracked by the agent.
e3_error_t e3_agent_set_dapp_report_handler(e3_agent_handle_t *agent, e3_dapp_report_cb handler)
Set callback for incoming dApp reports (dApp -> RAN).
e3_error_t(* e3_sm_start_cb)(void *sm_context)
void(* e3_sm_stop_cb)(void *sm_context)
e3_agent_handle_t * e3_agent_create_default()
Create/destroy an E3Agent handle.
e3_error_t e3_agent_send_message_ack(e3_agent_handle_t *agent, uint32_t request_id, int response_code)
Send a message acknowledgment (e.g. ack a control/request from dApp).
int e3_agent_is_running(e3_agent_handle_t *agent)
Query whether the agent is currently running.
uint32_t * e3_agent_get_registered_dapps(e3_agent_handle_t *agent, size_t *out_len)
Return a newly-allocated array of registered dApp IDs.
e3_error_t e3_service_model_emit_control_response(e3_service_model_handle_t *sm, uint32_t dapp_id, uint32_t request_id, int response_code, int cause, const char *detail, const uint8_t *outcome, size_t outcome_len)
Answer a dApp control from a ServiceModel.
e3_error_t e3_agent_send_xapp_control(e3_agent_handle_t *agent, uint32_t dapp_id, uint32_t ran_function_id, const uint8_t *control_data, size_t control_data_len, uint32_t sequence_id, uint32_t *out_message_id, int request_ack)
Send an xApp control action to a specific dApp (e.g. from E2/SM).
e3_error_t e3_service_model_emit_message_ack(e3_service_model_handle_t *sm, uint32_t request_id, int response_code)
Emit a message acknowledgment from a ServiceModel.
int(* e3_sm_is_running_cb)(void *sm_context)
int e3_agent_get_state(e3_agent_handle_t *agent)
Get the agent state as an integer matching libe3::AgentState.
e3_error_t e3_agent_start(e3_agent_handle_t *agent)
Start the agent processing threads and accept dApp connections.
void e3_service_model_destroy(e3_service_model_handle_t *sm)
Destroy a C-backed ServiceModel handle.
e3_agent_handle_t * e3_agent_create_with_config(const e3_config_t *config)
Create a new E3Agent with the given configuration.
uint32_t(* e3_sm_granted_periodicity_cb)(void *sm_context, uint32_t requested_us)
Interval a C Service Model keeps between two indications of a subscription.
e3_error_t e3_agent_send_indication(e3_agent_handle_t *agent, uint32_t dapp_id, uint32_t ran_function_id, const uint8_t *data, size_t data_len)
Send an indication message to a specific dApp.
e3_error_t e3_agent_init(e3_agent_handle_t *agent)
Initialize the agent.
uint32_t * e3_agent_get_active_ran_functions(e3_agent_handle_t *agent, size_t *out_len)
Return a newly-allocated array of RAN function IDs that currently have at least one subscriber (RAN r...
uint32_t * e3_agent_get_dapp_subscriptions(e3_agent_handle_t *agent, uint32_t dapp_id, size_t *out_len)
Return a newly-allocated array of RAN function IDs subscribed by a dApp.
struct e3_service_model_handle_s e3_service_model_handle_t
e3_error_t(* e3_sm_init_cb)(void *sm_context)
uint32_t * e3_agent_get_subscription_control_ids(e3_agent_handle_t *agent, uint32_t dapp_id, uint32_t ran_function_id, size_t *out_len)
Get the control IDs a dApp requested for a RAN function.
e3_error_t e3_service_model_emit_indication(e3_service_model_handle_t *sm, uint32_t dapp_id, uint32_t ran_function_id, const uint8_t *data, size_t data_len)
Emit an indication message from a ServiceModel to the outbound queue.
void(* e3_control_response_cb)(uint32_t dapp_id, uint32_t request_id, uint32_t ran_function_id, uint32_t control_id, int response_code, int cause, const char *detail, const uint8_t *outcome, size_t outcome_len)
size_t e3_agent_dapp_count(e3_agent_handle_t *agent)
Number of registered dApps known to the agent.
uint32_t * e3_agent_get_subscription_telemetry_ids(e3_agent_handle_t *agent, uint32_t dapp_id, uint32_t ran_function_id, size_t *out_len)
Get the telemetry IDs a dApp requested for a RAN function.
uint32_t * e3_agent_get_available_ran_functions(e3_agent_handle_t *agent, size_t *out_len)
Return a newly-allocated array of available RAN function IDs.
e3_error_t e3_agent_set_dapp_status_changed_handler(e3_agent_handle_t *agent, e3_dapp_status_changed_cb handler)
Set callback for dApp status changes.
libe3 error codes - shared C/C++ definitions
int e3_error_t
C error type alias.
What e3_agent_handle_t points to: the agent a C caller holds.
Descriptor describing a ServiceModel implemented in C.
const uint32_t * control_ids
Array of supported control IDs (copied by library).
uint32_t version
Service Model version.
e3_sm_stop_cb sm_stop
Called when SM should stop.
const uint8_t * ran_function_data
Opaque RAN function data (must be non-NULL).
const uint32_t * telemetry_ids
Array of supported telemetry IDs (copied by library).
size_t control_ids_len
Number of control IDs.
const char * name
Service Model name (null-terminated string).
size_t telemetry_ids_len
Number of telemetry IDs.
e3_sm_start_cb sm_start
Called when SM should start.
e3_sm_init_cb sm_init
Called on SM registration.
e3_sm_is_running_cb sm_is_running
Called to query running state.
void * sm_context
Opaque pointer passed to all callbacks.
size_t ran_function_data_len
Length in bytes; must be 1..32768.
e3_sm_process_control_cb sm_process_control
Called to process control actions.
uint32_t ran_function_id
RAN function ID for this SM.
e3_sm_destroy_cb sm_destroy
Called on SM destruction.
Configuration for creating an E3Agent from C.
int encoding
0=ASN1, 1=JSON, 2=PROTOBUF, -1=default
int log_level
Logging level; -1=default.
uint16_t subscriber_port
Port of the subscriber channel (SCTP and TCP); 0 keeps the default.
int pin_io_threads
Pin the I/O threads when non-zero; 0=no pinning.
const char * setup_endpoint
Endpoint of the setup channel; NULL keeps the default.
int link_layer
0=ZMQ, 1=POSIX, -1=default
const char * log_path
Log file; NULL=auto (/tmp/e3_ROLE[_ID]_EUID.log).
size_t io_threads
Number of I/O threads; 0=default.
uint16_t setup_port
Port of the setup channel (SCTP and TCP); 0 keeps the default.
uint16_t publisher_port
Port of the publisher channel (SCTP and TCP); 0 keeps the default.
int io_thread_affinity
Logical core to pin to; Linux only, best-effort.
const char * ran_identifier
RAN identifier; NULL keeps the default.
const char * subscriber_endpoint
Endpoint of the subscriber channel; NULL keeps the default.
int transport_layer
0=SCTP, 1=TCP, 2=IPC, -1=default
uint32_t dapp_idle_timeout_s
Seconds without a message from a dApp before the RAN releases and removes it; 0=never.
const char * publisher_endpoint
Endpoint of the publisher channel; NULL keeps the default.
int set_dapp_idle_timeout
Apply dapp_idle_timeout_s when non-zero; 0=keep the library default (1800 s).
What e3_service_model_handle_t points to: a ServiceModel that calls back into C.
void * sm_context
Passed to every callback.
uint32_t ran_function_id() const override
Get RAN function ID for this SM.