[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 | #include <winsock2.h>
|
---|
| 19 | #include <ws2tcpip.h>
|
---|
[181c4de] | 20 | #include <winreg.h>
|
---|
[f679cf0] | 21 |
|
---|
[181c4de] | 22 | #include "registrow.h"
|
---|
[f679cf0] | 23 | #include "ogAdmLib.h"
|
---|
[181c4de] | 24 | #include "servicio.h"
|
---|
[f679cf0] | 25 | // ________________________________________________________________________________________________________
|
---|
| 26 | // Variables globales
|
---|
| 27 | // ________________________________________________________________________________________________________
|
---|
[181c4de] | 28 | //
|
---|
[f679cf0] | 29 | int versionWin;
|
---|
| 30 | char idordenador[LONPRM]; // Identificador del ordenador
|
---|
| 31 | char nombreordenador[LONPRM]; // Nombre del ordenador
|
---|
| 32 |
|
---|
| 33 | char servidoradm[LONPRM]; // Dirección IP del servidor de administración
|
---|
| 34 | char puerto[LONPRM]; // Puerto de comunicación
|
---|
[181c4de] | 35 | char IPlocal[LONPRM]; // Ip local por donde se van a enviar las comunicaciones
|
---|
[f679cf0] | 36 |
|
---|
| 37 |
|
---|
| 38 | typedef struct{ // Estructura usada para referenciar las funciones que procesan las tramas
|
---|
| 39 | char nf[LONFUN]; // Nombre de la función
|
---|
| 40 | BOOLEAN (*fptr)(TRAMA*); // Puntero a la función que procesa la trama
|
---|
| 41 | }MSGFUN;
|
---|
| 42 | MSGFUN tbfuncionesClient[MAXIMAS_FUNCIONES];
|
---|
| 43 | // ________________________________________________________________________________________________________
|
---|
| 44 | // Prototipo de funciones
|
---|
| 45 | // ________________________________________________________________________________________________________
|
---|
| 46 |
|
---|
| 47 | void procesaComandos(TRAMA*);
|
---|
| 48 | BOOLEAN gestionaTrama(TRAMA *);
|
---|
| 49 | BOOLEAN InclusionClienteWinLnx();
|
---|
| 50 | BOOLEAN RESPUESTA_InclusionClienteWinLnx(TRAMA *);
|
---|
| 51 | BOOLEAN respuestaEjecucionComando(TRAMA *,int,char*);
|
---|
| 52 |
|
---|
| 53 | BOOLEAN Apagar(TRAMA *);
|
---|
| 54 | BOOLEAN Reiniciar(TRAMA *);
|
---|
| 55 | BOOLEAN Sondeo(TRAMA *);
|
---|
| 56 |
|
---|
| 57 | BOOLEAN enviaMensajeServidor(SOCKET *,TRAMA *,char);
|
---|
| 58 | BOOLEAN ApagarReiniciar(UINT,char *,int sw);
|
---|
[181c4de] | 59 |
|
---|
| 60 | SOCKADDR_IN *GetIPInterfaceList(SOCKET , int *); |
---|