-
Notifications
You must be signed in to change notification settings - Fork 0
/
funciones.h
64 lines (53 loc) · 1.24 KB
/
funciones.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _FUNCIONES_H_
#define _FUNCIONES_H_
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <netdb.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include <mqueue.h>
#include "common.h"
int cantHilos;
sem_t *semaforo;
typedef struct DATOS{
char puerto[16];
} datos;
typedef struct conf{
char* puerto;
char puerto_mysql[16];
char host[40];
} conf;
typedef struct{
char data[10240];
float tiempo;
}estadistica_t;
typedef struct{
char path[100];
int sockdata;
char puerto[16];
char host[40];
struct sockaddr_in addr_cli;
socklen_t addrlen;
char type;
float inicio;
clock_t fin;
}fs_t;
datos datosConexion;
int iniciarServidor (char*);
int parser(char*, int, int, fs_t*);
int contar(int);
void* atenderCliente (fs_t*);
int handshake(int, int, fs_t*);
int lee_escribe(int, int, int, fs_t*);
char* recuperarDatos (char *);
#endif