module Addr:sig
..end
bitstring
internally but
the abstract type Eth.Addr.t has a batter printer (which support
such thing as vendor decoding).
Anyway, one is able to cast from/to a bitstring
with
(addr :> bitstring)
for instance.
val print_with_vendor : bool Batteries.ref
# Eth.Addr.of_string "a4:ba:db:e6:15:fa";;
- : Eth.Addr.t = Dell:e6:15:fa
# Eth.Addr.print_with_vendor := false;;
- : unit = ()
# Eth.Addr.of_string "a4:ba:db:e6:15:fa";;
- : Eth.Addr.t = a4:ba:db:e6:15:fa
This only affect the printing of Ethernet addresses in the toplevel and
Eth.Addr.to_string
.
val string_of_sfx : int -> int64 -> string
val vendor_lookup : int64 -> (string * int) option
include struct ... end
val of_string : string -> t
"a4:ba:db:e6:15:fa"
, not "Dell:e6:15:fa"
).
So Eth.Addr.of_string (Eth.Addr.to_string "a4:ba:db:e6:15:fa")
will not work if Eth.Addr.print_with_vendor
is true!val broadcast : t
val zero : t
val eq : t -> t -> bool
=
operator, here is a dedicated comparison
operator for addresses.val random : unit -> t