sysdis-project/central-manager/central-manager.h

49 lines
1.3 KiB
C
Raw Normal View History

2017-04-01 15:01:36 +00:00
#include "lib/header.h"
/* local dependencies */
2017-04-01 15:01:36 +00:00
#include "lib/network/tcp/server.h"
#include "lib/network/udp/server.h"
/* headers */
void* LISTEN_TCP(void* THREADABLE_ARG);
void* LISTEN_UDP(void* THREADABLE_ARG);
2017-04-01 15:01:36 +00:00
void* managePlane(void* THREADABLE_SOCKET);
void* manageTerminal(void* THREADABLE_SOCKET);
2017-04-01 15:01:36 +00:00
// void* manageViewTerm(void* THREADABLE_SOCKET);
// void* manageCtrlTerm(void* THREADABLE_SOCKET);
2017-04-01 15:01:36 +00:00
// VARIABLES THREADS D'ECOUTE TCP/UDP
static pthread_t listenManagers[4]; // contiendra les THREADS d'écoute
// 1. Multicast UDP (plane)
// 2. ListenSock TCP (plane)
// 3. ListenSock UDP (vterm)
// 4. ListenSock UDP (cterm)
2017-04-01 15:01:36 +00:00
// VARIABLES THREADS CONNECTION TCP
static pthread_t TCPManagers[MAX_TCP_THR]; // contiendra les THREADS TCP
static int activeTCPManagers[MAX_TCP_THR] = {0}; // contiendra les THREADS TCP actifs
// VARIABLES THREADS CONNECTION UDP
static pthread_t UDPManagers[MAX_UDP_THR]; // contiendra les THREADS UDP
static int activeUDPManagers[MAX_UDP_THR] = {0}; // contiendra les THREADS UDP actifs
2017-04-07 18:25:53 +00:00
struct listn_thrd_arg{
const char addr[16];
const unsigned short port;
};
2017-04-07 18:25:53 +00:00
// ENREGISTREMENT DES DONNEES AVIONS
struct{
2017-04-07 18:25:53 +00:00
unsigned int data;
unsigned int update;
2017-04-08 16:20:17 +00:00
} sgca_index;
2017-04-07 18:25:53 +00:00
2017-04-08 16:20:17 +00:00
struct plane* sgca_data;
struct plane* sgca_update;