1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use IPAddress;
use BigUint;
use One;
/// The loopback address is a unicast localhost address. If an
/// application in a host sends packets to this address, the IPv6 stack
/// will loop these packets back on the same virtual interface.
///
/// Loopback addresses are expressed in the following form:
///
/// ::1
///
/// or, with their appropriate prefix,
///
/// ::1/128
///
/// As for the unspecified addresses, IPv6 loopbacks can be created with
/// IPAddress calling their own class:
///
/// ip = IPAddress::IPv6::Loopback.new
///
/// ip.to_string
/// /// "::1/128"
///
/// or by using the wrapper:
///
/// ip = IPAddress "::1"
///
/// ip.to_string
/// /// "::1/128"
///
/// Checking if an address is loopback is easy with the IPv6/// loopback?
/// method:
///
/// ip.loopback?
/// /// true
///
/// The IPv6 loopback address corresponds to 127.0.0.1 in IPv4.
///
///
/// Creates a new IPv6 unspecified address
///
/// ip = IPAddress::IPv6::Loopback.new
///
/// ip.to_string
/// /// "::1/128"
///