summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2019-02-06 14:32:54 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-02-06 14:49:04 +0100
commitb38ed0dfb887a30a72acffa3c4543898efbcb29d (patch)
treee1c6da746e648c63304cf49937f4f2f367c51f4a
parent2baf362ac200f63f1c380154bfaa386b0b5f7d23 (diff)
#897 Do not use socket type in ogAdmServer
No need for an extra type, socket descriptors are always integer.
-rw-r--r--sources/ogAdmServer.cpp10
-rw-r--r--sources/ogAdmServer.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp
index b6c2f5f..b14e915 100644
--- a/sources/ogAdmServer.cpp
+++ b/sources/ogAdmServer.cpp
@@ -1434,7 +1434,7 @@ bool Levanta(char *iph, char *mac, char *mar)
unsigned int on = 1;
sockaddr_in local;
int i, lon, res;
- SOCKET s;
+ int s;
/* Creación de socket para envío de magig packet */
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -1456,7 +1456,7 @@ bool Levanta(char *iph, char *mac, char *mar)
lon = splitCadena(ptrIP, iph, ';');
lon = splitCadena(ptrMacs, mac, ';');
for (i = 0; i < lon; i++) {
- if (!WakeUp(&s,ptrIP[i],ptrMacs[i],mar)) {
+ if (!WakeUp(s, ptrIP[i], ptrMacs[i], mar)) {
syslog(LOG_ERR, "problem sending magic packet\n");
close(s);
return false;
@@ -1550,7 +1550,7 @@ enum wol_delivery_type {
// false: En caso de ocurrir algún error
//_____________________________________________________________________________________________________________
//
-bool WakeUp(SOCKET *s, char* iph, char *mac, char *mar)
+bool WakeUp(int s, char* iph, char *mac, char *mar)
{
char HDaddress_bin[OG_WOL_MACADDR_LEN];
struct sockaddr_in WakeUpCliente;
@@ -1579,7 +1579,7 @@ bool WakeUp(SOCKET *s, char* iph, char *mac, char *mar)
switch (atoi(mar)) {
case OG_WOL_BROADCAST:
- ret = wake_up_broadcast(*s, &WakeUpCliente, &Trama_WakeUp);
+ ret = wake_up_broadcast(s, &WakeUpCliente, &Trama_WakeUp);
break;
case OG_WOL_UNICAST:
if (inet_aton(iph, &addr) < 0) {
@@ -1587,7 +1587,7 @@ bool WakeUp(SOCKET *s, char* iph, char *mac, char *mar)
ret = false;
break;
}
- ret = wake_up_unicast(*s, &WakeUpCliente, &Trama_WakeUp, &addr);
+ ret = wake_up_unicast(s, &WakeUpCliente, &Trama_WakeUp, &addr);
break;
default:
syslog(LOG_ERR, "unknown wol type\n");
diff --git a/sources/ogAdmServer.h b/sources/ogAdmServer.h
index 8b99086..1812d83 100644
--- a/sources/ogAdmServer.h
+++ b/sources/ogAdmServer.h
@@ -47,7 +47,7 @@ bool buscaComandos(char *,TRAMA *,int *);
bool respuestaConsola(int socket, TRAMA *,int);
bool enviaComando(TRAMA *ptrTrama,const char*);
bool Levanta(char*,char*,char*);
-bool WakeUp(SOCKET *,char*,char*,char*);
+bool WakeUp(int,char*,char*,char*);
void PasaHexBin(char *,char *);
bool actualizaCreacionImagen(Database,Table,char*,char*,char*,char*,char*,char*);
bool actualizaRestauracionImagen(Database,Table,char*,char*,char*,char*,char*);