41#ifdef PLATFORM_ARDUINO
42#error To be implemented. No support for federation on Arduino yet.
44#include <sys/socket.h>
54#define NUM_SOCKET_RETRIES 10
55#define DELAY_BETWEEN_SOCKET_RETRIES MSEC(100)
57#define HOST_LITTLE_ENDIAN 1
58#define HOST_BIG_ENDIAN 2
80int create_real_time_tcp_socket_errexit();
96int read_from_socket(
int socket,
size_t num_bytes,
unsigned char*
buffer);
107int read_from_socket_close_on_error(
int* socket,
size_t num_bytes,
unsigned char*
buffer);
125void read_from_socket_fail_on_error(
int* socket,
size_t num_bytes,
unsigned char*
buffer,
lf_mutex_t* mutex,
136ssize_t peek_from_socket(
int socket,
unsigned char* result);
152int write_to_socket(
int socket,
size_t num_bytes,
unsigned char*
buffer);
163int write_to_socket_close_on_error(
int* socket,
size_t num_bytes,
unsigned char*
buffer);
180void write_to_socket_fail_on_error(
int* socket,
size_t num_bytes,
unsigned char*
buffer,
lf_mutex_t* mutex,
291void extract_header(
unsigned char*
buffer, uint16_t* port_id, uint16_t* federate_id,
size_t* length);
305void extract_timed_header(
unsigned char*
buffer, uint16_t* port_id, uint16_t* federate_id,
size_t* length,
tag_t* tag);
331typedef struct rti_addr_info_t {
332 char rti_host_str[256];
333 char rti_port_str[6];
334 char rti_user_str[256];
344bool match_regex(
const char* str,
char* regex);
350bool validate_port(
char* port);
356bool validate_host(
const char* host);
362bool validate_user(
const char* user);
368bool extract_match_group(
const char* rti_addr,
char* dest, regmatch_t group,
size_t max_len,
size_t min_len,
369 const char* err_msg);
375bool extract_match_groups(
const char* rti_addr,
char** rti_addr_strs,
bool** rti_addr_flags, regmatch_t* group_array,
376 int* gids,
size_t* max_lens,
size_t* min_lens,
const char** err_msgs);
381void extract_rti_addr_info(
const char* rti_addr, rti_addr_info_t* rti_addr_info);
void * lf_mutex_t
Definition lf_arduino_support.h:118
uint16_t extract_uint16(unsigned char *bytes)
Definition net_util.c:398
uint16_t swap_bytes_if_big_endian_uint16(uint16_t src)
Definition net_util.c:349
int64_t extract_int64(unsigned char *bytes)
Definition net_util.c:388
int32_t extract_int32(unsigned char *bytes)
Definition net_util.c:368
void encode_uint32(uint32_t data, unsigned char *buffer)
Definition net_util.c:247
int64_t swap_bytes_if_big_endian_int64(int64_t src)
Definition net_util.c:321
int host_is_big_endian(void)
Definition net_util.c:263
void encode_int64(int64_t data, unsigned char *buffer)
Definition net_util.c:228
int32_t swap_bytes_if_big_endian_int32(int32_t src)
Definition net_util.c:277
void encode_uint16(uint16_t data, unsigned char *buffer)
Definition net_util.c:256
void encode_int32(int32_t data, unsigned char *buffer)
Definition net_util.c:238
Time and tag definitions and functions for Lingua Franca.
char buffer[BUFFER_SIZE]
Definition trace_util.c:42