1#if defined STANDALONE_RTI
18#include <sys/socket.h>
20#include <netinet/in.h>
28#include <openssl/rand.h>
29#include <openssl/hmac.h>
37#define MAX_TIME_FOR_REPLY_TO_STOP_REQUEST SEC(30)
50typedef struct federate_info_t {
51 scheduling_node_t enclave;
57 struct sockaddr_in UDP_addr;
58 bool clock_synchronization_enabled;
63 char server_hostname[INET_ADDRSTRLEN];
68 struct in_addr server_ip_addr;
75typedef enum clock_sync_stat { clock_sync_off, clock_sync_init, clock_sync_on } clock_sync_stat;
90typedef struct rti_remote_t {
93 int64_t max_start_time;
96 int num_feds_proposed_start;
106 volatile bool all_federates_exited;
113 const char* federation_id;
117 uint16_t user_specified_port;
120 uint16_t final_port_TCP;
123 int socket_descriptor_TCP;
127 uint16_t final_port_UDP;
130 int socket_descriptor_UDP;
140 clock_sync_stat clock_sync_global_status;
145 uint64_t clock_sync_period_ns;
150 int32_t clock_sync_exchanges_per_interval;
155 bool authentication_enabled;
159 bool stop_in_progress;
183extern bool _lf_federate_reports_error;
199void update_federate_next_event_tag_locked(uint16_t federate_id,
tag_t next_event_tag);
206void handle_port_absent_message(federate_info_t* sending_federate,
unsigned char*
buffer);
216void handle_timed_message(federate_info_t* sending_federate,
unsigned char*
buffer);
226void handle_latest_tag_confirmed(federate_info_t* fed);
235void handle_next_event_tag(federate_info_t* fed);
246void handle_stop_request_message(federate_info_t* fed);
255void handle_stop_request_reply(federate_info_t* fed);
270void handle_address_query(uint16_t fed_id);
287void handle_address_ad(uint16_t federate_id);
293void handle_timestamp(federate_info_t* my_fed);
305void send_physical_clock(
unsigned char message_type, federate_info_t* fed,
socket_type_t socket_type);
320void handle_physical_clock_sync_message(federate_info_t* my_fed,
socket_type_t socket_type);
333void* clock_synchronization_thread(
void* noargs);
340void* federate_info_thread_TCP(
void* fed);
347void send_reject(
int* socket_id,
unsigned char error_code);
355void lf_connect_to_federates(
int socket_descriptor);
362void* respond_to_erroneous_connections(
void*
nothing);
368void initialize_federate(federate_info_t* fed, uint16_t
id);
377int32_t start_rti_server(uint16_t port);
384void wait_for_federates(
int socket_descriptor);
389void usage(
int argc,
const char* argv[]);
400int process_clock_sync_args(
int argc,
const char* argv[]);
412void initialize_RTI(rti_remote_t* rti);
K nothing
Definition hashmap.h:54
void * lf_thread_t
Definition lf_arduino_support.h:120
Type definitions that are widely used across different parts of the runtime.
Priority queue that uses tags for sorting.
int process_args(int argc, const char *argv[])
Definition reactor_common.c:942
int lf_critical_section_enter(environment_t *env)
Enter critical section by locking the global mutex.
Definition reactor_threaded.c:1153
int lf_critical_section_exit(environment_t *env)
Leave a critical section by unlocking the global mutex.
Definition reactor_threaded.c:1165
Common declarations for runtime infrastructure (RTI) for scheduling enclaves and distributed Lingua F...
socket_type_t
Definition socket_common.h:69
Execution environment. This struct contains information about the execution environment....
Definition environment.h:49
Definition pqueue_base.h:73
void usage()
Definition trace_to_chrome.c:58
char buffer[BUFFER_SIZE]
Definition trace_util.c:42