|
||||
File indexing completed on 2025-01-18 09:53:28
0001 // 0002 // Copyright (c) 2022 Vinnie Falco (vinnie.falco@gmail.com) 0003 // 0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying 0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0006 // 0007 // Official repository: https://github.com/boostorg/url 0008 // 0009 0010 #ifndef BOOST_URL_RFC_IPV6_ADDRESS_RULE_HPP 0011 #define BOOST_URL_RFC_IPV6_ADDRESS_RULE_HPP 0012 0013 #include <boost/url/detail/config.hpp> 0014 #include <boost/url/ipv6_address.hpp> 0015 #include <boost/url/error_types.hpp> 0016 0017 namespace boost { 0018 namespace urls { 0019 0020 /** Rule for An IP version 6 style address 0021 0022 @par Value Type 0023 @code 0024 using value_type = ipv6_address; 0025 @endcode 0026 0027 @par Example 0028 Rules are used with the function @ref grammar::parse. 0029 @code 0030 system::result< ipv6_address > rv = grammar::parse( "2001:0db8:85a3:0000:0000:8a2e:0370:7334", ipv6_address_rule ); 0031 @endcode 0032 0033 @par BNF 0034 @code 0035 IPv6address = 6( h16 ":" ) ls32 0036 / "::" 5( h16 ":" ) ls32 0037 / [ h16 ] "::" 4( h16 ":" ) ls32 0038 / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 0039 / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 0040 / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 0041 / [ *4( h16 ":" ) h16 ] "::" ls32 0042 / [ *5( h16 ":" ) h16 ] "::" h16 0043 / [ *6( h16 ":" ) h16 ] "::" 0044 0045 ls32 = ( h16 ":" h16 ) / IPv4address 0046 ; least-significant 32 bits of address 0047 0048 h16 = 1*4HEXDIG 0049 ; 16 bits of address represented in hexadecimal 0050 @endcode 0051 0052 @par Specification 0053 @li <a href="https://datatracker.ietf.org/doc/html/rfc4291" 0054 >IP Version 6 Addressing Architecture (rfc4291)</a> 0055 @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" 0056 >3.2.2. Host (rfc3986)</a> 0057 0058 @see 0059 @ref ipv6_address, 0060 @ref parse_ipv6_address, 0061 @ref grammar::parse. 0062 */ 0063 #ifdef BOOST_URL_DOCS 0064 constexpr __implementation_defined__ ipv6_address_rule; 0065 #else 0066 struct ipv6_address_rule_t 0067 { 0068 using value_type = 0069 ipv6_address; 0070 0071 BOOST_URL_DECL 0072 auto 0073 parse( 0074 char const*& it, 0075 char const* end 0076 ) const noexcept -> 0077 system::result<ipv6_address>; 0078 }; 0079 0080 constexpr ipv6_address_rule_t ipv6_address_rule{}; 0081 #endif 0082 0083 } // urls 0084 } // boost 0085 0086 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |