#sending #magic #networking

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

#349 in Operating systems

Download history 94/week @ 2024-11-29 88/week @ 2024-12-06 116/week @ 2024-12-13 105/week @ 2024-12-20 47/week @ 2024-12-27 84/week @ 2025-01-03 122/week @ 2025-01-10 106/week @ 2025-01-17 59/week @ 2025-01-24 66/week @ 2025-01-31 85/week @ 2025-02-07 73/week @ 2025-02-14 71/week @ 2025-02-21 76/week @ 2025-02-28 81/week @ 2025-03-07 76/week @ 2025-03-14

307 downloads per month

MIT/Apache

7KB

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().


lib.rs:

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().

No runtime deps