[3ec149c] | 1 | // ******************************************************************************************************** |
---|
| 2 | // Servicio: ogAdmServer |
---|
| 3 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
| 4 | // Fecha Creación: Marzo-2010 |
---|
| 5 | // Fecha Última modificación: Marzo-2010 |
---|
| 6 | // Nombre del fichero: ogAdmServer.h |
---|
| 7 | // Descripción: Este fichero implementa el servicio de administración general del sistema |
---|
| 8 | // ******************************************************************************************************** |
---|
| 9 | #include <stdio.h> |
---|
| 10 | #include <stdlib.h> |
---|
| 11 | #include <string.h> |
---|
| 12 | #include <ctype.h> |
---|
| 13 | #include <errno.h> |
---|
| 14 | #include <unistd.h> |
---|
| 15 | #include <time.h> |
---|
| 16 | #include <sys/types.h> |
---|
| 17 | #include <sys/socket.h> |
---|
| 18 | #include <netinet/in.h> |
---|
| 19 | #include <arpa/inet.h> |
---|
[c0a46e2] | 20 | #include <stdbool.h> |
---|
[3ec149c] | 21 | #include "ogAdmLib.h" |
---|
| 22 | // ________________________________________________________________________________________________________ |
---|
| 23 | // Variables globales |
---|
| 24 | // ________________________________________________________________________________________________________ |
---|
| 25 | char servidoradm[LONPRM]; // Dirección IP del servidor de administración |
---|
| 26 | char puerto[LONPRM]; // Puerto de comunicación |
---|
| 27 | |
---|
[2e0c063] | 28 | struct og_client; |
---|
| 29 | |
---|
[3ec149c] | 30 | typedef struct{ // Estructura usada para guardar información de los clientes |
---|
| 31 | char ip[LONIP]; // IP del cliente |
---|
| 32 | char estado[4]; // Tipo de Sistema Operativo en que se encuentra el cliente |
---|
[2e0c063] | 33 | struct og_client *cli; |
---|
[3ec149c] | 34 | }SOCKETCL; |
---|
| 35 | SOCKETCL tbsockets[MAXIMOS_CLIENTES]; |
---|
| 36 | |
---|
[46d07a2] | 37 | struct og_dbi; |
---|
| 38 | |
---|
[c0a46e2] | 39 | bool clienteExistente(char *,int *); |
---|
| 40 | bool clienteDisponible(char *,int *); |
---|
[e052fdc] | 41 | bool actualizaConfiguracion(struct og_dbi *,char* ,int); |
---|
[62c0560] | 42 | bool Levanta(char**, char**, int, char*); |
---|
[aaa2c57] | 43 | bool WakeUp(int,char*,char*,char*); |
---|
[7a8fae6] | 44 | bool actualizaCreacionImagen(struct og_dbi *,char*,char*,char*,char*,char*,char*); |
---|
[e052fdc] | 45 | bool actualizaRestauracionImagen(struct og_dbi *,char*,char*,char*,char*,char*); |
---|
[54bd82d] | 46 | bool actualizaHardware(struct og_dbi *dbi, char* ,char*,char*,char*); |
---|
| 47 | bool cuestionPerfilHardware(struct og_dbi *dbi,char*,char*,int,char*,char*,int *,int); |
---|
[e052fdc] | 48 | bool actualizaSoftware(struct og_dbi *, char* , char* , char*,char*,char*); |
---|
| 49 | bool cuestionPerfilSoftware(struct og_dbi *, char*, char*,int,int,char*,char*,char*,int *,int); |
---|
[3ec149c] | 50 | |
---|
[e052fdc] | 51 | int checkDato(struct og_dbi *,char*,const char*,const char*,const char*); |
---|