Module Unix.Cidr

module Cidr: sig .. end
A representation of CIDR netmasks and functions to match if a given address is inside the range or not.

type t = {
   address :Core.Unix.Inet_addr.t;
   bits :int;
}
val of_string : string -> t option
Generate a Cidr.t based on a string like "10.0.0.0/8". Addresses are not expanded (i.e. "10/8" is invalid.
val of_string_exn : string -> t
val match_ : t -> Core.Unix.Inet_addr.t -> bool option
Is the given address inside the given Cidr.t? Note that the broadcast and network addresses are considered valid so match_ 10.0.0.0/8 10.0.0.0 is true.
val match_exn : t -> Core.Unix.Inet_addr.t -> bool
val inet_addr_to_int_exn : Core.Unix.Inet_addr.t -> int
val inet4_addr_of_int_exn : int -> Core.Unix.Inet_addr.t
Some things (like the kernel) report addresses and ports as hex or decimal integers. Parse those .