From 96b02b5424db61c32386c48fe05ec3375d8a84f5 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Mon, 6 Jul 2020 11:12:43 +0200 Subject: #971 split wake on lan code Add wol.c and wol.h that implements WakeOnLan. --- src/wol.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/wol.h (limited to 'src/wol.h') diff --git a/src/wol.h b/src/wol.h new file mode 100644 index 0000000..c15cf3a --- /dev/null +++ b/src/wol.h @@ -0,0 +1,20 @@ +#ifndef _OG_WOL_H_ +#define _OG_WOL_H_ + +#define OG_WOL_SEQUENCE 6 +#define OG_WOL_MACADDR_LEN 6 +#define OG_WOL_REPEAT 16 + +#include + +struct wol_msg { + char secuencia_FF[OG_WOL_SEQUENCE]; + char macbin[OG_WOL_REPEAT][OG_WOL_MACADDR_LEN]; +}; + +bool wake_up_send(int sd, struct sockaddr_in *client, + const struct wol_msg *msg, const struct in_addr *addr); +bool wake_up_broadcast(int sd, struct sockaddr_in *client, + const struct wol_msg *msg); + +#endif -- cgit v1.2.3-18-g5258