EtherCAT.Transport.BPF (yaethercat v0.1.0)

Copy Markdown View Source

Raw Ethernet on macOS, through a BPF device (/dev/bpfN).

macOS has no packet sockets, and a BPF device needs ioctl calls that the BEAM can't make. So a small C program, priv/bpf/ethercat_bpf.c, opens the device and passes frames to and fro as an Erlang port: a process of its own, so that a crash there closes the port and leaves the BEAM running. It is built with cc when yaethercat is compiled on macOS, and nowhere else. It receives frames of EtherType 0x88A4 only, and none this machine sent.

It needs read and write access to /dev/bpf*: root, or membership of the group access_bpf, which Wireshark's ChmodBPF sets up.

Options of open/1:

  • interface:, required, as "en7"

Summary

Functions

The path of the port program, built when yaethercat is compiled on macOS.

Functions

program()

@spec program() :: Path.t()

The path of the port program, built when yaethercat is compiled on macOS.