Page
Library
Module
Module type
Parameter
Class
Class type
Source
Ipaddr.V6
SourceA collection of functions for IPv6 addresses.
Type of the internet protocol v6 address of a host
Converts the low bytes of eight int values into an abstract V6.t
.
of_string ipv6_string
is the address represented by the human-readable IPv6 address ipv6_string
. Returns a human-readable error string if parsing failed.
of_string_exn ipv6_string
is the address represented by the human-readable IPv6 address ipv6_string
. Raises Parse_error
if ipv6_string
is invalid or truncated.
with_port_of_string ~default ipv6_string
is the address represented by ipv6_string
with a possibly :<port>
(otherwise, we take the default
value). Due to the ':'
separator, the user should expand ipv6_string
to let us to consider the last :<port>
as a port. In other words:
::1:8080
returns the IPv6 ::1:8080
with the default
port0:0:0:0:0:0:0:1:8080
returns ::1
with the port 8080
.Same as of_string_exn
but takes as an extra argument the offset into the string for reading. off
will be mutated to an unspecified value during the function call. Raises Parse_error
if it is an invalid or truncated IP address.
to_string ipv6
is the string representation of ipv6
, i.e. XXX:XX:X::XXX:XX
.
to_buffer buf ipv6
writes the string representation of ipv6
into the buffer buf
.
pp f ipv6
outputs a human-readable representation of ipv6
to the formatter f
.
of_octets ?off s
is the IPv6 address t
represented by the octets s
starting from offset off
within the string. Returns a human-readable error string if s
is not at least off+16
bytes long. off
defaults to 0.
of_octets_exn ?off ipv6_octets
is the IPv6 address represented by ipv6_octets
, starting from offset off
. Raises Parse_error
if ipv6_octets
is not at least off+16
bytes long. off
defaults to 0.
write_octets_exn ?off ipv6 b
writes 16 bytes that encode ipv6
into b
starting from offset off
within b
. b
must be at least off+16
bytes long or a Parse_error
exception will be raised.
write_octets ?off ipv6 b
writes 16 bytes that encode ipv6
into b
starting from offset off
within b
. b
must be at least off+16
bytes long or an error is returned.
of_int64 (ho, lo)
is the IPv6 address represented by two int64.
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
.
multicast_to_mac ipv6
is the MAC address corresponding to the multicast address ipv6
. Described by RFC 2464.
to_domain_name ipv6
is the domain name label list for reverse lookups of ipv6
. This includes the .ip6.arpa
suffix.
of_domain_name name
is Some t
if the name
has an .ip6.arpa
suffix, and an IPv6 address prefixed.
succ ipv6
is ip address next to ipv6
. Returns a human-readable error string if it's already the highest address.
pred ipv6
is ip address before ipv6
. Returns a human-readable error string if it's already the lowest address.
link_address_of_mac mac
is the link-local address for an Ethernet interface derived by the IEEE MAC -> EUI-64 map with the Universal/Local bit complemented for IPv6.
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.
is_private ipv6
is a predicate indicating whether ipv6
privately addresses a node.
include 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
.