module Cidr: sig
.. end
A representation of CIDR netmasks (e.g. "192.168.0.0/24") and functions to match if a
given address is inside the range or not. Only IPv4 addresses are supported.
type
t
include Stringable.S
of_string
Generates a Cidr.t based on a string like "10.0.0.0/8"
. Addresses are
not expanded, i.e. "10/8"
is invalid.
val does_match : t -> Unix.Inet_addr.t -> bool
Is the given address inside the given Cidr.t? Note that the broadcast and network
addresses are considered valid so does_match 10.0.0.0/8 10.0.0.0
is true.
val bin_t : t Bin_prot.Type_class.t
val bin_read_t : t Bin_prot.Read_ml.reader
val bin_read_t_ : t Bin_prot.Unsafe_read_c.reader
val bin_read_t__ : (int -> t) Bin_prot.Unsafe_read_c.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write_ml.writer
val bin_write_t_ : t Bin_prot.Unsafe_write_c.writer
val bin_writer_t : t Bin_prot.Type_class.writer
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
of_string
Generates a Cidr.t based on a string like "10.0.0.0/8"
. Addresses are
not expanded, i.e. "10/8"
is invalid.
Is the given address inside the given Cidr.t? Note that the broadcast and network
addresses are considered valid so does_match 10.0.0.0/8 10.0.0.0
is true.