reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
rti_remote.h File Reference

Declarations for runtime infrastructure (RTI) for distributed Lingua Franca programs. More...

#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <strings.h>
#include "rti_common.h"
#include "lf_types.h"
#include "pqueue_tag.h"
#include "socket_common.h"

Go to the source code of this file.

Data Structures

struct  federate_info_t
 Information about a federate known to the RTI, including its runtime state, mode of execution, and connectivity with other federates. More...
struct  rti_remote_t
 Structure that an RTI instance uses to keep track of its own and its corresponding federates' state. More...

Macros

#define MAX_TIME_FOR_REPLY_TO_STOP_REQUEST   SEC(30)
 Time allowed for federates to reply to stop request.

Typedefs

typedef enum clock_sync_stat clock_sync_stat
 The status of clock synchronization.
typedef struct federate_info_t federate_info_t
 Information about a federate known to the RTI, including its runtime state, mode of execution, and connectivity with other federates.
typedef struct rti_remote_t rti_remote_t
 Structure that an RTI instance uses to keep track of its own and its corresponding federates' state.

Enumerations

enum  clock_sync_stat { clock_sync_off , clock_sync_init , clock_sync_on }
 The status of clock synchronization. More...

Functions

void * clock_synchronization_thread (void *noargs)
 A (quasi-)periodic thread that performs clock synchronization with each federate.
void * federate_info_thread_TCP (void *fed)
 Thread handling TCP communication with a federate.
void handle_address_ad (uint16_t federate_id)
 Handle address advertisement messages (.
void handle_address_query (uint16_t fed_id)
 Handle address query messages.
void handle_latest_tag_confirmed (federate_info_t *fed)
 Handle a latest tag confirmed (LTC) message.
void handle_next_event_tag (federate_info_t *fed)
 Handle a next event tag (NET) message.
void handle_physical_clock_sync_message (federate_info_t *my_fed, socket_type_t socket_type)
 Handle clock synchronization T3 messages from federates.
void handle_port_absent_message (federate_info_t *sending_federate, unsigned char *buffer)
 Handle a port absent message being received rom a federate via the RIT.
void handle_stop_request_message (federate_info_t *fed)
 Handle a MSG_TYPE_STOP_REQUEST message.
void handle_stop_request_reply (federate_info_t *fed)
 Handle a MSG_TYPE_STOP_REQUEST_REPLY message.
void handle_timed_message (federate_info_t *sending_federate, unsigned char *buffer)
 Handle a timed message being received from a federate by the RTI to relay to another federate.
void handle_timestamp (federate_info_t *my_fed)
 A function to handle timestamp messages.
void initialize_federate (federate_info_t *fed, uint16_t id)
 Initialize the federate with the specified ID.
void initialize_RTI (rti_remote_t *rti)
 Initialize the _RTI instance.
void lf_connect_to_federates (int socket_descriptor)
 Wait for one incoming connection request from each federate, and, upon receiving it, create a thread to communicate with that federate.
int lf_critical_section_enter (environment_t *env)
int lf_critical_section_exit (environment_t *env)
int process_args (int argc, const char *argv[])
 Process the command-line arguments.
int process_clock_sync_args (int argc, const char *argv[])
 Process command-line arguments related to clock synchronization.
void * respond_to_erroneous_connections (void *nothing)
 Thread to respond to new connections, which could be federates of other federations who are attempting to join the wrong federation.
void send_physical_clock (unsigned char message_type, federate_info_t *fed, socket_type_t socket_type)
 Take a snapshot of the physical clock time and send it to federate fed_id.
void send_reject (int *socket_id, unsigned char error_code)
 Send a MSG_TYPE_REJECT message to the specified socket and close the socket.
int32_t start_rti_server (uint16_t port)
 Start the socket server for the runtime infrastructure (RTI) and return the socket descriptor.
void update_federate_next_event_tag_locked (uint16_t federate_id, tag_t next_event_tag)
 Update the next event tag of federate federate_id.
void usage (int argc, const char *argv[])
 Print a usage message.
void wait_for_federates (int socket_descriptor)
 Start the runtime infrastructure (RTI) interaction with the federates and wait for the federates to exit.

Variables

bool _lf_federate_reports_error

Detailed Description

Declarations for runtime infrastructure (RTI) for distributed Lingua Franca programs.

Author
Edward A. Lee (eal@berkeley.edu)
Soroush Bateni (soroush@utdallas.edu)
Erling Jellum (erling.r.jellum@ntnu.no)
Chadlia Jerad (chadlia.jerad@ensi-uma.tn)

This file extends enclave.h with RTI features that are specific to federations and are not used by scheduling enclaves.

Function Documentation

◆ lf_critical_section_enter()

int lf_critical_section_enter ( environment_t * env)
extern

◆ lf_critical_section_exit()

int lf_critical_section_exit ( environment_t * env)
extern

Variable Documentation

◆ _lf_federate_reports_error

bool _lf_federate_reports_error
extern