l2ethernet 0.3.0 copy "l2ethernet: ^0.3.0" to clipboard
l2ethernet: ^0.3.0 copied to clipboard

PlatformLinux
outdated

Sending raw Ethernet frames in Dart via FFI. Usable for generating WOL packets or non-standard protocols running on Ethernet. Sending only. Linux only.

example/README.md

Examples #

I added two examples:

  • send_packet.dart which shows a simple example to send a raw Ethernet frame. Use tcpdump -i $nic 'ether proto 0xbeef to see it being sent out.
  • colorlight.dart sends several frames for a Colorlight card. Used to test this package.

Notes #

  1. Both examples need an environment variable nic to contain the network interface name to use.
  2. Both need to run either as root or the binary has to have the needed capabilities to use a raw socket: setcap 'cap_net_admin,cap_net_raw+ep' BINARY
  3. Because of the requirement to run as root, I highly recommend to compile stand-alone executables (via dart compile exe) which can get above capabilities added. This avoids having to run dart as root.
1
likes
130
pub points
28%
popularity

Publisher

unverified uploader

Sending raw Ethernet frames in Dart via FFI. Usable for generating WOL packets or non-standard protocols running on Ethernet. Sending only. Linux only.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

ffi, path

More

Packages that depend on l2ethernet