[f679cf0] | 1 | // ********************************************************************************************************
|
---|
| 2 | // Cliente: ogAdmWinClient
|
---|
| 3 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
---|
| 4 | // Fecha Creación: Febrero-2012
|
---|
| 5 | // Fecha Última modificación: Febrero-2012
|
---|
| 6 | // Nombre del fichero: ogAdmWinClient.h
|
---|
| 7 | // Descripción :Este fichero implementa el cliente general del sistema
|
---|
| 8 | // ********************************************************************************************************
|
---|
| 9 | #define __WINDOWS__
|
---|
| 10 |
|
---|
| 11 | #include <stdio.h>
|
---|
| 12 | #include <stdlib.h>
|
---|
| 13 | #include <string.h>
|
---|
| 14 | #include <ctype.h>
|
---|
| 15 | #include <errno.h>
|
---|
| 16 | #include <time.h>
|
---|
| 17 | #include <signal.h>
|
---|
| 18 |
|
---|
| 19 | #include <winsock2.h>
|
---|
| 20 | #include <ws2tcpip.h>
|
---|
| 21 |
|
---|
| 22 | #include "ogAdmLib.h"
|
---|
| 23 |
|
---|
| 24 | // ________________________________________________________________________________________________________
|
---|
| 25 | // Variables globales
|
---|
| 26 | // ________________________________________________________________________________________________________
|
---|
| 27 | int versionWin;
|
---|
| 28 | char idordenador[LONPRM]; // Identificador del ordenador
|
---|
| 29 | char nombreordenador[LONPRM]; // Nombre del ordenador
|
---|
| 30 |
|
---|
| 31 | char servidoradm[LONPRM]; // Dirección IP del servidor de administración
|
---|
| 32 | char puerto[LONPRM]; // Puerto de comunicación
|
---|
| 33 | char IPlocal[LONPRM]; // Path donde está la interface entre la administración y el módulo de clonación
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | typedef struct{ // Estructura usada para referenciar las funciones que procesan las tramas
|
---|
| 37 | char nf[LONFUN]; // Nombre de la función
|
---|
| 38 | BOOLEAN (*fptr)(TRAMA*); // Puntero a la función que procesa la trama
|
---|
| 39 | }MSGFUN;
|
---|
| 40 | MSGFUN tbfuncionesClient[MAXIMAS_FUNCIONES];
|
---|
| 41 | // ________________________________________________________________________________________________________
|
---|
| 42 | // Prototipo de funciones
|
---|
| 43 | // ________________________________________________________________________________________________________
|
---|
| 44 |
|
---|
| 45 | void procesaComandos(TRAMA*);
|
---|
| 46 | BOOLEAN gestionaTrama(TRAMA *);
|
---|
| 47 | BOOLEAN InclusionClienteWinLnx();
|
---|
| 48 | BOOLEAN RESPUESTA_InclusionClienteWinLnx(TRAMA *);
|
---|
| 49 | BOOLEAN respuestaEjecucionComando(TRAMA *,int,char*);
|
---|
| 50 |
|
---|
| 51 | BOOLEAN Apagar(TRAMA *);
|
---|
| 52 | BOOLEAN Reiniciar(TRAMA *);
|
---|
| 53 | BOOLEAN Sondeo(TRAMA *);
|
---|
| 54 |
|
---|
| 55 | BOOLEAN enviaMensajeServidor(SOCKET *,TRAMA *,char);
|
---|
| 56 | BOOLEAN ApagarReiniciar(UINT,char *,int sw);
|
---|