summaryrefslogtreecommitdiffstats
path: root/src/wol.h
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-07-06 11:12:43 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-07-06 11:14:43 +0200
commit96b02b5424db61c32386c48fe05ec3375d8a84f5 (patch)
treee65fbc4e81effc9b245982c7de81d0ad0157cc96 /src/wol.h
parent06af0c26f4c46088d8a6f97877f865527bcbc409 (diff)
#971 split wake on lan code
Add wol.c and wol.h that implements WakeOnLan.
Diffstat (limited to 'src/wol.h')
-rw-r--r--src/wol.h20
1 files changed, 20 insertions, 0 deletions
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 <stdbool.h>
+
+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