Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_protocol_adapter.h File Reference

Communication Protocol Adapter Interface (UDP, TCP, DDS). More...

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "rte/utils/status/rte_status.h"
#include "rte/utils/types/rte_types.h"
#include "rte_osadapter/rte_osadapter_socket.h"
Include dependency graph for rte_protocol_adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rte_protocol_config_t
 Configuration passed to open a protocol adapter instance. More...
struct  rte_protocol_adapter_ops_t
 Operations vtable implemented by a concrete ProtocolAdapter. More...

Macros

#define RTE_PROTOCOL_ENDPOINT_STR_MAX   (64U)
 Maximum length of host, topic, or endpoint string.

Typedefs

typedef struct rte_protocol_impl_s * rte_protocol_handle_t
 Opaque protocol handle pointer.

Enumerations

enum  rte_protocol_type_t { RTE_PROTOCOL_TYPE_RAW_UDP = 1 , RTE_PROTOCOL_TYPE_RAW_TCP = 2 , RTE_PROTOCOL_TYPE_DDS = 3 }
 Protocol transport identifier. More...
enum  rte_protocol_role_t { RTE_PROTOCOL_ROLE_LISTEN = 1 , RTE_PROTOCOL_ROLE_CONNECT = 2 , RTE_PROTOCOL_ROLE_PUB = 3 , RTE_PROTOCOL_ROLE_SUB = 4 }
 Communication role of the protocol adapter instance. More...

Functions

rte_status_t rte_protocol_adapter_register (rte_protocol_type_t type, const rte_protocol_adapter_ops_t *ops)
 Registers a ProtocolAdapter implementation for a given protocol type.
const rte_protocol_adapter_ops_t * rte_protocol_adapter_get (rte_protocol_type_t type)
 Retrieves the registered ProtocolAdapter for a given protocol type.
const rte_protocol_adapter_ops_t * rte_protocol_adapter_get_udp (void)
 Returns the built-in raw UDP ProtocolAdapter vtable.
const rte_protocol_adapter_ops_t * rte_protocol_adapter_get_tcp (void)
 Returns the built-in raw TCP ProtocolAdapter vtable.

Detailed Description

Communication Protocol Adapter Interface (UDP, TCP, DDS).

ProtocolAdapters encapsulate wire protocols, framing, and communication patterns:

  • UDP ProtocolAdapter: datagrams, hello/ack handshake, peering over OS UDP sockets.
  • TCP ProtocolAdapter: stream framing, connections over OS TCP sockets.
  • DDS ProtocolAdapter: publish/subscribe topics over DDS middleware.

RTE Framework / RTE selects which ProtocolAdapter to use based on configuration per channel/flow.

Compliant with CENELEC EN 50128 SIL 4 and MISRA C:2012. Fixed caller-owned storage, non-throwing, defensive checks.

Definition in file rte_protocol_adapter.h.