source: ogServer-Git/sources/ogAdmServer.h @ 2ed3a0c

Last change on this file since 2ed3a0c was f09aca6, checked in by OpenGnSys Support Team <soporte-og@…>, 6 years ago

#580 fix management of keepalive connections to clients

OgAdmServer? leaves a connection in keepalive more (similar to HTTP
keepalive feature), the existing handling is not correct. The tbsocket
table is never cleaned up and properly.

Use the new og_client object that represents connections from the
clients in tbsocket[] instead.

The keepalive field now stores the index in the tbsocket table, so there
is no need to consult mysql to fetch the slot that this client is using.

This patch also extends syslog() support to include port number when
reporting connections from clients.

  • Property mode set to 100644
File size: 2.6 KB
Line 
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>
20#include <stdbool.h>
21#include </usr/include/mysql/mysql.h>
22#include "Database.h"
23#include "ogAdmLib.h"
24// ________________________________________________________________________________________________________
25// Variables globales
26// ________________________________________________________________________________________________________
27char servidoradm[LONPRM];       // Dirección IP del servidor de administración
28char puerto[LONPRM];    // Puerto de comunicación
29
30struct og_client;
31
32typedef 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
35        struct og_client *cli;
36}SOCKETCL;
37SOCKETCL tbsockets[MAXIMOS_CLIENTES];
38
39bool registraCliente(char *);
40bool procesoInclusionClienteWinLnx(int socket, TRAMA*,int*,char*);
41bool procesoInclusionCliente(int socket, TRAMA*);
42bool clienteExistente(char *,int *);
43bool clienteDisponible(char *,int *);
44bool actualizaConfiguracion(Database , Table ,char* ,int);
45bool recorreProcedimientos(Database ,char* ,FILE*,char*);
46bool buscaComandos(char *,TRAMA *,int *);
47bool respuestaConsola(int socket, TRAMA *,int);
48bool enviaComando(TRAMA *ptrTrama,const char*);
49bool Levanta(char*,char*,char*);
50bool WakeUp(SOCKET *,char*,char*,char*);
51void PasaHexBin(char *,char *);
52bool actualizaCreacionImagen(Database,Table,char*,char*,char*,char*,char*,char*);
53bool actualizaRestauracionImagen(Database,Table,char*,char*,char*,char*,char*);
54bool actualizaHardware(Database, Table,char* ,char*,char*,char*);
55bool cuestionPerfilHardware(Database,Table,char*,char*,int,char*,char*,int *,int);
56bool actualizaSoftware(Database , Table , char* , char* , char*,char*,char*);
57bool cuestionPerfilSoftware(Database, Table, char*, char*,int,int,char*,char*,char*,int *,int);
58
59int checkDato(Database,Table,char*,const char*,const char*,const char*);
Note: See TracBrowser for help on using the repository browser.