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

46 lines
1.4 KiB
C
Raw Normal View History

2017-04-01 15:01:36 +00:00
#ifndef _LIB_HEADER_H_
#define _LIB_HEADER_H_
/* global */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <stdint.h>
2017-04-08 16:20:17 +00:00
#include <errno.h>
2017-04-01 15:01:36 +00:00
/* sys */
#include <sys/types.h>
#include <sys/socket.h>
/* socket */
#include <unistd.h> // close
#include <netinet/in.h>
#include <netdb.h> // getaddrinfo, getnameinfo
#include <arpa/inet.h>
#include "debug.h"
#include "data.h"
2017-04-01 15:01:36 +00:00
/* vars */
#define SERV_HOST "127.0.0.1" // adresse serveur
#define MCST_HOST "224.0.0.1" // adresse groupe multicast UDP -> plane
#define MCST_VTER "224.0.0.2" // adresse groupe multicast UDP -> viewTerm
#define MCST_CTER "224.0.0.3" // adresse groupe multicast UDP -> ctrlTerm
#define UDP_MCST 4444 // multicast UDP port for PLANES
#define TCP_LIST 0x504c // TCP plane command (PL = 8076)
#define UDP_VTER 4445 // viewTerm listener
#define UDP_CTER 4446 // ctrlTerm listener
2017-04-01 15:01:36 +00:00
#define MAX_BUF_LEN 512
#define MAX_TCP_THR 10
#define MAX_UDP_THR 10
#define maxHostLen 64
#define maxPortLen 6
#define SOCK_TIMEOUT 2 // 2sec timeout
2017-04-01 15:01:36 +00:00
#endif