Last change
on this file since 4e2ef1a was
216986e,
checked in by OpenGnSys Support Team <soporte-og@…>, 3 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 | |
---|
13 | struct wol_msg { |
---|
14 | char wol_sequence_ff[OG_WOL_SEQUENCE]; |
---|
15 | char mac_addr[OG_WOL_REPEAT][OG_WOL_MACADDR_LEN]; |
---|
16 | }; |
---|
17 | |
---|
18 | int wol_socket_open(void); |
---|
19 | int wake_up(int s, const struct in_addr *addr, const struct in_addr *netmask, |
---|
20 | const char *mac, uint32_t wol_delivery_type); |
---|
21 | |
---|
22 | struct og_client_wol { |
---|
23 | struct list_head list; |
---|
24 | struct in_addr addr; |
---|
25 | struct ev_timer timer; |
---|
26 | }; |
---|
27 | |
---|
28 | struct og_client_wol *og_client_wol_create(const struct in_addr *addr); |
---|
29 | struct og_client_wol *og_client_wol_find(const struct in_addr *addr); |
---|
30 | void og_client_wol_refresh(struct og_client_wol *cli_wol); |
---|
31 | void og_client_wol_destroy(struct og_client_wol *cli_wol); |
---|
32 | const char *og_client_wol_status(const struct og_client_wol *wol); |
---|
33 | |
---|
34 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.