#magic #packets #sending #networking

wake-on-lan

创建和发送网络唤醒魔法包的库

1个不稳定版本

使用旧的Rust 2015

0.2.0 2018年11月30日

#47#magic

Download history 112/week @ 2024-03-13 63/week @ 2024-03-20 70/week @ 2024-03-27 66/week @ 2024-04-03 90/week @ 2024-04-10 107/week @ 2024-04-17 150/week @ 2024-04-24 88/week @ 2024-05-01 73/week @ 2024-05-08 130/week @ 2024-05-15 79/week @ 2024-05-22 67/week @ 2024-05-29 51/week @ 2024-06-05 83/week @ 2024-06-12 68/week @ 2024-06-19 56/week @ 2024-06-26

268 每月下载量

MIT/Apache

7KB

网络唤醒

创建和发送网络唤醒魔法包的Rust库。

用法

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()?;

要选择源和目标IP地址和端口,请使用 send_to()。如果您想访问魔法包的内容,请使用 magic_bytes()


lib.rs:

创建和发送网络唤醒魔法包的库。

用法

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()?;

要选择源和目标IP地址和端口,请使用 send_to()。如果您想访问魔法包的内容,请使用 magic_bytes()

无运行时依赖