Pure OCaml ARP table lookup - reads /proc/net/arp on Linux and arp -a on macOS/BSD
1
fork

Configure Feed

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

OCaml 81.2%
Dune 5.1%
Other 13.7%
21 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-arp https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-arp
git@git.recoil.org:gazagnaire.org/ocaml-arp git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-arp

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

Download tar.gz
README.md

ocaml-arp#

Pure OCaml ARP table lookup. Reads the system ARP cache to resolve IP addresses to MAC addresses.

  • Linux: reads /proc/net/arp directly
  • macOS/BSD: parses output of arp -a

Installation#

Install with opam:

$ opam install nox-arp

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install nox-arp

Usage#

let () =
  let entries = Arp.table () in
  List.iter
    (fun (e : Arp.entry) -> Printf.printf "%s -> %s\n" e.ip e.mac)
    entries

Licence#

ISC