2 * Copyright 2014 Facebook, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <folly/IPAddressV6.h>
22 #include <folly/Format.h>
23 #include <folly/IPAddress.h>
24 #include <folly/IPAddressV4.h>
25 #include <folly/MacAddress.h>
32 // public static const
33 const uint32_t IPAddressV6::PREFIX_TEREDO = 0x20010000;
34 const uint32_t IPAddressV6::PREFIX_6TO4 = 0x2002;
37 size_t hash_value(const IPAddressV6& addr) {
40 ostream& operator<<(ostream& os, const IPAddressV6& addr) {
44 void toAppend(IPAddressV6 addr, string* result) {
45 result->append(addr.str());
47 void toAppend(IPAddressV6 addr, fbstring* result) {
48 result->append(addr.str());
51 // public default constructor
52 IPAddressV6::IPAddressV6() {
55 // public string constructor
56 IPAddressV6::IPAddressV6(StringPiece addr) {
59 // Allow addresses surrounded in brackets
61 throw IPAddressFormatException("Invalid IPv6 address '", ip,
62 "': address too short");
64 if (ip.front() == '[' && ip.back() == ']') {
65 ip = ip.substr(1, ip.size() - 2);
68 struct addrinfo* result;
69 struct addrinfo hints;
70 memset(&hints, 0, sizeof(hints));
71 hints.ai_family = AF_INET6;
72 hints.ai_socktype = SOCK_STREAM;
73 hints.ai_flags = AI_NUMERICHOST;
74 if (!getaddrinfo(ip.c_str(), nullptr, &hints, &result)) {
75 struct sockaddr_in6* ipAddr = (struct sockaddr_in6*)result->ai_addr;
76 addr_.in6Addr_ = ipAddr->sin6_addr;
77 scope_ = ipAddr->sin6_scope_id;
80 throw IPAddressFormatException("Invalid IPv6 address '", ip, "'");
84 // in6_addr constructor
85 IPAddressV6::IPAddressV6(const in6_addr& src)
90 // sockaddr_in6 constructor
91 IPAddressV6::IPAddressV6(const sockaddr_in6& src)
92 : addr_(src.sin6_addr)
93 , scope_(src.sin6_scope_id)
97 // ByteArray16 constructor
98 IPAddressV6::IPAddressV6(const ByteArray16& src)
103 // link-local constructor
104 IPAddressV6::IPAddressV6(LinkLocalTag, MacAddress mac)
108 IPAddressV6::AddressStorage::AddressStorage(MacAddress mac) {
109 // The link-local address uses modified EUI-64 format,
110 // See RFC 4291 sections 2.5.1, 2.5.6, and Appendix A
111 const auto* macBytes = mac.bytes();
112 memcpy(&bytes_.front(), "\xfe\x80\x00\x00\x00\x00\x00\x00", 8);
113 bytes_[8] = macBytes[0] ^ 0x02;
114 bytes_[9] = macBytes[1];
115 bytes_[10] = macBytes[2];
118 bytes_[13] = macBytes[3];
119 bytes_[14] = macBytes[4];
120 bytes_[15] = macBytes[5];
123 void IPAddressV6::setFromBinary(ByteRange bytes) {
124 if (bytes.size() != 16) {
125 throw IPAddressFormatException("Invalid IPv6 binary data: length must "
126 "be 16 bytes, got ", bytes.size());
128 memcpy(&addr_.in6Addr_.s6_addr, bytes.data(), sizeof(in6_addr));
133 IPAddressV4 IPAddressV6::createIPv4() const {
134 if (!isIPv4Mapped()) {
135 throw IPAddressFormatException("addr is not v4-to-v6-mapped");
137 const unsigned char* by = bytes();
138 return IPAddressV4(detail::Bytes::mkAddress4(&by[12]));
141 // convert two uint8_t bytes into a uint16_t as hibyte.lobyte
142 static inline uint16_t unpack(uint8_t lobyte, uint8_t hibyte) {
143 return ((uint16_t)hibyte << 8) | (uint16_t)lobyte;
146 // given a src string, unpack count*2 bytes into dest
147 // dest must have as much storage as count
148 static inline void unpackInto(const unsigned char* src,
151 for (int i = 0, hi = 1, lo = 0; i < count; i++) {
152 dest[i] = unpack(src[hi], src[lo]);
159 IPAddressV4 IPAddressV6::getIPv4For6To4() const {
161 throw IPAddressV6::TypeError(format(
162 "Invalid IP '{}': not a 6to4 address", str()).str());
164 // convert 16x8 bytes into first 4x16 bytes
165 uint16_t ints[4] = {0,0,0,0};
166 unpackInto(bytes(), ints, 4);
169 unsigned char bytes[4];
172 ipv4.bytes[0] = (uint8_t)((ints[1] & 0xFF00) >> 8);
173 ipv4.bytes[1] = (uint8_t)(ints[1] & 0x00FF);
174 ipv4.bytes[2] = (uint8_t)((ints[2] & 0xFF00) >> 8);
175 ipv4.bytes[3] = (uint8_t)(ints[2] & 0x00FF);
176 return IPAddressV4(ipv4.addr);
180 bool IPAddressV6::isIPv4Mapped() const {
181 // v4 mapped addresses have their first 10 bytes set to 0, the next 2 bytes
182 // set to 255 (0xff);
183 const unsigned char* by = bytes();
185 // check if first 10 bytes are 0
186 for (int i = 0; i < 10; i++) {
191 // check if bytes 11 and 12 are 255
192 if (by[10] == 0xff && by[11] == 0xff) {
199 IPAddressV6::Type IPAddressV6::type() const {
200 // convert 16x8 bytes into first 2x16 bytes
201 uint16_t ints[2] = {0,0};
202 unpackInto(bytes(), ints, 2);
204 if ((((uint32_t)ints[0] << 16) | ints[1]) == IPAddressV6::PREFIX_TEREDO) {
208 if ((uint32_t)ints[0] == IPAddressV6::PREFIX_6TO4) {
216 string IPAddressV6::toJson() const {
218 "{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash()).str();
222 size_t IPAddressV6::hash() const {
223 if (isIPv4Mapped()) {
224 /* An IPAddress containing this object would be equal (i.e. operator==)
225 to an IPAddress containing the corresponding IPv4.
226 So we must make sure that the hash values are the same as well */
227 return IPAddress::createIPv4(*this).hash();
230 static const uint64_t seed = AF_INET6;
231 uint64_t hash1 = 0, hash2 = 0;
232 hash::SpookyHashV2::Hash128(&addr_, 16, &hash1, &hash2);
233 return hash::hash_combine(seed, hash1, hash2);
237 bool IPAddressV6::inSubnet(StringPiece cidrNetwork) const {
238 auto subnetInfo = IPAddress::createNetwork(cidrNetwork);
239 auto addr = subnetInfo.first;
241 throw IPAddressFormatException("Address '", addr.toJson(), "' ",
242 "is not a V6 address");
244 return inSubnetWithMask(addr.asV6(), fetchMask(subnetInfo.second));
248 bool IPAddressV6::inSubnetWithMask(const IPAddressV6& subnet,
249 const ByteArray16& cidrMask) const {
250 const ByteArray16 mask = detail::Bytes::mask(toByteArray(), cidrMask);
251 const ByteArray16 subMask = detail::Bytes::mask(subnet.toByteArray(),
253 return (mask == subMask);
257 bool IPAddressV6::isLoopback() const {
258 // Check if v4 mapped is loopback
259 if (isIPv4Mapped() && createIPv4().isLoopback()) {
262 auto socka = toSockAddr();
263 return IN6_IS_ADDR_LOOPBACK(&socka.sin6_addr);
266 bool IPAddressV6::isRoutable() const {
268 // 2000::/3 is the only assigned global unicast block
269 inBinarySubnet({{0x20, 0x00}}, 3) ||
270 // ffxe::/16 are global scope multicast addresses,
271 // which are eligible to be routed over the internet
272 (isMulticast() && getMulticastScope() == 0xe);
275 bool IPAddressV6::isLinkLocalBroadcast() const {
276 static const IPAddressV6 kLinkLocalBroadcast("ff02::1");
277 return *this == kLinkLocalBroadcast;
281 bool IPAddressV6::isPrivate() const {
282 // Check if mapped is private
283 if (isIPv4Mapped() && createIPv4().isPrivate()) {
286 return isLoopback() || inBinarySubnet({{0xfc, 0x00}}, 7);
289 bool IPAddressV6::isLinkLocal() const {
290 return inBinarySubnet({{0xfe, 0x80}}, 10);
293 bool IPAddressV6::isMulticast() const {
294 return addr_.bytes_[0] == 0xff;
297 uint8_t IPAddressV6::getMulticastFlags() const {
298 DCHECK(isMulticast());
299 return ((addr_.bytes_[1] >> 4) & 0xf);
302 uint8_t IPAddressV6::getMulticastScope() const {
303 DCHECK(isMulticast());
304 return (addr_.bytes_[1] & 0xf);
307 IPAddressV6 IPAddressV6::getSolicitedNodeAddress() const {
308 // Solicted node addresses must be constructed from unicast (or anycast)
310 DCHECK(!isMulticast());
312 uint8_t bytes[16] = { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
313 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00 };
314 bytes[13] = addr_.bytes_[13];
315 bytes[14] = addr_.bytes_[14];
316 bytes[15] = addr_.bytes_[15];
317 return IPAddressV6::fromBinary(ByteRange(bytes, 16));
321 IPAddressV6 IPAddressV6::mask(size_t numBits) const {
322 static const auto bits = bitCount();
323 if (numBits > bits) {
324 throw IPAddressFormatException("numBits(", numBits, ") > bitCount(",
327 ByteArray16 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
328 return IPAddressV6(ba);
332 string IPAddressV6::str() const {
333 char buffer[INET6_ADDRSTRLEN] = {0};
334 sockaddr_in6 sock = toSockAddr();
336 (sockaddr*)&sock, sizeof(sock),
337 buffer, INET6_ADDRSTRLEN,
338 nullptr, 0, NI_NUMERICHOST)) {
340 return std::move(ip);
342 throw IPAddressFormatException("Invalid address with hex ",
343 "'", detail::Bytes::toHex(bytes(), 16), "'");
348 string IPAddressV6::toFullyQualified() const {
349 return detail::fastIpv6ToString(addr_.in6Addr_);
353 uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
354 const auto highestIndex = byteCount() - 1;
355 if (byteIndex > highestIndex) {
356 throw std::invalid_argument(to<string>("Byte index must be <= ",
357 to<string>(highestIndex), " for addresses of type :",
358 detail::familyNameStr(AF_INET6)));
360 return bytes()[byteIndex];
364 const ByteArray16 IPAddressV6::fetchMask(size_t numBits) {
365 static const uint8_t bits = bitCount();
366 if (numBits > bits) {
367 throw IPAddressFormatException("IPv6 addresses are 128 bits.");
369 // masks_ is backed by an array so is zero indexed
370 return masks_[numBits];
374 bool IPAddressV6::inBinarySubnet(const std::array<uint8_t, 2> addr,
375 size_t numBits) const {
376 const unsigned char* subbytes = mask(numBits).bytes();
377 return (std::memcmp(addr.data(), subbytes, 2) == 0);
381 const std::array<ByteArray16, 129> IPAddressV6::masks_ = {{
382 /* /0 */ {{ 0x00,0x00,0x00,0x00,
385 0x00,0x00,0x00,0x00 }},
386 /* /1 */ {{ 0x80,0x00,0x00,0x00,
389 0x00,0x00,0x00,0x00 }},
390 /* /2 */ {{ 0xc0,0x00,0x00,0x00,
393 0x00,0x00,0x00,0x00 }},
394 /* /3 */ {{ 0xe0,0x00,0x00,0x00,
397 0x00,0x00,0x00,0x00 }},
398 /* /4 */ {{ 0xf0,0x00,0x00,0x00,
401 0x00,0x00,0x00,0x00 }},
402 /* /5 */ {{ 0xf8,0x00,0x00,0x00,
405 0x00,0x00,0x00,0x00 }},
406 /* /6 */ {{ 0xfc,0x00,0x00,0x00,
409 0x00,0x00,0x00,0x00 }},
410 /* /7 */ {{ 0xfe,0x00,0x00,0x00,
413 0x00,0x00,0x00,0x00 }},
414 /* /8 */ {{ 0xff,0x00,0x00,0x00,
417 0x00,0x00,0x00,0x00 }},
418 /* /9 */ {{ 0xff,0x80,0x00,0x00,
421 0x00,0x00,0x00,0x00 }},
422 /* /10 */ {{ 0xff,0xc0,0x00,0x00,
425 0x00,0x00,0x00,0x00 }},
426 /* /11 */ {{ 0xff,0xe0,0x00,0x00,
429 0x00,0x00,0x00,0x00 }},
430 /* /12 */ {{ 0xff,0xf0,0x00,0x00,
433 0x00,0x00,0x00,0x00 }},
434 /* /13 */ {{ 0xff,0xf8,0x00,0x00,
437 0x00,0x00,0x00,0x00 }},
438 /* /14 */ {{ 0xff,0xfc,0x00,0x00,
441 0x00,0x00,0x00,0x00 }},
442 /* /15 */ {{ 0xff,0xfe,0x00,0x00,
445 0x00,0x00,0x00,0x00 }},
446 /* /16 */ {{ 0xff,0xff,0x00,0x00,
449 0x00,0x00,0x00,0x00 }},
450 /* /17 */ {{ 0xff,0xff,0x80,0x00,
453 0x00,0x00,0x00,0x00 }},
454 /* /18 */ {{ 0xff,0xff,0xc0,0x00,
457 0x00,0x00,0x00,0x00 }},
458 /* /19 */ {{ 0xff,0xff,0xe0,0x00,
461 0x00,0x00,0x00,0x00 }},
462 /* /20 */ {{ 0xff,0xff,0xf0,0x00,
465 0x00,0x00,0x00,0x00 }},
466 /* /21 */ {{ 0xff,0xff,0xf8,0x00,
469 0x00,0x00,0x00,0x00 }},
470 /* /22 */ {{ 0xff,0xff,0xfc,0x00,
473 0x00,0x00,0x00,0x00 }},
474 /* /23 */ {{ 0xff,0xff,0xfe,0x00,
477 0x00,0x00,0x00,0x00 }},
478 /* /24 */ {{ 0xff,0xff,0xff,0x00,
481 0x00,0x00,0x00,0x00 }},
482 /* /25 */ {{ 0xff,0xff,0xff,0x80,
485 0x00,0x00,0x00,0x00 }},
486 /* /26 */ {{ 0xff,0xff,0xff,0xc0,
489 0x00,0x00,0x00,0x00 }},
490 /* /27 */ {{ 0xff,0xff,0xff,0xe0,
493 0x00,0x00,0x00,0x00 }},
494 /* /28 */ {{ 0xff,0xff,0xff,0xf0,
497 0x00,0x00,0x00,0x00 }},
498 /* /29 */ {{ 0xff,0xff,0xff,0xf8,
501 0x00,0x00,0x00,0x00 }},
502 /* /30 */ {{ 0xff,0xff,0xff,0xfc,
505 0x00,0x00,0x00,0x00 }},
506 /* /31 */ {{ 0xff,0xff,0xff,0xfe,
509 0x00,0x00,0x00,0x00 }},
510 /* /32 */ {{ 0xff,0xff,0xff,0xff,
513 0x00,0x00,0x00,0x00 }},
514 /* /33 */ {{ 0xff,0xff,0xff,0xff,
517 0x00,0x00,0x00,0x00 }},
518 /* /34 */ {{ 0xff,0xff,0xff,0xff,
521 0x00,0x00,0x00,0x00 }},
522 /* /35 */ {{ 0xff,0xff,0xff,0xff,
525 0x00,0x00,0x00,0x00 }},
526 /* /36 */ {{ 0xff,0xff,0xff,0xff,
529 0x00,0x00,0x00,0x00 }},
530 /* /37 */ {{ 0xff,0xff,0xff,0xff,
533 0x00,0x00,0x00,0x00 }},
534 /* /38 */ {{ 0xff,0xff,0xff,0xff,
537 0x00,0x00,0x00,0x00 }},
538 /* /39 */ {{ 0xff,0xff,0xff,0xff,
541 0x00,0x00,0x00,0x00 }},
542 /* /40 */ {{ 0xff,0xff,0xff,0xff,
545 0x00,0x00,0x00,0x00 }},
546 /* /41 */ {{ 0xff,0xff,0xff,0xff,
549 0x00,0x00,0x00,0x00 }},
550 /* /42 */ {{ 0xff,0xff,0xff,0xff,
553 0x00,0x00,0x00,0x00 }},
554 /* /43 */ {{ 0xff,0xff,0xff,0xff,
557 0x00,0x00,0x00,0x00 }},
558 /* /44 */ {{ 0xff,0xff,0xff,0xff,
561 0x00,0x00,0x00,0x00 }},
562 /* /45 */ {{ 0xff,0xff,0xff,0xff,
565 0x00,0x00,0x00,0x00 }},
566 /* /46 */ {{ 0xff,0xff,0xff,0xff,
569 0x00,0x00,0x00,0x00 }},
570 /* /47 */ {{ 0xff,0xff,0xff,0xff,
573 0x00,0x00,0x00,0x00 }},
574 /* /48 */ {{ 0xff,0xff,0xff,0xff,
577 0x00,0x00,0x00,0x00 }},
578 /* /49 */ {{ 0xff,0xff,0xff,0xff,
581 0x00,0x00,0x00,0x00 }},
582 /* /50 */ {{ 0xff,0xff,0xff,0xff,
585 0x00,0x00,0x00,0x00 }},
586 /* /51 */ {{ 0xff,0xff,0xff,0xff,
589 0x00,0x00,0x00,0x00 }},
590 /* /52 */ {{ 0xff,0xff,0xff,0xff,
593 0x00,0x00,0x00,0x00 }},
594 /* /53 */ {{ 0xff,0xff,0xff,0xff,
597 0x00,0x00,0x00,0x00 }},
598 /* /54 */ {{ 0xff,0xff,0xff,0xff,
601 0x00,0x00,0x00,0x00 }},
602 /* /55 */ {{ 0xff,0xff,0xff,0xff,
605 0x00,0x00,0x00,0x00 }},
606 /* /56 */ {{ 0xff,0xff,0xff,0xff,
609 0x00,0x00,0x00,0x00 }},
610 /* /57 */ {{ 0xff,0xff,0xff,0xff,
613 0x00,0x00,0x00,0x00 }},
614 /* /58 */ {{ 0xff,0xff,0xff,0xff,
617 0x00,0x00,0x00,0x00 }},
618 /* /59 */ {{ 0xff,0xff,0xff,0xff,
621 0x00,0x00,0x00,0x00 }},
622 /* /60 */ {{ 0xff,0xff,0xff,0xff,
625 0x00,0x00,0x00,0x00 }},
626 /* /61 */ {{ 0xff,0xff,0xff,0xff,
629 0x00,0x00,0x00,0x00 }},
630 /* /62 */ {{ 0xff,0xff,0xff,0xff,
633 0x00,0x00,0x00,0x00 }},
634 /* /63 */ {{ 0xff,0xff,0xff,0xff,
637 0x00,0x00,0x00,0x00 }},
638 /* /64 */ {{ 0xff,0xff,0xff,0xff,
641 0x00,0x00,0x00,0x00 }},
642 /* /65 */ {{ 0xff,0xff,0xff,0xff,
645 0x00,0x00,0x00,0x00 }},
646 /* /66 */ {{ 0xff,0xff,0xff,0xff,
649 0x00,0x00,0x00,0x00 }},
650 /* /67 */ {{ 0xff,0xff,0xff,0xff,
653 0x00,0x00,0x00,0x00 }},
654 /* /68 */ {{ 0xff,0xff,0xff,0xff,
657 0x00,0x00,0x00,0x00 }},
658 /* /69 */ {{ 0xff,0xff,0xff,0xff,
661 0x00,0x00,0x00,0x00 }},
662 /* /70 */ {{ 0xff,0xff,0xff,0xff,
665 0x00,0x00,0x00,0x00 }},
666 /* /71 */ {{ 0xff,0xff,0xff,0xff,
669 0x00,0x00,0x00,0x00 }},
670 /* /72 */ {{ 0xff,0xff,0xff,0xff,
673 0x00,0x00,0x00,0x00 }},
674 /* /73 */ {{ 0xff,0xff,0xff,0xff,
677 0x00,0x00,0x00,0x00 }},
678 /* /74 */ {{ 0xff,0xff,0xff,0xff,
681 0x00,0x00,0x00,0x00 }},
682 /* /75 */ {{ 0xff,0xff,0xff,0xff,
685 0x00,0x00,0x00,0x00 }},
686 /* /76 */ {{ 0xff,0xff,0xff,0xff,
689 0x00,0x00,0x00,0x00 }},
690 /* /77 */ {{ 0xff,0xff,0xff,0xff,
693 0x00,0x00,0x00,0x00 }},
694 /* /78 */ {{ 0xff,0xff,0xff,0xff,
697 0x00,0x00,0x00,0x00 }},
698 /* /79 */ {{ 0xff,0xff,0xff,0xff,
701 0x00,0x00,0x00,0x00 }},
702 /* /80 */ {{ 0xff,0xff,0xff,0xff,
705 0x00,0x00,0x00,0x00 }},
706 /* /81 */ {{ 0xff,0xff,0xff,0xff,
709 0x00,0x00,0x00,0x00 }},
710 /* /82 */ {{ 0xff,0xff,0xff,0xff,
713 0x00,0x00,0x00,0x00 }},
714 /* /83 */ {{ 0xff,0xff,0xff,0xff,
717 0x00,0x00,0x00,0x00 }},
718 /* /84 */ {{ 0xff,0xff,0xff,0xff,
721 0x00,0x00,0x00,0x00 }},
722 /* /85 */ {{ 0xff,0xff,0xff,0xff,
725 0x00,0x00,0x00,0x00 }},
726 /* /86 */ {{ 0xff,0xff,0xff,0xff,
729 0x00,0x00,0x00,0x00 }},
730 /* /87 */ {{ 0xff,0xff,0xff,0xff,
733 0x00,0x00,0x00,0x00 }},
734 /* /88 */ {{ 0xff,0xff,0xff,0xff,
737 0x00,0x00,0x00,0x00 }},
738 /* /89 */ {{ 0xff,0xff,0xff,0xff,
741 0x00,0x00,0x00,0x00 }},
742 /* /90 */ {{ 0xff,0xff,0xff,0xff,
745 0x00,0x00,0x00,0x00 }},
746 /* /91 */ {{ 0xff,0xff,0xff,0xff,
749 0x00,0x00,0x00,0x00 }},
750 /* /92 */ {{ 0xff,0xff,0xff,0xff,
753 0x00,0x00,0x00,0x00 }},
754 /* /93 */ {{ 0xff,0xff,0xff,0xff,
757 0x00,0x00,0x00,0x00 }},
758 /* /94 */ {{ 0xff,0xff,0xff,0xff,
761 0x00,0x00,0x00,0x00 }},
762 /* /95 */ {{ 0xff,0xff,0xff,0xff,
765 0x00,0x00,0x00,0x00 }},
766 /* /96 */ {{ 0xff,0xff,0xff,0xff,
769 0x00,0x00,0x00,0x00 }},
770 /* /97 */ {{ 0xff,0xff,0xff,0xff,
773 0x80,0x00,0x00,0x00 }},
774 /* /98 */ {{ 0xff,0xff,0xff,0xff,
777 0xc0,0x00,0x00,0x00 }},
778 /* /99 */ {{ 0xff,0xff,0xff,0xff,
781 0xe0,0x00,0x00,0x00 }},
782 /* /100 */ {{ 0xff,0xff,0xff,0xff,
785 0xf0,0x00,0x00,0x00 }},
786 /* /101 */ {{ 0xff,0xff,0xff,0xff,
789 0xf8,0x00,0x00,0x00 }},
790 /* /102 */ {{ 0xff,0xff,0xff,0xff,
793 0xfc,0x00,0x00,0x00 }},
794 /* /103 */ {{ 0xff,0xff,0xff,0xff,
797 0xfe,0x00,0x00,0x00 }},
798 /* /104 */ {{ 0xff,0xff,0xff,0xff,
801 0xff,0x00,0x00,0x00 }},
802 /* /105 */ {{ 0xff,0xff,0xff,0xff,
805 0xff,0x80,0x00,0x00 }},
806 /* /106 */ {{ 0xff,0xff,0xff,0xff,
809 0xff,0xc0,0x00,0x00 }},
810 /* /107 */ {{ 0xff,0xff,0xff,0xff,
813 0xff,0xe0,0x00,0x00 }},
814 /* /108 */ {{ 0xff,0xff,0xff,0xff,
817 0xff,0xf0,0x00,0x00 }},
818 /* /109 */ {{ 0xff,0xff,0xff,0xff,
821 0xff,0xf8,0x00,0x00 }},
822 /* /110 */ {{ 0xff,0xff,0xff,0xff,
825 0xff,0xfc,0x00,0x00 }},
826 /* /111 */ {{ 0xff,0xff,0xff,0xff,
829 0xff,0xfe,0x00,0x00 }},
830 /* /112 */ {{ 0xff,0xff,0xff,0xff,
833 0xff,0xff,0x00,0x00 }},
834 /* /113 */ {{ 0xff,0xff,0xff,0xff,
837 0xff,0xff,0x80,0x00 }},
838 /* /114 */ {{ 0xff,0xff,0xff,0xff,
841 0xff,0xff,0xc0,0x00 }},
842 /* /115 */ {{ 0xff,0xff,0xff,0xff,
845 0xff,0xff,0xe0,0x00 }},
846 /* /116 */ {{ 0xff,0xff,0xff,0xff,
849 0xff,0xff,0xf0,0x00 }},
850 /* /117 */ {{ 0xff,0xff,0xff,0xff,
853 0xff,0xff,0xf8,0x00 }},
854 /* /118 */ {{ 0xff,0xff,0xff,0xff,
857 0xff,0xff,0xfc,0x00 }},
858 /* /119 */ {{ 0xff,0xff,0xff,0xff,
861 0xff,0xff,0xfe,0x00 }},
862 /* /120 */ {{ 0xff,0xff,0xff,0xff,
865 0xff,0xff,0xff,0x00 }},
866 /* /121 */ {{ 0xff,0xff,0xff,0xff,
869 0xff,0xff,0xff,0x80 }},
870 /* /122 */ {{ 0xff,0xff,0xff,0xff,
873 0xff,0xff,0xff,0xc0 }},
874 /* /123 */ {{ 0xff,0xff,0xff,0xff,
877 0xff,0xff,0xff,0xe0 }},
878 /* /124 */ {{ 0xff,0xff,0xff,0xff,
881 0xff,0xff,0xff,0xf0 }},
882 /* /125 */ {{ 0xff,0xff,0xff,0xff,
885 0xff,0xff,0xff,0xf8 }},
886 /* /126 */ {{ 0xff,0xff,0xff,0xff,
889 0xff,0xff,0xff,0xfc }},
890 /* /127 */ {{ 0xff,0xff,0xff,0xff,
893 0xff,0xff,0xff,0xfe }},
894 /* /128 */ {{ 0xff,0xff,0xff,0xff,
897 0xff,0xff,0xff,0xff }},