2017-04-09 16:56:11 +00:00
|
|
|
/**************************
|
|
|
|
* Central-Manager *
|
|
|
|
***************************
|
|
|
|
* Designed & Developed by *
|
|
|
|
* Adrien Marquès *
|
|
|
|
* <xdrm-brackets> *
|
|
|
|
***************************
|
|
|
|
* doowap31@gmail.com *
|
|
|
|
**************************/
|
2017-04-01 15:01:36 +00:00
|
|
|
#include "lib/header.h"
|
|
|
|
|
|
|
|
|
2017-03-28 16:45:18 +00:00
|
|
|
|
|
|
|
/* local dependencies */
|
2017-04-01 15:01:36 +00:00
|
|
|
#include "lib/network/tcp/server.h"
|
|
|
|
#include "lib/network/udp/server.h"
|
2017-04-09 17:33:27 +00:00
|
|
|
#include "lib/local/middleware.h"
|
|
|
|
#include "lib/local/handler.h"
|
2017-03-28 16:45:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* headers */
|
2017-04-09 14:06:31 +00:00
|
|
|
void* LISTEN_TCP(void* THREADABLE_ARG);
|
|
|
|
void* LISTEN_UDP(void* THREADABLE_ARG);
|
2017-04-01 15:01:36 +00:00
|
|
|
|
2017-04-07 16:14:21 +00:00
|
|
|
|
|
|
|
|
2017-04-01 15:01:36 +00:00
|
|
|
// VARIABLES THREADS D'ECOUTE TCP/UDP
|
2017-04-07 16:14:21 +00:00
|
|
|
static pthread_t listenManagers[4]; // contiendra les THREADS d'écoute
|
|
|
|
// 1. Multicast UDP (plane)
|
|
|
|
// 2. ListenSock TCP (plane)
|
2017-04-09 16:41:44 +00:00
|
|
|
// 3. ListenSock UDP (vterm) Multicast
|
|
|
|
// 4. ListenSock UDP (cterm) Multicast
|
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
|
2017-04-06 11:36:51 +00:00
|
|
|
|
|
|
|
// 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
|
|
|
|
2017-04-09 14:06:31 +00:00
|
|
|
|
2017-04-07 18:25:53 +00:00
|
|
|
// ENREGISTREMENT DES DONNEES AVIONS
|
2017-04-09 17:33:27 +00:00
|
|
|
struct context sgca;
|