RTE OSAdapter POSIX 0.1.0 build 41b3eb3
POSIX/Linux OAL OSAdapter for Platform_RTE
Loading...
Searching...
No Matches
rte_posix_osadapter_channel_service.h File Reference

POSIX named-channel adapter. More...

#include "rte/redundancy/channel_service/rte_channel_service.h"
#include "rte/oal/netlink/rte_netlink.h"
Include dependency graph for rte_posix_osadapter_channel_service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef rte_status_t(*) rte_posix_channel_resolve_fn(const char *channel_name, rte_netlink_config_t *out_config, void *context)
 Resolves a channel name to its link configuration (integrator-supplied).

Functions

rte_status_t rte_posix_osadapter_channel_service_register_resolver (rte_posix_channel_resolve_fn resolver, void *context)
 Registers the channel-name resolver and the POSIX channel service OSAdapter (ADR-005 seam).
const rte_osadapter_channel_service_t * rte_posix_osadapter_channel_service (void)
 The POSIX channel service OSAdapter vtable (UDP; setup binds or dials and returns, the peer handshake is deferred to the first read). A setup returns RTE_STATUS_INTERNAL_ERROR when a configured socket buffer size is refused (REQ-OAL-NETLINK-015); a later read/send that has to re-init the socket maps any failure to RTE_STATUS_TIMEOUT. A listen-role link learns its peer from the first datagram it reads; a send before that sends nothing and returns RTE_STATUS_NOT_CONNECTED (Platform_RTE REQ-CHANSVC-001).

Detailed Description

POSIX named-channel adapter.

Definition in file rte_posix_osadapter_channel_service.h.

Typedef Documentation

◆ rte_posix_channel_resolve_fn

typedef rte_status_t(*) rte_posix_channel_resolve_fn(const char *channel_name, rte_netlink_config_t *out_config, void *context)

Resolves a channel name to its link configuration (integrator-supplied).

Called once per setup with out_config zero-filled, so a field the resolver does not set stays 0. The adapter keeps the result for the lifetime of the channel: every socket (re)init uses its role, host and port and applies a non-zero rcvbuf_bytes / sndbuf_bytes (Platform_RTE REQ-OAL-NETLINK-015; 0 keeps the OS default and makes no call).

Parameters
channel_nameName passed to setup.
out_configConfiguration to fill.
contextContext registered with the resolver.
Returns
RTE_STATUS_OK when out_config is filled; any other status fails the setup with that status.

Definition at line 24 of file rte_posix_osadapter_channel_service.h.

Function Documentation

◆ rte_posix_osadapter_channel_service()

const rte_osadapter_channel_service_t * rte_posix_osadapter_channel_service ( void )

The POSIX channel service OSAdapter vtable (UDP; setup binds or dials and returns, the peer handshake is deferred to the first read). A setup returns RTE_STATUS_INTERNAL_ERROR when a configured socket buffer size is refused (REQ-OAL-NETLINK-015); a later read/send that has to re-init the socket maps any failure to RTE_STATUS_TIMEOUT. A listen-role link learns its peer from the first datagram it reads; a send before that sends nothing and returns RTE_STATUS_NOT_CONNECTED (Platform_RTE REQ-CHANSVC-001).

Returns
Pointer to the static vtable; never NULL.

Definition at line 527 of file rte_posix_osadapter_channel_service.c.

◆ rte_posix_osadapter_channel_service_register_resolver()

rte_status_t rte_posix_osadapter_channel_service_register_resolver ( rte_posix_channel_resolve_fn resolver,
void * context )

Registers the channel-name resolver and the POSIX channel service OSAdapter (ADR-005 seam).

Parameters
resolverResolver called by every setup. Must not be NULL.
contextPassed to resolver unchanged.
Returns
RTE_STATUS_OK; RTE_STATUS_INVALID_PARAM for a NULL resolver; otherwise the status of rte_osadapter_channel_service_register().

Definition at line 516 of file rte_posix_osadapter_channel_service.c.