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 base_address : t -> Unix.Inet_addr.t
Accessors.
base_address 192.168.0.0/24 = 192.168.0.0
bits 192.168.0.0/24 = 24
.
val bits : t -> int
val multicast : t
IPv4 multicast address can be represented by the CIDR prefix 224.0.0.0/4,
(i.e. addreses from 224.0.0.0 to 239.255.255.255, inclusive)
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 Core_kernel.Std.Bin_prot.Type_class.t
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
val bin_writer_t : t Core_kernel.Std.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.
Accessors.
base_address 192.168.0.0/24 = 192.168.0.0
bits 192.168.0.0/24 = 24
.
IPv4 multicast address can be represented by the CIDR prefix 224.0.0.0/4,
(i.e. addreses from 224.0.0.0 to 239.255.255.255, inclusive)
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.