Parse_error (err,packet) is raised when parsing of the IP address syntax fails. err contains a human-readable error and packet is the original octet list that failed to parse.
Type of ordered address scope classifications
val string_of_scope : scope -> stringstring_of_scope scope returns a human-readable representation of scope.
val scope_of_string : string -> (scope, [> `Msg of string ]) Stdlib.resultscope_of_string s returns a scope from a string representation of s. Valid string values for s can be obtained via string_of_scope.
val pp_scope : Stdlib.Format.formatter -> scope -> unitpp_scope fmt scope outputs a human-readable representation of scope to the fmt formatter.
module V4 : sig ... endA collection of functions for IPv4 addresses.
module V6 : sig ... endA collection of functions for IPv6 addresses.
val to_string : t -> stringto_string addr is the text string representation of addr.
val to_buffer : Stdlib.Buffer.t -> t -> unitto_buffer buf addr writes the text string representation of addr into buf.
val pp : Stdlib.Format.formatter -> t -> unitpp f ip outputs a human-readable representation of ip to the formatter f.
val of_string_exn : string -> tof_string_exn s parses s as an IPv4 or IPv6 address. Raises Parse_error if s is not a valid string representation of an IP address.
val of_string : string -> (t, [> `Msg of string ]) Stdlib.resultSame as of_string_exn but returns a result type instead of raising an exception.
val of_string_raw : string -> int Stdlib.ref -> tSame as of_string_exn but takes as an extra argument the offset into the string for reading.
v4_of_v6 ipv6 is the IPv4 representation of the IPv6 address ipv6. If ipv6 is not an IPv4-mapped address, None is returned.
val is_global : t -> boolis_global addr is a predicate indicating whether addr globally addresses a node.
val is_multicast : t -> boolis_multicast addr is a predicate indicating whether addr is a multicast address.
val is_private : t -> boolis_private addr is a predicate indicating whether addr privately addresses a node.
multicast_to_mac addr is the MAC address corresponding to the multicast address addr. See V4.multicast_to_mac and V6.multicast_to_mac.
val to_domain_name : t -> [ `host ] Domain_name.tto_domain_name addr is the domain name label list for reverse lookups of addr. This includes the .in-addr.arpa or .ip6.arpa suffix.
val of_domain_name : 'a Domain_name.t -> t optionof_domain_name name is Some t if the name has an .in-addr.arpa or ip6.arpa suffix, and an IP address prefixed.
val succ : t -> (t, [> `Msg of string ]) Stdlib.resultsucc addr is ip address next to addr. Returns a human-readable error string if it's already the highest address.
val pred : t -> (t, [> `Msg of string ]) Stdlib.resultpred addr is ip address before addr. Returns a human-readable error string if it's already the lowest address.
module Prefix : sig ... endinclude Stdlib.Map.OrderedType with type t := t
A total ordering function over the keys. This is a two-argument function f such that f e1 e2 is zero if the keys e1 and e2 are equal, f e1 e2 is strictly negative if e1 is smaller than e2, and f e1 e2 is strictly positive if e1 is greater than e2. Example: a suitable ordering function is the generic structural comparison function Stdlib.compare.