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 
val address : t -> Core.Unix.Inet_addr.t
val bits : t -> 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 to_string : t -> string
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 -> Core.Int32.t
val address : t -> Core.Unix.Inet_addr.t
val bits : t -> int
val inet4_addr_of_int_exn : Core.Int32.t -> Core.Unix.Inet_addr.t
Some things (like the kernel) report addresses and ports as hex or decimal integers. Parse those .
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t

Generate 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 match_ 10.0.0.0/8 10.0.0.0 is true.

Some things (like the kernel) report addresses and ports as hex or decimal integers. Parse those .