76 lines
1.3 KiB
C
76 lines
1.3 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 <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;
|
|
// 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;
|
|
|
|
int station_type;
|
|
bool use_security;
|
|
bool replay;
|
|
|
|
struct {
|
|
pthread_mutex_t lock;
|
|
uint64_t value;
|
|
struct {
|
|
pthread_mutex_t lock;
|
|
bool random;
|
|
int stage;
|
|
} change;
|
|
} id;
|
|
|
|
it2s_tender_epv_t epv;
|
|
|
|
bool exit;
|
|
} facilities_t;
|
|
|
|
#endif
|