#wake-on-lan #packet #lan #devices

wake-on-lan

A library for creating and sending Wake-on-LAN magic packets

1 unstable release

Uses old Rust 2015

0.2.0 Nov 30, 2018

#359 in Operating systems

Download history 133/week @ 2024-12-16 79/week @ 2024-12-23 48/week @ 2024-12-30 108/week @ 2025-01-06 114/week @ 2025-01-13 98/week @ 2025-01-20 45/week @ 2025-01-27 87/week @ 2025-02-03 93/week @ 2025-02-10 46/week @ 2025-02-17 87/week @ 2025-02-24 56/week @ 2025-03-03 101/week @ 2025-03-10 58/week @ 2025-03-17 37/week @ 2025-03-24 18/week @ 2025-03-31

215 downloads per month

MIT/Apache

7KB

A library for creating and sending Wake-on-LAN magic packets.

Usage

use wake_on_lan;

// The MAC address of the target device
let mac_address: [u8; 6] = [0x0F, 0x1E, 0x2D, 0x3C, 0x4B, 0x5A];

// Create a magic packet (but don't send it yet)
let magic_packet = wake_on_lan::MagicPacket::new(&mac_address);

// Send the magic packet via UDP to the broadcast address 255.255.255.255:9 from 0.0.0.0:0
magic_packet.send()?;

To choose the source and destination IPs and ports, use send_to(). If you want to access the contents of the magic packet, use magic_bytes().


wake-on-lan

A Rust library for creating and sending Wake-on-LAN magic packets.

Usage

use wake_on_lan;

// The MAC address of the target device
let mac_address: [u8; 6] = [0x0F, 0x1E, 0x2D, 0x3C, 0x4B, 0x5A];

// Create a magic packet (but don't send it yet)
let magic_packet = wake_on_lan::MagicPacket::new(&mac_address);

// Send the magic packet via UDP to the broadcast address 255.255.255.255:9 
// from 0.0.0.0:0
magic_packet.send()?;

To choose the source and destination IPs and ports, use send_to(). If you want to access the contents of the magic packet, use magic_bytes().

No runtime deps