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>
36#define MAX_TIME_FOR_REPLY_TO_STOP_REQUEST SEC(30)
41typedef enum socket_type_t { TCP, UDP } socket_type_t;
51typedef struct federate_info_t {
52 scheduling_node_t enclave;
58 struct sockaddr_in UDP_addr;
59 bool clock_synchronization_enabled;
64 char server_hostname[INET_ADDRSTRLEN];
69 struct in_addr server_ip_addr;
76typedef enum clock_sync_stat { clock_sync_off, clock_sync_init, clock_sync_on } clock_sync_stat;
91typedef struct rti_remote_t {
94 int64_t max_start_time;
97 int num_feds_proposed_start;
107 volatile bool all_federates_exited;
114 const char* federation_id;
118 uint16_t user_specified_port;
121 uint16_t final_port_TCP;
124 int socket_descriptor_TCP;
128 uint16_t final_port_UDP;
131 int socket_descriptor_UDP;
141 clock_sync_stat clock_sync_global_status;
146 uint64_t clock_sync_period_ns;
151 int32_t clock_sync_exchanges_per_interval;
156 bool authentication_enabled;
160 bool stop_in_progress;
184extern bool _lf_federate_reports_error;
200void update_federate_next_event_tag_locked(uint16_t federate_id,
tag_t next_event_tag);
207void handle_port_absent_message(federate_info_t* sending_federate,
unsigned char*
buffer);
217void handle_timed_message(federate_info_t* sending_federate,
unsigned char*
buffer);
227void handle_latest_tag_confirmed(federate_info_t* fed);
236void handle_next_event_tag(federate_info_t* fed);
247void handle_stop_request_message(federate_info_t* fed);
256void handle_stop_request_reply(federate_info_t* fed);
271void handle_address_query(uint16_t fed_id);
288void handle_address_ad(uint16_t federate_id);
294void handle_timestamp(federate_info_t* my_fed);
306void send_physical_clock(
unsigned char message_type, federate_info_t* fed, socket_type_t socket_type);
321void handle_physical_clock_sync_message(federate_info_t* my_fed, socket_type_t socket_type);
334void* clock_synchronization_thread(
void* noargs);
341void* federate_info_thread_TCP(
void* fed);
348void send_reject(
int* socket_id,
unsigned char error_code);
356void lf_connect_to_federates(
int socket_descriptor);
363void* respond_to_erroneous_connections(
void*
nothing);
369void initialize_federate(federate_info_t* fed, uint16_t
id);
378int32_t start_rti_server(uint16_t port);
385void wait_for_federates(
int socket_descriptor);
390void usage(
int argc,
const char* argv[]);
401int process_clock_sync_args(
int argc,
const char* argv[]);
413void 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:910
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...
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