Rust Wake-on-LAN library [async fork]
https://github.com/LesnyRumcajs/wakey
Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.9.1 to 0.11.0. - [Release notes](https://github.com/styfle/cancel-workflow-action/releases) - [Commits](https://github.com/styfle/cancel-workflow-action/compare/0.9.1...0.11.0) --- updated-dependencies: - dependency-name: styfle/cancel-workflow-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
---|---|---|
.github | ||
wakey | ||
wakey-wake | ||
.gitignore | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
LICENSE | ||
README.md |
Wakey
Library for managing Wake-on-LAN packets. It supports:
- creating magic packets,
- broadcasting them via UDP.
Usage
From string representation of MAC address and using defaults when broadcasting:
let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':');
if wol.send_magic().is_ok() {
println!("Sent the magic packet!");
} else {
println!("Failed to send the magic packet!");
}
Packets can also be constructed with raw bytes and sent from / to custom addresses:
use std::net::SocketAddr;
let wol = wakey::WolPacket::from_bytes(&[0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
let src = SocketAddr::from(([0,0,0,0], 0));
let dst = SocketAddr::from(([255,255,255,255], 9));
wol.send_magic_to(src, dst);
Included binary
cargo run --bin wakey-wake -m 00:11:22:33:44:55