2 * Copyright 2017 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>
26 #include <folly/detail/IPAddressSource.h>
33 // public static const
34 const uint32_t IPAddressV6::PREFIX_TEREDO = 0x20010000;
35 const uint32_t IPAddressV6::PREFIX_6TO4 = 0x2002;
38 size_t hash_value(const IPAddressV6& addr) {
41 ostream& operator<<(ostream& os, const IPAddressV6& addr) {
45 void toAppend(IPAddressV6 addr, string* result) {
46 result->append(addr.str());
48 void toAppend(IPAddressV6 addr, fbstring* result) {
49 result->append(addr.str());
52 bool IPAddressV6::validate(StringPiece ip) {
53 if (ip.size() > 0 && ip.front() == '[' && ip.back() == ']') {
54 ip = ip.subpiece(1, ip.size() - 2);
57 constexpr size_t kStrMaxLen = INET6_ADDRSTRLEN;
58 std::array<char, kStrMaxLen + 1> ip_cstr;
59 const size_t len = std::min(ip.size(), kStrMaxLen);
60 std::memcpy(ip_cstr.data(), ip.data(), len);
63 return 1 == inet_pton(AF_INET6, ip_cstr.data(), &addr);
66 // public default constructor
67 IPAddressV6::IPAddressV6() {
70 // public string constructor
71 IPAddressV6::IPAddressV6(StringPiece addr) {
74 // Allow addresses surrounded in brackets
76 throw IPAddressFormatException(
77 to<std::string>("Invalid IPv6 address '", ip, "': address too short"));
79 if (ip.front() == '[' && ip.back() == ']') {
80 ip = ip.substr(1, ip.size() - 2);
83 struct addrinfo* result;
84 struct addrinfo hints;
85 memset(&hints, 0, sizeof(hints));
86 hints.ai_family = AF_INET6;
87 hints.ai_socktype = SOCK_STREAM;
88 hints.ai_flags = AI_NUMERICHOST;
89 if (!getaddrinfo(ip.c_str(), nullptr, &hints, &result)) {
90 struct sockaddr_in6* ipAddr = (struct sockaddr_in6*)result->ai_addr;
91 addr_.in6Addr_ = ipAddr->sin6_addr;
92 scope_ = uint16_t(ipAddr->sin6_scope_id);
95 throw IPAddressFormatException(
96 to<std::string>("Invalid IPv6 address '", ip, "'"));
100 // in6_addr constructor
101 IPAddressV6::IPAddressV6(const in6_addr& src)
106 // sockaddr_in6 constructor
107 IPAddressV6::IPAddressV6(const sockaddr_in6& src)
108 : addr_(src.sin6_addr)
109 , scope_(uint16_t(src.sin6_scope_id))
113 // ByteArray16 constructor
114 IPAddressV6::IPAddressV6(const ByteArray16& src)
119 // link-local constructor
120 IPAddressV6::IPAddressV6(LinkLocalTag, MacAddress mac)
124 IPAddressV6::AddressStorage::AddressStorage(MacAddress mac) {
125 // The link-local address uses modified EUI-64 format,
126 // See RFC 4291 sections 2.5.1, 2.5.6, and Appendix A
127 const auto* macBytes = mac.bytes();
128 memcpy(&bytes_.front(), "\xfe\x80\x00\x00\x00\x00\x00\x00", 8);
129 bytes_[8] = uint8_t(macBytes[0] ^ 0x02);
130 bytes_[9] = macBytes[1];
131 bytes_[10] = macBytes[2];
134 bytes_[13] = macBytes[3];
135 bytes_[14] = macBytes[4];
136 bytes_[15] = macBytes[5];
139 Optional<MacAddress> IPAddressV6::getMacAddressFromLinkLocal() const {
140 // Returned MacAddress must be constructed from a link-local IPv6 address.
141 if (!(addr_.bytes_[0] == 0xfe && addr_.bytes_[1] == 0x80 &&
142 addr_.bytes_[2] == 0x00 && addr_.bytes_[3] == 0x00 &&
143 addr_.bytes_[4] == 0x00 && addr_.bytes_[5] == 0x00 &&
144 addr_.bytes_[6] == 0x00 && addr_.bytes_[7] == 0x00 &&
145 addr_.bytes_[11] == 0xff && addr_.bytes_[12] == 0xfe)) {
148 // The link-local address uses modified EUI-64 format,
149 // See RFC 4291 sections 2.5.1, 2.5.6, and Appendix A
150 std::array<uint8_t, MacAddress::SIZE> bytes;
151 // Step 1: first 8 bytes are fe:80:00:00:00:00:00:00, and can be stripped
152 // Step 2: invert the universal/local (U/L) flag (bit 7)
153 bytes[0] = addr_.bytes_[8] ^ 0x02;
154 // Step 3: copy thhese bytes are they are
155 bytes[1] = addr_.bytes_[9];
156 bytes[2] = addr_.bytes_[10];
157 // Step 4: strip bytes (0xfffe), which are bytes_[11] and bytes_[12]
158 // Step 5: copy the rest.
159 bytes[3] = addr_.bytes_[13];
160 bytes[4] = addr_.bytes_[14];
161 bytes[5] = addr_.bytes_[15];
162 return Optional<MacAddress>(MacAddress::fromBinary(range(bytes)));
165 void IPAddressV6::setFromBinary(ByteRange bytes) {
166 if (bytes.size() != 16) {
167 throw IPAddressFormatException(to<std::string>(
168 "Invalid IPv6 binary data: length must ",
172 memcpy(&addr_.in6Addr_.s6_addr, bytes.data(), sizeof(in6_addr));
177 IPAddressV4 IPAddressV6::createIPv4() const {
178 if (!isIPv4Mapped()) {
179 throw IPAddressFormatException("addr is not v4-to-v6-mapped");
181 const unsigned char* by = bytes();
182 return IPAddressV4(detail::Bytes::mkAddress4(&by[12]));
185 // convert two uint8_t bytes into a uint16_t as hibyte.lobyte
186 static inline uint16_t unpack(uint8_t lobyte, uint8_t hibyte) {
187 return uint16_t((uint16_t(hibyte) << 8) | lobyte);
190 // given a src string, unpack count*2 bytes into dest
191 // dest must have as much storage as count
192 static inline void unpackInto(const unsigned char* src,
195 for (size_t i = 0, hi = 1, lo = 0; i < count; i++) {
196 dest[i] = unpack(src[hi], src[lo]);
203 IPAddressV4 IPAddressV6::getIPv4For6To4() const {
205 throw IPAddressV6::TypeError(format(
206 "Invalid IP '{}': not a 6to4 address", str()).str());
208 // convert 16x8 bytes into first 4x16 bytes
209 uint16_t ints[4] = {0,0,0,0};
210 unpackInto(bytes(), ints, 4);
213 unsigned char bytes[4];
216 ipv4.bytes[0] = (uint8_t)((ints[1] & 0xFF00) >> 8);
217 ipv4.bytes[1] = (uint8_t)(ints[1] & 0x00FF);
218 ipv4.bytes[2] = (uint8_t)((ints[2] & 0xFF00) >> 8);
219 ipv4.bytes[3] = (uint8_t)(ints[2] & 0x00FF);
220 return IPAddressV4(ipv4.addr);
224 bool IPAddressV6::isIPv4Mapped() const {
225 // v4 mapped addresses have their first 10 bytes set to 0, the next 2 bytes
226 // set to 255 (0xff);
227 const unsigned char* by = bytes();
229 // check if first 10 bytes are 0
230 for (int i = 0; i < 10; i++) {
235 // check if bytes 11 and 12 are 255
236 if (by[10] == 0xff && by[11] == 0xff) {
243 IPAddressV6::Type IPAddressV6::type() const {
244 // convert 16x8 bytes into first 2x16 bytes
245 uint16_t ints[2] = {0,0};
246 unpackInto(bytes(), ints, 2);
248 if ((((uint32_t)ints[0] << 16) | ints[1]) == IPAddressV6::PREFIX_TEREDO) {
252 if ((uint32_t)ints[0] == IPAddressV6::PREFIX_6TO4) {
260 string IPAddressV6::toJson() const {
262 "{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash()).str();
266 size_t IPAddressV6::hash() const {
267 if (isIPv4Mapped()) {
268 /* An IPAddress containing this object would be equal (i.e. operator==)
269 to an IPAddress containing the corresponding IPv4.
270 So we must make sure that the hash values are the same as well */
271 return IPAddress::createIPv4(*this).hash();
274 static const uint64_t seed = AF_INET6;
275 uint64_t hash1 = 0, hash2 = 0;
276 hash::SpookyHashV2::Hash128(&addr_, 16, &hash1, &hash2);
277 return hash::hash_combine(seed, hash1, hash2);
281 bool IPAddressV6::inSubnet(StringPiece cidrNetwork) const {
282 auto subnetInfo = IPAddress::createNetwork(cidrNetwork);
283 auto addr = subnetInfo.first;
285 throw IPAddressFormatException(to<std::string>(
286 "Address '", addr.toJson(), "' ", "is not a V6 address"));
288 return inSubnetWithMask(addr.asV6(), fetchMask(subnetInfo.second));
292 bool IPAddressV6::inSubnetWithMask(const IPAddressV6& subnet,
293 const ByteArray16& cidrMask) const {
294 const ByteArray16 mask = detail::Bytes::mask(toByteArray(), cidrMask);
295 const ByteArray16 subMask = detail::Bytes::mask(subnet.toByteArray(),
297 return (mask == subMask);
301 bool IPAddressV6::isLoopback() const {
302 // Check if v4 mapped is loopback
303 if (isIPv4Mapped() && createIPv4().isLoopback()) {
306 auto socka = toSockAddr();
307 return IN6_IS_ADDR_LOOPBACK(&socka.sin6_addr);
310 bool IPAddressV6::isRoutable() const {
312 // 2000::/3 is the only assigned global unicast block
313 inBinarySubnet({{0x20, 0x00}}, 3) ||
314 // ffxe::/16 are global scope multicast addresses,
315 // which are eligible to be routed over the internet
316 (isMulticast() && getMulticastScope() == 0xe);
319 bool IPAddressV6::isLinkLocalBroadcast() const {
320 static const IPAddressV6 kLinkLocalBroadcast("ff02::1");
321 return *this == kLinkLocalBroadcast;
325 bool IPAddressV6::isPrivate() const {
326 // Check if mapped is private
327 if (isIPv4Mapped() && createIPv4().isPrivate()) {
330 return isLoopback() || inBinarySubnet({{0xfc, 0x00}}, 7);
334 bool IPAddressV6::isLinkLocal() const {
335 return inBinarySubnet({{0xfe, 0x80}}, 10);
338 bool IPAddressV6::isMulticast() const {
339 return addr_.bytes_[0] == 0xff;
342 uint8_t IPAddressV6::getMulticastFlags() const {
343 DCHECK(isMulticast());
344 return uint8_t((addr_.bytes_[1] >> 4) & 0xf);
347 uint8_t IPAddressV6::getMulticastScope() const {
348 DCHECK(isMulticast());
349 return uint8_t(addr_.bytes_[1] & 0xf);
352 IPAddressV6 IPAddressV6::getSolicitedNodeAddress() const {
353 // Solicted node addresses must be constructed from unicast (or anycast)
355 DCHECK(!isMulticast());
357 uint8_t bytes[16] = { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
358 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00 };
359 bytes[13] = addr_.bytes_[13];
360 bytes[14] = addr_.bytes_[14];
361 bytes[15] = addr_.bytes_[15];
362 return IPAddressV6::fromBinary(ByteRange(bytes, 16));
366 IPAddressV6 IPAddressV6::mask(size_t numBits) const {
367 static const auto bits = bitCount();
368 if (numBits > bits) {
369 throw IPAddressFormatException(
370 to<std::string>("numBits(", numBits, ") > bitCount(", bits, ")"));
372 ByteArray16 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
373 return IPAddressV6(ba);
377 string IPAddressV6::str() const {
378 char buffer[INET6_ADDRSTRLEN] = {0};
379 sockaddr_in6 sock = toSockAddr();
381 (sockaddr*)&sock, sizeof(sock),
382 buffer, INET6_ADDRSTRLEN,
383 nullptr, 0, NI_NUMERICHOST)) {
387 throw IPAddressFormatException(to<std::string>(
388 "Invalid address with hex ",
390 detail::Bytes::toHex(bytes(), 16),
396 string IPAddressV6::toFullyQualified() const {
397 return detail::fastIpv6ToString(addr_.in6Addr_);
401 uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
402 const auto highestIndex = byteCount() - 1;
403 if (byteIndex > highestIndex) {
404 throw std::invalid_argument(to<string>("Byte index must be <= ",
405 to<string>(highestIndex), " for addresses of type :",
406 detail::familyNameStr(AF_INET6)));
408 return bytes()[byteIndex];
412 const ByteArray16 IPAddressV6::fetchMask(size_t numBits) {
413 static const size_t bits = bitCount();
414 if (numBits > bits) {
415 throw IPAddressFormatException("IPv6 addresses are 128 bits.");
417 // masks_ is backed by an array so is zero indexed
418 return masks_[numBits];
422 CIDRNetworkV6 IPAddressV6::longestCommonPrefix(
423 const CIDRNetworkV6& one,
424 const CIDRNetworkV6& two) {
425 auto prefix = detail::Bytes::longestCommonPrefix(
426 one.first.addr_.bytes_, one.second, two.first.addr_.bytes_, two.second);
427 return {IPAddressV6(prefix.first), prefix.second};
431 bool IPAddressV6::inBinarySubnet(const std::array<uint8_t, 2> addr,
432 size_t numBits) const {
433 auto masked = mask(numBits);
434 return (std::memcmp(addr.data(), masked.bytes(), 2) == 0);
438 const std::array<ByteArray16, 129> IPAddressV6::masks_ = {{
439 /* /0 */ {{ 0x00,0x00,0x00,0x00,
442 0x00,0x00,0x00,0x00 }},
443 /* /1 */ {{ 0x80,0x00,0x00,0x00,
446 0x00,0x00,0x00,0x00 }},
447 /* /2 */ {{ 0xc0,0x00,0x00,0x00,
450 0x00,0x00,0x00,0x00 }},
451 /* /3 */ {{ 0xe0,0x00,0x00,0x00,
454 0x00,0x00,0x00,0x00 }},
455 /* /4 */ {{ 0xf0,0x00,0x00,0x00,
458 0x00,0x00,0x00,0x00 }},
459 /* /5 */ {{ 0xf8,0x00,0x00,0x00,
462 0x00,0x00,0x00,0x00 }},
463 /* /6 */ {{ 0xfc,0x00,0x00,0x00,
466 0x00,0x00,0x00,0x00 }},
467 /* /7 */ {{ 0xfe,0x00,0x00,0x00,
470 0x00,0x00,0x00,0x00 }},
471 /* /8 */ {{ 0xff,0x00,0x00,0x00,
474 0x00,0x00,0x00,0x00 }},
475 /* /9 */ {{ 0xff,0x80,0x00,0x00,
478 0x00,0x00,0x00,0x00 }},
479 /* /10 */ {{ 0xff,0xc0,0x00,0x00,
482 0x00,0x00,0x00,0x00 }},
483 /* /11 */ {{ 0xff,0xe0,0x00,0x00,
486 0x00,0x00,0x00,0x00 }},
487 /* /12 */ {{ 0xff,0xf0,0x00,0x00,
490 0x00,0x00,0x00,0x00 }},
491 /* /13 */ {{ 0xff,0xf8,0x00,0x00,
494 0x00,0x00,0x00,0x00 }},
495 /* /14 */ {{ 0xff,0xfc,0x00,0x00,
498 0x00,0x00,0x00,0x00 }},
499 /* /15 */ {{ 0xff,0xfe,0x00,0x00,
502 0x00,0x00,0x00,0x00 }},
503 /* /16 */ {{ 0xff,0xff,0x00,0x00,
506 0x00,0x00,0x00,0x00 }},
507 /* /17 */ {{ 0xff,0xff,0x80,0x00,
510 0x00,0x00,0x00,0x00 }},
511 /* /18 */ {{ 0xff,0xff,0xc0,0x00,
514 0x00,0x00,0x00,0x00 }},
515 /* /19 */ {{ 0xff,0xff,0xe0,0x00,
518 0x00,0x00,0x00,0x00 }},
519 /* /20 */ {{ 0xff,0xff,0xf0,0x00,
522 0x00,0x00,0x00,0x00 }},
523 /* /21 */ {{ 0xff,0xff,0xf8,0x00,
526 0x00,0x00,0x00,0x00 }},
527 /* /22 */ {{ 0xff,0xff,0xfc,0x00,
530 0x00,0x00,0x00,0x00 }},
531 /* /23 */ {{ 0xff,0xff,0xfe,0x00,
534 0x00,0x00,0x00,0x00 }},
535 /* /24 */ {{ 0xff,0xff,0xff,0x00,
538 0x00,0x00,0x00,0x00 }},
539 /* /25 */ {{ 0xff,0xff,0xff,0x80,
542 0x00,0x00,0x00,0x00 }},
543 /* /26 */ {{ 0xff,0xff,0xff,0xc0,
546 0x00,0x00,0x00,0x00 }},
547 /* /27 */ {{ 0xff,0xff,0xff,0xe0,
550 0x00,0x00,0x00,0x00 }},
551 /* /28 */ {{ 0xff,0xff,0xff,0xf0,
554 0x00,0x00,0x00,0x00 }},
555 /* /29 */ {{ 0xff,0xff,0xff,0xf8,
558 0x00,0x00,0x00,0x00 }},
559 /* /30 */ {{ 0xff,0xff,0xff,0xfc,
562 0x00,0x00,0x00,0x00 }},
563 /* /31 */ {{ 0xff,0xff,0xff,0xfe,
566 0x00,0x00,0x00,0x00 }},
567 /* /32 */ {{ 0xff,0xff,0xff,0xff,
570 0x00,0x00,0x00,0x00 }},
571 /* /33 */ {{ 0xff,0xff,0xff,0xff,
574 0x00,0x00,0x00,0x00 }},
575 /* /34 */ {{ 0xff,0xff,0xff,0xff,
578 0x00,0x00,0x00,0x00 }},
579 /* /35 */ {{ 0xff,0xff,0xff,0xff,
582 0x00,0x00,0x00,0x00 }},
583 /* /36 */ {{ 0xff,0xff,0xff,0xff,
586 0x00,0x00,0x00,0x00 }},
587 /* /37 */ {{ 0xff,0xff,0xff,0xff,
590 0x00,0x00,0x00,0x00 }},
591 /* /38 */ {{ 0xff,0xff,0xff,0xff,
594 0x00,0x00,0x00,0x00 }},
595 /* /39 */ {{ 0xff,0xff,0xff,0xff,
598 0x00,0x00,0x00,0x00 }},
599 /* /40 */ {{ 0xff,0xff,0xff,0xff,
602 0x00,0x00,0x00,0x00 }},
603 /* /41 */ {{ 0xff,0xff,0xff,0xff,
606 0x00,0x00,0x00,0x00 }},
607 /* /42 */ {{ 0xff,0xff,0xff,0xff,
610 0x00,0x00,0x00,0x00 }},
611 /* /43 */ {{ 0xff,0xff,0xff,0xff,
614 0x00,0x00,0x00,0x00 }},
615 /* /44 */ {{ 0xff,0xff,0xff,0xff,
618 0x00,0x00,0x00,0x00 }},
619 /* /45 */ {{ 0xff,0xff,0xff,0xff,
622 0x00,0x00,0x00,0x00 }},
623 /* /46 */ {{ 0xff,0xff,0xff,0xff,
626 0x00,0x00,0x00,0x00 }},
627 /* /47 */ {{ 0xff,0xff,0xff,0xff,
630 0x00,0x00,0x00,0x00 }},
631 /* /48 */ {{ 0xff,0xff,0xff,0xff,
634 0x00,0x00,0x00,0x00 }},
635 /* /49 */ {{ 0xff,0xff,0xff,0xff,
638 0x00,0x00,0x00,0x00 }},
639 /* /50 */ {{ 0xff,0xff,0xff,0xff,
642 0x00,0x00,0x00,0x00 }},
643 /* /51 */ {{ 0xff,0xff,0xff,0xff,
646 0x00,0x00,0x00,0x00 }},
647 /* /52 */ {{ 0xff,0xff,0xff,0xff,
650 0x00,0x00,0x00,0x00 }},
651 /* /53 */ {{ 0xff,0xff,0xff,0xff,
654 0x00,0x00,0x00,0x00 }},
655 /* /54 */ {{ 0xff,0xff,0xff,0xff,
658 0x00,0x00,0x00,0x00 }},
659 /* /55 */ {{ 0xff,0xff,0xff,0xff,
662 0x00,0x00,0x00,0x00 }},
663 /* /56 */ {{ 0xff,0xff,0xff,0xff,
666 0x00,0x00,0x00,0x00 }},
667 /* /57 */ {{ 0xff,0xff,0xff,0xff,
670 0x00,0x00,0x00,0x00 }},
671 /* /58 */ {{ 0xff,0xff,0xff,0xff,
674 0x00,0x00,0x00,0x00 }},
675 /* /59 */ {{ 0xff,0xff,0xff,0xff,
678 0x00,0x00,0x00,0x00 }},
679 /* /60 */ {{ 0xff,0xff,0xff,0xff,
682 0x00,0x00,0x00,0x00 }},
683 /* /61 */ {{ 0xff,0xff,0xff,0xff,
686 0x00,0x00,0x00,0x00 }},
687 /* /62 */ {{ 0xff,0xff,0xff,0xff,
690 0x00,0x00,0x00,0x00 }},
691 /* /63 */ {{ 0xff,0xff,0xff,0xff,
694 0x00,0x00,0x00,0x00 }},
695 /* /64 */ {{ 0xff,0xff,0xff,0xff,
698 0x00,0x00,0x00,0x00 }},
699 /* /65 */ {{ 0xff,0xff,0xff,0xff,
702 0x00,0x00,0x00,0x00 }},
703 /* /66 */ {{ 0xff,0xff,0xff,0xff,
706 0x00,0x00,0x00,0x00 }},
707 /* /67 */ {{ 0xff,0xff,0xff,0xff,
710 0x00,0x00,0x00,0x00 }},
711 /* /68 */ {{ 0xff,0xff,0xff,0xff,
714 0x00,0x00,0x00,0x00 }},
715 /* /69 */ {{ 0xff,0xff,0xff,0xff,
718 0x00,0x00,0x00,0x00 }},
719 /* /70 */ {{ 0xff,0xff,0xff,0xff,
722 0x00,0x00,0x00,0x00 }},
723 /* /71 */ {{ 0xff,0xff,0xff,0xff,
726 0x00,0x00,0x00,0x00 }},
727 /* /72 */ {{ 0xff,0xff,0xff,0xff,
730 0x00,0x00,0x00,0x00 }},
731 /* /73 */ {{ 0xff,0xff,0xff,0xff,
734 0x00,0x00,0x00,0x00 }},
735 /* /74 */ {{ 0xff,0xff,0xff,0xff,
738 0x00,0x00,0x00,0x00 }},
739 /* /75 */ {{ 0xff,0xff,0xff,0xff,
742 0x00,0x00,0x00,0x00 }},
743 /* /76 */ {{ 0xff,0xff,0xff,0xff,
746 0x00,0x00,0x00,0x00 }},
747 /* /77 */ {{ 0xff,0xff,0xff,0xff,
750 0x00,0x00,0x00,0x00 }},
751 /* /78 */ {{ 0xff,0xff,0xff,0xff,
754 0x00,0x00,0x00,0x00 }},
755 /* /79 */ {{ 0xff,0xff,0xff,0xff,
758 0x00,0x00,0x00,0x00 }},
759 /* /80 */ {{ 0xff,0xff,0xff,0xff,
762 0x00,0x00,0x00,0x00 }},
763 /* /81 */ {{ 0xff,0xff,0xff,0xff,
766 0x00,0x00,0x00,0x00 }},
767 /* /82 */ {{ 0xff,0xff,0xff,0xff,
770 0x00,0x00,0x00,0x00 }},
771 /* /83 */ {{ 0xff,0xff,0xff,0xff,
774 0x00,0x00,0x00,0x00 }},
775 /* /84 */ {{ 0xff,0xff,0xff,0xff,
778 0x00,0x00,0x00,0x00 }},
779 /* /85 */ {{ 0xff,0xff,0xff,0xff,
782 0x00,0x00,0x00,0x00 }},
783 /* /86 */ {{ 0xff,0xff,0xff,0xff,
786 0x00,0x00,0x00,0x00 }},
787 /* /87 */ {{ 0xff,0xff,0xff,0xff,
790 0x00,0x00,0x00,0x00 }},
791 /* /88 */ {{ 0xff,0xff,0xff,0xff,
794 0x00,0x00,0x00,0x00 }},
795 /* /89 */ {{ 0xff,0xff,0xff,0xff,
798 0x00,0x00,0x00,0x00 }},
799 /* /90 */ {{ 0xff,0xff,0xff,0xff,
802 0x00,0x00,0x00,0x00 }},
803 /* /91 */ {{ 0xff,0xff,0xff,0xff,
806 0x00,0x00,0x00,0x00 }},
807 /* /92 */ {{ 0xff,0xff,0xff,0xff,
810 0x00,0x00,0x00,0x00 }},
811 /* /93 */ {{ 0xff,0xff,0xff,0xff,
814 0x00,0x00,0x00,0x00 }},
815 /* /94 */ {{ 0xff,0xff,0xff,0xff,
818 0x00,0x00,0x00,0x00 }},
819 /* /95 */ {{ 0xff,0xff,0xff,0xff,
822 0x00,0x00,0x00,0x00 }},
823 /* /96 */ {{ 0xff,0xff,0xff,0xff,
826 0x00,0x00,0x00,0x00 }},
827 /* /97 */ {{ 0xff,0xff,0xff,0xff,
830 0x80,0x00,0x00,0x00 }},
831 /* /98 */ {{ 0xff,0xff,0xff,0xff,
834 0xc0,0x00,0x00,0x00 }},
835 /* /99 */ {{ 0xff,0xff,0xff,0xff,
838 0xe0,0x00,0x00,0x00 }},
839 /* /100 */ {{ 0xff,0xff,0xff,0xff,
842 0xf0,0x00,0x00,0x00 }},
843 /* /101 */ {{ 0xff,0xff,0xff,0xff,
846 0xf8,0x00,0x00,0x00 }},
847 /* /102 */ {{ 0xff,0xff,0xff,0xff,
850 0xfc,0x00,0x00,0x00 }},
851 /* /103 */ {{ 0xff,0xff,0xff,0xff,
854 0xfe,0x00,0x00,0x00 }},
855 /* /104 */ {{ 0xff,0xff,0xff,0xff,
858 0xff,0x00,0x00,0x00 }},
859 /* /105 */ {{ 0xff,0xff,0xff,0xff,
862 0xff,0x80,0x00,0x00 }},
863 /* /106 */ {{ 0xff,0xff,0xff,0xff,
866 0xff,0xc0,0x00,0x00 }},
867 /* /107 */ {{ 0xff,0xff,0xff,0xff,
870 0xff,0xe0,0x00,0x00 }},
871 /* /108 */ {{ 0xff,0xff,0xff,0xff,
874 0xff,0xf0,0x00,0x00 }},
875 /* /109 */ {{ 0xff,0xff,0xff,0xff,
878 0xff,0xf8,0x00,0x00 }},
879 /* /110 */ {{ 0xff,0xff,0xff,0xff,
882 0xff,0xfc,0x00,0x00 }},
883 /* /111 */ {{ 0xff,0xff,0xff,0xff,
886 0xff,0xfe,0x00,0x00 }},
887 /* /112 */ {{ 0xff,0xff,0xff,0xff,
890 0xff,0xff,0x00,0x00 }},
891 /* /113 */ {{ 0xff,0xff,0xff,0xff,
894 0xff,0xff,0x80,0x00 }},
895 /* /114 */ {{ 0xff,0xff,0xff,0xff,
898 0xff,0xff,0xc0,0x00 }},
899 /* /115 */ {{ 0xff,0xff,0xff,0xff,
902 0xff,0xff,0xe0,0x00 }},
903 /* /116 */ {{ 0xff,0xff,0xff,0xff,
906 0xff,0xff,0xf0,0x00 }},
907 /* /117 */ {{ 0xff,0xff,0xff,0xff,
910 0xff,0xff,0xf8,0x00 }},
911 /* /118 */ {{ 0xff,0xff,0xff,0xff,
914 0xff,0xff,0xfc,0x00 }},
915 /* /119 */ {{ 0xff,0xff,0xff,0xff,
918 0xff,0xff,0xfe,0x00 }},
919 /* /120 */ {{ 0xff,0xff,0xff,0xff,
922 0xff,0xff,0xff,0x00 }},
923 /* /121 */ {{ 0xff,0xff,0xff,0xff,
926 0xff,0xff,0xff,0x80 }},
927 /* /122 */ {{ 0xff,0xff,0xff,0xff,
930 0xff,0xff,0xff,0xc0 }},
931 /* /123 */ {{ 0xff,0xff,0xff,0xff,
934 0xff,0xff,0xff,0xe0 }},
935 /* /124 */ {{ 0xff,0xff,0xff,0xff,
938 0xff,0xff,0xff,0xf0 }},
939 /* /125 */ {{ 0xff,0xff,0xff,0xff,
942 0xff,0xff,0xff,0xf8 }},
943 /* /126 */ {{ 0xff,0xff,0xff,0xff,
946 0xff,0xff,0xff,0xfc }},
947 /* /127 */ {{ 0xff,0xff,0xff,0xff,
950 0xff,0xff,0xff,0xfe }},
951 /* /128 */ {{ 0xff,0xff,0xff,0xff,
954 0xff,0xff,0xff,0xff }},