IPv6 is the next-generation Internet Protocol version
designated as the successor to IPv4, the first
implementation used in the Internet that is still in
dominant use currently.
More information: http://ipv6.com/
IPv6 supports 128-bit address space as opposed to 32-bit
address space of IPv4.
IPv6 is written as 8 blocks of 4 octal digits (16 bit)
separated by a colon (":"). Zero block can be replaced by "::".
For example:
0000:0000:0000:0000:0000:0000:0000:0001
is equal
::0001
is equal
::1
is analogue IPv4 127.0.0.1
0000:0000:0000:0000:0000:0000:0000:0000
is equal
::
is analogue IPv4 0.0.0.0
2001:cdba:0000:0000:0000:0000:3257:9652
is equal
2001:cdba::3257:9652
IPv4 address can be submitted through IPv6 as ::ffff:xx.xx.xx.xx,
where xx.xx.xx.xx 32-bit IPv4 addresses.
::ffff:51b0:ec6d
is equal
::ffff:81.176.236.109
is analogue IPv4 81.176.236.109
The URL for the IPv6 address will be of the form:
http://[2001:cdba:0000:0000:0000:0000:3257:9652]/
If needed to specify a port, it will be listed after the
closing square bracket followed by a colon.
http://[2001:cdba:0000:0000:0000:0000:3257:9652]:8080/
address: "2001:cdba:0000:0000:0000:0000:3257:9652"
port: 8080
IPv6Address can be used as well as IPv4Address.
scope addr = new IPv6Address(8080);
address: "::"
port: 8080
scope addr_2 = new IPv6Address("::1", 8081);
address: "::1"
port: 8081
scope addr_3 = new IPv6Address("::1");
address: "::1"
port: PORT_ANY
Also in the IPv6Address constructor can specify the service name
or port as string
scope addr_3 = new IPv6Address("::", "ssh");
address: "::"
port: 22 (ssh service port)
scope addr_4 = new IPv6Address("::", "8080");
address: "::"
port: 8080
- struct sockaddr_in6;
- protected this();
- protected this(sockaddr* sa);
- protected @property sockaddr* name();
- protected const const @property int nameLen();
- @property AddressFamily addressFamily();
- const const @property ushort port();
- this(int port);
- Create IPv6Address with zero address
- this(const(char)[] addr, int port = cast(int)cast(ushort)0u);
- -port- can be PORT_ANY
-addr- is an IP address or host name
- this(const(char)[] addr, const(char)[] service);
- -service- can be a port number or service name
-addr- is an IP address or host name
- @property ubyte[] addr();
- const const @property char[] toAddrString();
- const const @property char[] toPortString();
- string toString();