this.description="Displays the longhand and shorthand versions of a valid IPv6 address.<br><br>Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.";
output+="\nUnspecified address corresponding to 0.0.0.0/32 in IPv4.";
output+="\nUnspecified address range: ::/128";
}elseif(shorthand==="::1"){
// Loopback address
output+="\nLoopback address to the local host corresponding to 127.0.0.1/8 in IPv4.";
output+="\nLoopback addresses range: ::1/128";
}elseif(ipv6[0]===0&&ipv6[1]===0&&ipv6[2]===0&&
ipv6[3]===0&&ipv6[4]===0&&ipv6[5]===0xffff){
// IPv4-mapped IPv6 address
output+="\nIPv4-mapped IPv6 address detected. IPv6 clients will be handled natively by default, and IPv4 clients appear as IPv6 clients at their IPv4-mapped IPv6 address.";
output+="\nDiscard prefix detected. This is used when forwarding traffic to a sinkhole router to mitigate the effects of a denial-of-service attack. See RFC 6666 for more details.";
output+=" Error: This flag should be set to 0. See RFC 5991 and RFC 4380.";
}
output+="\n\tRandom1: "+Utils.bin(flagRandom1,4)+
"\n\tUG: "+Utils.bin(flagUg,2);
if(flagUg){
output+=" Error: This flag should be set to 00. See RFC 4380.";
}
output+="\n\tRandom2: "+Utils.bin(flagRandom2,8);
if(!flagR&&!flagUg&&flagRandom1&&flagRandom2){
output+="\n\nThis is a valid Teredo address which complies with RFC 4380 and RFC 5991.";
}elseif(!flagR&&!flagUg){
output+="\n\nThis is a valid Teredo address which complies with RFC 4380, however it does not comply with RFC 5991 (Teredo Security Updates) as there are no randomised bits in the flag field.";
output+="\nAssigned to the Benchmarking Methodology Working Group (BMWG) for benchmarking IPv6. Corresponds to 198.18.0.0/15 for benchmarking IPv4. See RFC 5180 for more details.";
output+="\nORCHIDv2 (Overlay Routable Cryptographic Hash Identifiers).\nThese are non-routed IPv6 addresses used for Cryptographic Hash Identifiers.";
output+="\nORCHIDv2 range: 2001:20::/28";
}elseif(ipv6[0]===0x2001&&ipv6[1]===0xdb8){
// Documentation
output+="\nThis is a documentation IPv6 address. This range should be used whenever an example IPv6 address is given or to model networking scenarios. Corresponds to 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 in IPv4.";
output+="\nDocumentation range: 2001:db8::/32";
}elseif(ipv6[0]===0x2002){
// 6to4
output+="\n6to4 transition IPv6 address detected. See RFC 3056 for more details."+
"\nInterface ID (base 10): "+interfaceId.toString();
}elseif(ipv6[0]>=0xfc00&&ipv6[0]<=0xfdff){
// Unique local address
output+="\nThis is a unique local address comparable to the IPv4 private addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See RFC 4193 for more details.";
output+="\nUnique local addresses range: fc00::/7";
}elseif(ipv6[0]>=0xfe80&&ipv6[0]<=0xfebf){
// Link-local address
output+="\nThis is a link-local address comparable to the auto-configuration addresses 169.254.0.0/16 in IPv4.";