[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 </usr/include/mysql/mysql.h> |
---|
| 22 | #include "Database.h" |
---|
| 23 | #include "ogAdmLib.h" |
---|
| 24 | // ________________________________________________________________________________________________________ |
---|
| 25 | // Variables globales |
---|
| 26 | // ________________________________________________________________________________________________________ |
---|
| 27 | char servidoradm[LONPRM]; // Dirección IP del servidor de administración |
---|
| 28 | char puerto[LONPRM]; // Puerto de comunicación |
---|
| 29 | |
---|
[2e0c063] | 30 | struct og_client; |
---|
| 31 | |
---|
[3ec149c] | 32 | typedef struct{ // Estructura usada para guardar información de los clientes |
---|
| 33 | char ip[LONIP]; // IP del cliente |
---|
| 34 | char estado[4]; // Tipo de Sistema Operativo en que se encuentra el cliente |
---|
[2e0c063] | 35 | struct og_client *cli; |
---|
[3ec149c] | 36 | }SOCKETCL; |
---|
| 37 | SOCKETCL tbsockets[MAXIMOS_CLIENTES]; |
---|
| 38 | |
---|
[c0a46e2] | 39 | bool registraCliente(char *); |
---|
| 40 | bool procesoInclusionClienteWinLnx(int socket, TRAMA*,int*,char*); |
---|
[8c04716] | 41 | bool procesoInclusionCliente(struct og_client *, TRAMA*); |
---|
[c0a46e2] | 42 | bool clienteExistente(char *,int *); |
---|
| 43 | bool clienteDisponible(char *,int *); |
---|
| 44 | bool actualizaConfiguracion(Database , Table ,char* ,int); |
---|
| 45 | bool recorreProcedimientos(Database ,char* ,FILE*,char*); |
---|
| 46 | bool buscaComandos(char *,TRAMA *,int *); |
---|
| 47 | bool respuestaConsola(int socket, TRAMA *,int); |
---|
| 48 | bool enviaComando(TRAMA *ptrTrama,const char*); |
---|
[62c0560] | 49 | bool Levanta(char**, char**, int, char*); |
---|
[aaa2c57] | 50 | bool WakeUp(int,char*,char*,char*); |
---|
[3ec149c] | 51 | void PasaHexBin(char *,char *); |
---|
[c0a46e2] | 52 | bool actualizaCreacionImagen(Database,Table,char*,char*,char*,char*,char*,char*); |
---|
| 53 | bool actualizaRestauracionImagen(Database,Table,char*,char*,char*,char*,char*); |
---|
| 54 | bool actualizaHardware(Database, Table,char* ,char*,char*,char*); |
---|
| 55 | bool cuestionPerfilHardware(Database,Table,char*,char*,int,char*,char*,int *,int); |
---|
| 56 | bool actualizaSoftware(Database , Table , char* , char* , char*,char*,char*); |
---|
| 57 | bool cuestionPerfilSoftware(Database, Table, char*, char*,int,int,char*,char*,char*,int *,int); |
---|
[3ec149c] | 58 | |
---|
| 59 | int checkDato(Database,Table,char*,const char*,const char*,const char*); |
---|