it2s-itss-facilities/src/facilities.h

89 lines
1.5 KiB
C

#ifndef FACILITIES_H
#define FACILITIES_H
#include <pthread.h>
#include <stdbool.h>
#include <zmq.h>
#include "cam.h"
#include "denm.h"
#include "infrastructure.h"
#include "queue.h"
#include "cpm.h"
#include "sa.h"
#include <it2s-tender/epv.h>
enum ID_CHANGE_STAGE {
ID_CHANGE_INACTIVE,
ID_CHANGE_BLOCKED,
ID_CHANGE_PREPARE,
ID_CHANGE_COMMIT
};
typedef struct facilities {
pthread_t ca_service;
pthread_t den_service;
pthread_t infrastructure_service;
pthread_t transmitting;
pthread_t cp_service;
pthread_t sa_service;
// ZMQ
struct {
void* ctx;
zmq_pollitem_t* responders;
uint16_t n_responders;
char* applications_address;
char* transport_address;
char* security_address;
char* management_address;
} zmq;
// Transmitter
queue_t* tx_queue;
// CA
lightship_t* lightship;
// DEN
den_t *den;
// Infrastructure
infrastructure_t* infrastructure;
//CPM
dissemination_t* dissemination;
// SA
bulletin_t bulletin;
int station_type;
bool use_security;
bool replay;
struct {
uint16_t width;
uint16_t length;
uint8_t role;
} vehicle;
struct {
pthread_mutex_t lock;
uint64_t station_id;
uint8_t ipv6_addr[16];
struct {
pthread_mutex_t lock;
bool random;
int stage;
} change;
} id;
it2s_tender_epv_t epv;
bool exit;
} facilities_t;
#endif