55 rte_flow_storage_t flow_storage;
59 char name_buf[RTE_CHANNEL_SERVICE_NAME_SIZE];
69static void *s_resolver_context;
92 if ((storage == NULL) || (channel_name == NULL))
96 state = channel_state(storage);
100 if (s_resolver != NULL)
102 status = s_resolver(channel_name, &resolved, s_resolver_context);
122 resolved.
host = (def.host[0] !=
'\0') ? def.host : NULL;
123 resolved.
port = def.port;
132 (void)strncpy(state->name_buf, channel_name,
sizeof(state->name_buf) - 1U);
165 flow_cfg.
name = state->name_buf;
166 flow_cfg.
oflags = state->oflags;
168 flow_cfg.
open_timeout_ms = (open_timeout_ms > 0U) ? open_timeout_ms : state->default_timeout_ms;
169 status =
rte_flow_open(&state->flow_storage, &flow_cfg, &state->flow_handle);
183 if ((storage == NULL) || (data == NULL) || (data_size == 0U))
187 state = channel_state(storage);
197 return rte_flow_receive(state->flow_handle, data, data_size, NULL, timeout_ms);
206 if ((storage == NULL) || (data == NULL) || (data_size == 0U))
210 state = channel_state(storage);
232 state = channel_state(storage);
255 if (resolver == NULL)
259 s_resolver = resolver;
260 s_resolver_context = context;
270 return &g_flow_osadapter;
rte_status_t rte_flow_send(rte_flow_handle_t handle, const void *data, size_t data_size, rte_flow_channel_t channel, rte_duration_ms_t timeout_ms)
Sends one fixed-size message on the given channel, blocking at most timeout_ms.
rte_status_t rte_flow_close(rte_flow_handle_t handle)
Closes (leaves/unregisters/unsubscribes from) a Flow.
rte_status_t rte_flow_receive(rte_flow_handle_t handle, void *out_data, size_t buffer_size, rte_flow_channel_t *out_channel, rte_duration_ms_t timeout_ms)
Receives one fixed-size message, blocking at most timeout_ms.
rte_status_t rte_flow_open(rte_flow_storage_t *storage, const rte_flow_config_t *config, rte_flow_handle_t *out_handle)
Opens (joins/registers/subscribes to, per OCORA's own fl_open() doc) a named Flow.
struct rte_flow_impl_s * rte_flow_handle_t
Opaque handle to an opened Flow, returned by rte_flow_open().
rte_netlink_role_t
Which side of the connection this link instance plays.
@ RTE_NETLINK_ROLE_CONNECT
@ RTE_NETLINK_ROLE_LISTEN
rte_status_t
Common result/status codes.
@ RTE_STATUS_INVALID_PARAM
@ RTE_STATUS_NOT_INITIALIZED
uint32_t rte_duration_ms_t
const rte_osadapter_channel_service_t * rte_channel_service_flow_osadapter(void)
Returns the rte_osadapter_channel_service_t vtable to pass to rte_osadapter_channel_service_register(...
rte_status_t rte_channel_service_flow_osadapter_register_resolver(rte_channel_service_flow_resolve_fn resolver, void *context)
Registers the resolver this OSAdapter calls from setup() to learn a channel name's role/host/port/mes...
rte_status_t(*) rte_channel_service_flow_resolve_fn(const char *channel_name, rte_netlink_config_t *out_config, void *context)
const rte_redundancy_config_t * rte_redundancy_config_get_active(void)
Get the currently active loaded redundancy/channel configuration (if any).
rte_status_t rte_redundancy_config_find_channel_by_name(const rte_redundancy_config_t *config, const char *name, rte_channel_def_t *out_channel)
Find channel definition by name in the given configuration.
rte_status_t rte_osadapter_channel_service_register(const rte_osadapter_channel_service_t *osadapter)
Registers the OSAdapter that implements named channels (ADR-005).
static uint32_t oflags_for_role(rte_netlink_role_t role)
static rte_status_t ensure_open(flow_channel_state_t *state, rte_duration_ms_t open_timeout_ms)
rte_osadapter_channel_service_t implementation over rte_flow.
OS Abstraction Layer - OCORA PI-API-compatible Flow service.
Thin, MISRA-visible wrappers over the three raw memory-block primitives (fill/copy/compare) every oth...
static void rte_mem_set(void *dest, int value, size_t count)
Fills count bytes starting at dest with value - the one sanctioned call site for libc memset() in thi...
Application-level redundancy topology configuration (2oo2 / 2oo2 with redundancy / 2oo3 / NMR),...
Caller-owned storage for one named channel service instance.
Configuration for rte_flow_open().
rte_duration_ms_t open_timeout_ms
Configuration for rte_netlink_open().
rte_duration_ms_t connect_timeout_ms
OSAdapter implementation for named channel operations.