A library for manipulation of IP address representations.
Raised when parsing of IP address syntax fails.
A collection of functions for IPv4 addresses.
Type of the internet protocol v4 address of a host
Text string conversion
of_string_exn ipv4_string is the address represented
by ipv4_string. Raises Parse_error if ipv4_string is not a
valid representation of an IPv4 address.
Same as of_string_exn but returns an option type instead of raising
an exception.
Same as of_string_exn but takes as an extra argument the offset
into the string for reading.
to_string ipv4 is the dotted decimal string representation
of ipv4, i.e. XXX.XX.X.XXX.
Bytestring conversion
Int conversion
A module for manipulating IPv4 network prefixes.
Type of a internet protocol subnet
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.
Same as of_string_exn but returns an option type instead of raising
an exception.
Same as of_string_exn but takes as an extra argument the offset
into the string for reading.
to_string prefix is the CIDR notation string representation
of prefix, i.e. XXX.XX.X.XXX/XX.
is_global ipv4 is a predicate indicating whether ipv4 globally
addresses a node.
is_multicast ipv4 is a predicate indicating whether ipv4 is a
multicast address.
A collection of functions for IPv6 addresses.
Type of the internet protocol v6 address of a host
Text string conversion
of_string_exn ipv6_string is the address represented
by ipv6_string. Raises Parse_error if ipv6_string is not a
valid representation of an IPv6 address.
Same as of_string_exn but returns an option type instead of raising
an exception.
Same as of_string_exn but takes as an extra argument the offset into
the string for reading.
to_string ipv6 is the string representation of ipv6,
i.e. XXX:XX:X::XXX:XX.
Bytestring conversion
Int conversion
of_int64 (ho, lo) is the IPv6 address represented by two int64.
to_int64 ipv6 is the 128-bit packed encoding of ipv6.
of_int32 (a, b, c, d) is the IPv6 address represented by four int32.
to_int32 ipv6 is the 128-bit packed encoding of ipv6.
of_int16 (a, b, c, d, e, f, g, h) is the IPv6 address represented by
eight 16-bit int.
to_int16 ipv6 is the 128-bit packed encoding of ipv6.
A module for manipulating IPv6 network prefixes.
Type of a internet protocol subnet
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.
Same as of_string_exn but returns an option type instead of raising
an exception.
Same as of_string_exn but takes as an extra argument the offset
into the string for reading.
to_string prefix is the CIDR notation string representation
of prefix, i.e. XXX:XX:X::XXX/XX.
is_global ipv6 is a predicate indicating whether ipv6 globally
addresses a node.
is_multicast ipv6 is a predicate indicating whether ipv6 is a
multicast address.
of_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.
Same as of_string_exn but returns an option type instead of raising an
exception.
Same as of_string_exn but takes as an extra argument the offset into
the string for reading.
is_global addr is a predicate indicating whether addr globally
addresses a node.
is_multicast addr is a predicate indicating whether addr is a
multicast address.
is_private addr is a predicate indicating whether addr privately
addresses a node.
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.
Same as of_string_exn but returns an option type instead of raising
an exception.
Same as of_string_exn but takes as an extra argument the offset
into the string for reading.