An OCaml library for constructing Wake-on-LAN magic packets
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 38.0%
Dune 18.4%
Other 43.7%
12 1 1

Clone this repository

https://tangled.org/ryan.freumh.org/ocaml-wake-on-lan https://tangled.org/did:plc:3lfhu6ehlynzjgehef6alnvg/ocaml-wake-on-lan
git@knot.cl.cam.ac.uk:ryan.freumh.org/ocaml-wake-on-lan git@knot.cl.cam.ac.uk:did:plc:3lfhu6ehlynzjgehef6alnvg/ocaml-wake-on-lan

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

ocaml-wake-on-lan#

OCaml libraries for sending Wake-on-LAN magic packets.

  • wol — pure library for constructing magic packets from MAC addresses
  • wol-eio — Eio-based UDP sending, plus the owol CLI tool
  • wol-mirage — MirageOS network stack support

Installation#

opam install wol-eio

CLI usage#

owol AA:BB:CC:DD:EE:FF

Options:

  • -p, --port — UDP port (default: 9)
  • -a, --address — destination IP (default: 255.255.255.255)
  • -b, --broadcast — set SO_BROADCAST socket option (default: true)

Library usage#

(* Construct a magic packet *)
let packet = Wol.magic_packet (Macaddr.of_string_exn "AA:BB:CC:DD:EE:FF")

(* Send via Eio *)
Wol_eio.send ~net mac

References#