package ipaddr

  1. Overview
  2. Docs
Module type
Class type
type addr = t
include sig ... end
val addr_of_sexp : Sexplib.Sexp.t -> addr
val sexp_of_addr : addr -> Sexplib.Sexp.t

Type of a internet protocol subnet

include sig ... end
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val to_string : t -> string

to_string subnet is the text string representation of subnet.

val to_buffer : Buffer.t -> t -> unit

to_buffer buf subnet writes the text string representation of subnet into buf.

val pp_hum : Format.formatter -> t -> unit

pp_hum f subnet outputs a human-readable representation of subnet to the formatter f.

val of_string_exn : string -> t

of_string_exn cidr is the subnet prefix represented by the CIDR string, cidr. Raises Parse_error if cidr is not a valid representation of a CIDR notation routing prefix.

val of_string : string -> t option

Same as of_string_exn but returns an option type instead of raising an exception.

val of_string_raw : string -> int Pervasives.ref -> t

Same as of_string_exn but takes as an extra argument the offset into the string for reading.

val v4_of_v6 : V6.Prefix.t -> V4.Prefix.t option

v4_of_v6 ipv6 is the IPv4 representation of the IPv6 subnet ipv6. If ipv6 is not an IPv4-mapped subnet, None is returned.

val to_v4 : t -> V4.Prefix.t option

to_v4 subnet is the IPv4 representation of subnet.

val v6_of_v4 : V4.Prefix.t -> V6.Prefix.t

v6_of_v4 ipv4 is the IPv6 representation of the IPv4 subnet ipv4.

val to_v6 : t -> V6.Prefix.t

to_v6 subnet is the IPv6 representation of subnet.

val mem : addr -> t -> bool

mem ip subnet checks whether ip is found within subnet.

val subset : subnet:t -> network:t -> bool

subset ~subnet ~network checks whether subnet is contained within network.

val of_addr : addr -> t

of_addr ip create a subnet composed of only one address, ip.

val network : t -> addr

network subnet is the address for subnet.

val netmask : t -> addr

netmask subnet is the netmask for subnet.

include Map.OrderedType with type t := t
val compare : t -> t -> int

Innovation. Community. Security.