-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommunicator.h
38 lines (33 loc) · 881 Bytes
/
communicator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
#include <arpa/inet.h>
#include "datapacker.h"
#include <time.h>
#define BACKLOG_CONN 10
#define FILEBUFFSIZE 256
#define BUFFSIZE FILEBUFFSIZE+100
#define MAXPEERLIMIT 4
void server_socket_runner();
int setup_server_socket(char*);
void close_all_server_connections();
extern int isClient;
int send_data_via_socket(char*, char*, unsigned char*, int, int*);
void process_socket_actions(int, unsigned char*, int);
void sendfileget(char*, int);
void syncfileget();
void syncallpeers();
void syncallclients();
char* getipbyfd(int);
char* getfqdnbyip(char*,char*);
int hostname_to_ip(char*, char*);
struct tm* getcurrenttime();