Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Rust Wake-on-LAN library

License

NotificationsYou must be signed in to change notification settings

LesnyRumcajs/wakey

Repository files navigation

RustCrates.iodocs.rscodecov

Library for managingWake-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(&mac_adress, sep)?;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 00:11:22:33:44:55

[8]ページ先頭

©2009-2025 Movatter.jp