source: ogServer-Git/src/wol.h

Last change on this file was 216986e, checked in by OpenGnSys Support Team <soporte-og@…>, 2 years ago

#915 consolidate WoL sender function

This patch aims simplifies the WoL sender routine.

A few related changes:

  • Replace goto err to continue if IP address is malformed
  • Use ret |= instead of ret &= to accumulate error code.
  • Property mode set to 100644
File size: 904 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#define OG_WOL_PORT             9
8
9#include "list.h"
10#include <ev.h>
11#include <stdbool.h>
12
13struct wol_msg {
14        char wol_sequence_ff[OG_WOL_SEQUENCE];
15        char mac_addr[OG_WOL_REPEAT][OG_WOL_MACADDR_LEN];
16};
17
18int wol_socket_open(void);
19int wake_up(int s, const struct in_addr *addr, const struct in_addr *netmask,
20            const char *mac, uint32_t wol_delivery_type);
21
22struct og_client_wol {
23        struct list_head        list;
24        struct in_addr          addr;
25        struct ev_timer         timer;
26};
27
28struct og_client_wol *og_client_wol_create(const struct in_addr *addr);
29struct og_client_wol *og_client_wol_find(const struct in_addr *addr);
30void og_client_wol_refresh(struct og_client_wol *cli_wol);
31void og_client_wol_destroy(struct og_client_wol *cli_wol);
32const char *og_client_wol_status(const struct og_client_wol *wol);
33
34#endif
Note: See TracBrowser for help on using the repository browser.