package macaddr

  1. Overview
  2. Docs
A library for manipulation of MAC address representations

Install

Dune Dependency

Authors

Maintainers

Sources

ipaddr-3.0.0.tbz
sha256=c80acde4c774a9e08c7146cc2386a8ced85268288202081157cfca235a5239a6
md5=29248b09ead9ac272cd0f4c8ae934082

doc/macaddr.sexp/Macaddr_sexp/index.html

Module Macaddr_sexpSource

serialisers to and from Macaddr and s-expression Sexplib0 format

To use these with ppx-based derivers, simply replace the reference to the Macaddr type definition with Macaddr_sexp instead. That will import the sexp-conversion functions, and the actual type definitions are simply aliases to the corresponding type within Ipaddr. For example, you might do:

  type t = {
    ip: Ipaddr_sexp.t;
    mac: Macaddr_sexp.t;
  } [@@deriving sexp]

The actual types of the records will be aliases to the main library types, and there will be two new functions available as converters.

   type t = {
     ip: Ipaddr.t;
     mac: Macaddr.t;
   }
   val sexp_of_t : t -> Sexplib0.t
   val t_of_sexp : Sexplib0.t -> t
Sourceval sexp_of_t : Macaddr.t -> Sexplib0.Sexp.t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> Macaddr.t
Sourceval compare : Macaddr.t -> Macaddr.t -> int
OCaml

Innovation. Community. Security.