source: ogServer-Git/src/wol.h @ 6e70916

Last change on this file since 6e70916 was 1f13855, checked in by OpenGnSys Support Team <soporte-og@…>, 3 years ago

#1043 add WOL_SENT state

WOL_SENT tells that WakeOnLan? was sent to computer, after 60 seconds,
if computer does not boot, this state is released.

  • Property mode set to 100644
File size: 957 bytes
Line 
1#ifndef _OG_WOL_H_
2#define _OG_WOL_H_
3
4#define OG_WOL_SEQUENCE         6
5#define OG_WOL_MACADDR_LEN      6
6#define OG_WOL_REPEAT           16
7
8#include "list.h"
9#include <ev.h>
10#include <stdbool.h>
11
12struct wol_msg {
13        char secuencia_FF[OG_WOL_SEQUENCE];
14        char macbin[OG_WOL_REPEAT][OG_WOL_MACADDR_LEN];
15};
16
17int wol_socket_open(void);
18bool wake_up_send(int sd, struct sockaddr_in *client,
19                  const struct wol_msg *msg, const struct in_addr *addr);
20bool wake_up_broadcast(int sd, struct sockaddr_in *client,
21                       const struct wol_msg *msg);
22
23struct og_client_wol {
24        struct list_head        list;
25        struct in_addr          addr;
26        struct ev_timer         timer;
27};
28
29struct og_client_wol *og_client_wol_create(const struct in_addr *addr);
30struct og_client_wol *og_client_wol_find(const struct in_addr *addr);
31void og_client_wol_refresh(struct og_client_wol *cli_wol);
32void og_client_wol_destroy(struct og_client_wol *cli_wol);
33const char *og_client_wol_status(const struct og_client_wol *wol);
34
35#endif
Note: See TracBrowser for help on using the repository browser.