[#boost-urls-ipv6_address_rule]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::ipv6&lowbar;address&lowbar;rule
:relfileprefix: ../../
:mrdocs:


Rule for An IP version 6 style address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/ipv6_address_rule.hpp#L125[boost&sol;url&sol;rfc&sol;ipv6&lowbar;address&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::xref:boost/urls/implementation_defined/ipv6_address_rule_t.adoc[ipv6&lowbar;address&lowbar;rule&lowbar;t] ipv6&lowbar;address&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = ipv6_address;
----

=== Example

Rules are used with the function xref:boost/urls/grammar/parse-02.adoc[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< ipv6_address > rv = grammar::parse( "2001:0db8:85a3:0000:0000:8a2e:0370:7334", ipv6_address_rule );
----

=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
    
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== See Also


xref:boost/urls/ipv6_address.adoc[ipv6&lowbar;address],        xref:boost/urls/parse_ipv6_address.adoc[parse&lowbar;ipv6&lowbar;address],        xref:boost/urls/grammar/parse-02.adoc[grammar&colon;&colon;parse]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#
