Rust Wake-on-LAN library [async fork] https://github.com/LesnyRumcajs/wakey
Go to file
Hubert 317b145bdc
add into_inner (#5)
* add into_inner

* remove redundant super::*
2022-06-24 13:49:10 +02:00
.github/workflows add proper CI (#3) 2022-06-24 11:43:48 +02:00
src add into_inner (#5) 2022-06-24 13:49:10 +02:00
.gitignore added idea to gitignore 2019-02-03 16:48:08 +01:00
.travis.yml add rust release channels 2019-02-03 17:47:22 +01:00
Cargo.toml use arrayvec for packets (#4) 2022-06-24 13:13:18 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2022-06-24 11:49:51 +02:00
LICENSE Create LICENSE 2019-02-03 16:50:53 +01:00
README.md add proper CI (#3) 2022-06-24 11:43:48 +02:00

Wakey

Rust Crates.io docs.rs

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(&vec![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

The binary bin/wake may be directly used in scripts:

wake -m 00:11:22:33:44:55