source: ogServer-Git/sources/ogAdmServer.h @ d1fc76c

Last change on this file since d1fc76c was 96b9bb8, checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago

#942 Add /run/task to API REST

This patch adds a new command to the REST API to run tasks.

A task (tarea) is composed of procedures (procedimientos), each procedure is
composed of commands (acciones) that are represented through legacy sockHidra
parameters in the database.

This results in iterating over the task (tareas_acciones) table in the
database to fetch the list of procedures (procedimientos).

Then, this iterates over the list commands that compose a procedures
represented through procedimientos_acciones table.

Finally, this builds and sends the sockHidra legacy message for the client.

This patch includes an implementation of the Linux linked list.

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