138 AddressV4::bytes_type d1 = {{10, 0, 0, 1}};
140 BEAST_EXPECT(v4.to_bytes()[0] == 10);
141 BEAST_EXPECT(v4.to_bytes()[1] == 0);
142 BEAST_EXPECT(v4.to_bytes()[2] == 0);
143 BEAST_EXPECT(v4.to_bytes()[3] == 1);
145 BEAST_EXPECT((~((0xff) << 16)) == 0xff00ffff);
147 auto d2 = v4.to_bytes();
150 BEAST_EXPECT(v4.to_bytes()[0] == 10);
151 BEAST_EXPECT(v4.to_bytes()[1] == 10);
152 BEAST_EXPECT(v4.to_bytes()[2] == 0);
153 BEAST_EXPECT(v4.to_bytes()[3] == 1);
238 "2001:db8:a0b:12f0::1",
239 {{32, 01, 13, 184, 10, 11, 18, 240, 0, 0, 0, 0, 0, 0, 0, 1}},
242 "[2001:db8:a0b:12f0::1]:8",
243 {{32, 01, 13, 184, 10, 11, 18, 240, 0, 0, 0, 0, 0, 0, 0, 1}},
246 "[2001:2002:2003:2004:2005:2006:2007:2008]:65535",
247 {{32, 1, 32, 2, 32, 3, 32, 4, 32, 5, 32, 6, 32, 7, 32, 8}},
250 "2001:2002:2003:2004:2005:2006:2007:2008 65535",
251 {{32, 1, 32, 2, 32, 3, 32, 4, 32, 5, 32, 6, 32, 7, 32, 8}},
253 "[2001:2002:2003:2004:2005:2006:2007:2008]:65535");
257 AddressV4::bytes_type d = {{127, 0, 0, 1}};
264 BEAST_EXPECT(
to_string(ep) ==
"127.0.0.1:80");
267 boost::asio::ip::make_address_v6(
268 boost::asio::ip::v4_mapped,
AddressV4{d}),
279 BEAST_EXPECT(
get_class(ep.to_v4()) ==
'A');
285 BEAST_EXPECT(
to_string(ep) ==
"10.0.0.1");
287 ep =
Endpoint(boost::asio::ip::make_address_v6(
288 boost::asio::ip::v4_mapped,
AddressV4{d}));
290 get_class(boost::asio::ip::make_address_v4(
291 boost::asio::ip::v4_mapped, ep.to_v6())) ==
'A');
299 d = {{166, 78, 151, 147}};
306 BEAST_EXPECT(
to_string(ep) ==
"166.78.151.147");
308 ep =
Endpoint(boost::asio::ip::make_address_v6(
309 boost::asio::ip::v4_mapped,
AddressV4{d}));
318 AddressV6::bytes_type d2 = {
319 {253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}};
335 BEAST_EXPECT(ep.address() == ep1.address());
336 BEAST_EXPECT(ep1.port() == 2016);
340 BEAST_EXPECT(ep.address() == ep2.address());
341 BEAST_EXPECT(ep2.port() == 2016);
342 BEAST_EXPECT(ep1 == ep2);
346 BEAST_EXPECT(ep.address() == ep3.address());
347 BEAST_EXPECT(ep3.port() == 2016);
348 BEAST_EXPECT(ep2 == ep3);
352 BEAST_EXPECT(ep.address() == ep4.address());
353 BEAST_EXPECT(ep4.port() == 2016);
354 BEAST_EXPECT(ep3 == ep4);
364 BEAST_EXPECT(ep.port() == 2017);
365 BEAST_EXPECT(ep.address() ==
AddressV6{});
390 failParseEP(
"[1234:5678:90ab:cdef:1234:5678:90ab:cdef:1111]:1");
391 failParseEP(
"[1234:5678:90ab:cdef:1234:5678:90ab:cdef:1111]:12345");
398 constexpr auto items{100};
400 for (
auto i = 0; i < items; ++i)
406 BEAST_EXPECT(max_lf > 0.90);