2 * Copyright 2016 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_ = 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_(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] = 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 void IPAddressV6::setFromBinary(ByteRange bytes) {
140 if (bytes.size() != 16) {
141 throw IPAddressFormatException(to<std::string>(
142 "Invalid IPv6 binary data: length must ",
146 memcpy(&addr_.in6Addr_.s6_addr, bytes.data(), sizeof(in6_addr));
151 IPAddressV4 IPAddressV6::createIPv4() const {
152 if (!isIPv4Mapped()) {
153 throw IPAddressFormatException("addr is not v4-to-v6-mapped");
155 const unsigned char* by = bytes();
156 return IPAddressV4(detail::Bytes::mkAddress4(&by[12]));
159 // convert two uint8_t bytes into a uint16_t as hibyte.lobyte
160 static inline uint16_t unpack(uint8_t lobyte, uint8_t hibyte) {
161 return ((uint16_t)hibyte << 8) | (uint16_t)lobyte;
164 // given a src string, unpack count*2 bytes into dest
165 // dest must have as much storage as count
166 static inline void unpackInto(const unsigned char* src,
169 for (size_t i = 0, hi = 1, lo = 0; i < count; i++) {
170 dest[i] = unpack(src[hi], src[lo]);
177 IPAddressV4 IPAddressV6::getIPv4For6To4() const {
179 throw IPAddressV6::TypeError(format(
180 "Invalid IP '{}': not a 6to4 address", str()).str());
182 // convert 16x8 bytes into first 4x16 bytes
183 uint16_t ints[4] = {0,0,0,0};
184 unpackInto(bytes(), ints, 4);
187 unsigned char bytes[4];
190 ipv4.bytes[0] = (uint8_t)((ints[1] & 0xFF00) >> 8);
191 ipv4.bytes[1] = (uint8_t)(ints[1] & 0x00FF);
192 ipv4.bytes[2] = (uint8_t)((ints[2] & 0xFF00) >> 8);
193 ipv4.bytes[3] = (uint8_t)(ints[2] & 0x00FF);
194 return IPAddressV4(ipv4.addr);
198 bool IPAddressV6::isIPv4Mapped() const {
199 // v4 mapped addresses have their first 10 bytes set to 0, the next 2 bytes
200 // set to 255 (0xff);
201 const unsigned char* by = bytes();
203 // check if first 10 bytes are 0
204 for (int i = 0; i < 10; i++) {
209 // check if bytes 11 and 12 are 255
210 if (by[10] == 0xff && by[11] == 0xff) {
217 IPAddressV6::Type IPAddressV6::type() const {
218 // convert 16x8 bytes into first 2x16 bytes
219 uint16_t ints[2] = {0,0};
220 unpackInto(bytes(), ints, 2);
222 if ((((uint32_t)ints[0] << 16) | ints[1]) == IPAddressV6::PREFIX_TEREDO) {
226 if ((uint32_t)ints[0] == IPAddressV6::PREFIX_6TO4) {
234 string IPAddressV6::toJson() const {
236 "{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash()).str();
240 size_t IPAddressV6::hash() const {
241 if (isIPv4Mapped()) {
242 /* An IPAddress containing this object would be equal (i.e. operator==)
243 to an IPAddress containing the corresponding IPv4.
244 So we must make sure that the hash values are the same as well */
245 return IPAddress::createIPv4(*this).hash();
248 static const uint64_t seed = AF_INET6;
249 uint64_t hash1 = 0, hash2 = 0;
250 hash::SpookyHashV2::Hash128(&addr_, 16, &hash1, &hash2);
251 return hash::hash_combine(seed, hash1, hash2);
255 bool IPAddressV6::inSubnet(StringPiece cidrNetwork) const {
256 auto subnetInfo = IPAddress::createNetwork(cidrNetwork);
257 auto addr = subnetInfo.first;
259 throw IPAddressFormatException(to<std::string>(
260 "Address '", addr.toJson(), "' ", "is not a V6 address"));
262 return inSubnetWithMask(addr.asV6(), fetchMask(subnetInfo.second));
266 bool IPAddressV6::inSubnetWithMask(const IPAddressV6& subnet,
267 const ByteArray16& cidrMask) const {
268 const ByteArray16 mask = detail::Bytes::mask(toByteArray(), cidrMask);
269 const ByteArray16 subMask = detail::Bytes::mask(subnet.toByteArray(),
271 return (mask == subMask);
275 bool IPAddressV6::isLoopback() const {
276 // Check if v4 mapped is loopback
277 if (isIPv4Mapped() && createIPv4().isLoopback()) {
280 auto socka = toSockAddr();
281 return IN6_IS_ADDR_LOOPBACK(&socka.sin6_addr);
284 bool IPAddressV6::isRoutable() const {
286 // 2000::/3 is the only assigned global unicast block
287 inBinarySubnet({{0x20, 0x00}}, 3) ||
288 // ffxe::/16 are global scope multicast addresses,
289 // which are eligible to be routed over the internet
290 (isMulticast() && getMulticastScope() == 0xe);
293 bool IPAddressV6::isLinkLocalBroadcast() const {
294 static const IPAddressV6 kLinkLocalBroadcast("ff02::1");
295 return *this == kLinkLocalBroadcast;
299 bool IPAddressV6::isPrivate() const {
300 // Check if mapped is private
301 if (isIPv4Mapped() && createIPv4().isPrivate()) {
304 return isLoopback() || inBinarySubnet({{0xfc, 0x00}}, 7);
308 bool IPAddressV6::isLinkLocal() const {
309 return inBinarySubnet({{0xfe, 0x80}}, 10);
312 bool IPAddressV6::isMulticast() const {
313 return addr_.bytes_[0] == 0xff;
316 uint8_t IPAddressV6::getMulticastFlags() const {
317 DCHECK(isMulticast());
318 return ((addr_.bytes_[1] >> 4) & 0xf);
321 uint8_t IPAddressV6::getMulticastScope() const {
322 DCHECK(isMulticast());
323 return (addr_.bytes_[1] & 0xf);
326 IPAddressV6 IPAddressV6::getSolicitedNodeAddress() const {
327 // Solicted node addresses must be constructed from unicast (or anycast)
329 DCHECK(!isMulticast());
331 uint8_t bytes[16] = { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
332 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00 };
333 bytes[13] = addr_.bytes_[13];
334 bytes[14] = addr_.bytes_[14];
335 bytes[15] = addr_.bytes_[15];
336 return IPAddressV6::fromBinary(ByteRange(bytes, 16));
340 IPAddressV6 IPAddressV6::mask(size_t numBits) const {
341 static const auto bits = bitCount();
342 if (numBits > bits) {
343 throw IPAddressFormatException(
344 to<std::string>("numBits(", numBits, ") > bitCount(", bits, ")"));
346 ByteArray16 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
347 return IPAddressV6(ba);
351 string IPAddressV6::str() const {
352 char buffer[INET6_ADDRSTRLEN] = {0};
353 sockaddr_in6 sock = toSockAddr();
355 (sockaddr*)&sock, sizeof(sock),
356 buffer, INET6_ADDRSTRLEN,
357 nullptr, 0, NI_NUMERICHOST)) {
361 throw IPAddressFormatException(to<std::string>(
362 "Invalid address with hex ",
364 detail::Bytes::toHex(bytes(), 16),
370 string IPAddressV6::toFullyQualified() const {
371 return detail::fastIpv6ToString(addr_.in6Addr_);
375 uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
376 const auto highestIndex = byteCount() - 1;
377 if (byteIndex > highestIndex) {
378 throw std::invalid_argument(to<string>("Byte index must be <= ",
379 to<string>(highestIndex), " for addresses of type :",
380 detail::familyNameStr(AF_INET6)));
382 return bytes()[byteIndex];
386 const ByteArray16 IPAddressV6::fetchMask(size_t numBits) {
387 static const uint8_t bits = bitCount();
388 if (numBits > bits) {
389 throw IPAddressFormatException("IPv6 addresses are 128 bits.");
391 // masks_ is backed by an array so is zero indexed
392 return masks_[numBits];
396 CIDRNetworkV6 IPAddressV6::longestCommonPrefix(
397 const CIDRNetworkV6& one,
398 const CIDRNetworkV6& two) {
399 auto prefix = detail::Bytes::longestCommonPrefix(
400 one.first.addr_.bytes_, one.second, two.first.addr_.bytes_, two.second);
401 return {IPAddressV6(prefix.first), prefix.second};
405 bool IPAddressV6::inBinarySubnet(const std::array<uint8_t, 2> addr,
406 size_t numBits) const {
407 auto masked = mask(numBits);
408 return (std::memcmp(addr.data(), masked.bytes(), 2) == 0);
412 const std::array<ByteArray16, 129> IPAddressV6::masks_ = {{
413 /* /0 */ {{ 0x00,0x00,0x00,0x00,
416 0x00,0x00,0x00,0x00 }},
417 /* /1 */ {{ 0x80,0x00,0x00,0x00,
420 0x00,0x00,0x00,0x00 }},
421 /* /2 */ {{ 0xc0,0x00,0x00,0x00,
424 0x00,0x00,0x00,0x00 }},
425 /* /3 */ {{ 0xe0,0x00,0x00,0x00,
428 0x00,0x00,0x00,0x00 }},
429 /* /4 */ {{ 0xf0,0x00,0x00,0x00,
432 0x00,0x00,0x00,0x00 }},
433 /* /5 */ {{ 0xf8,0x00,0x00,0x00,
436 0x00,0x00,0x00,0x00 }},
437 /* /6 */ {{ 0xfc,0x00,0x00,0x00,
440 0x00,0x00,0x00,0x00 }},
441 /* /7 */ {{ 0xfe,0x00,0x00,0x00,
444 0x00,0x00,0x00,0x00 }},
445 /* /8 */ {{ 0xff,0x00,0x00,0x00,
448 0x00,0x00,0x00,0x00 }},
449 /* /9 */ {{ 0xff,0x80,0x00,0x00,
452 0x00,0x00,0x00,0x00 }},
453 /* /10 */ {{ 0xff,0xc0,0x00,0x00,
456 0x00,0x00,0x00,0x00 }},
457 /* /11 */ {{ 0xff,0xe0,0x00,0x00,
460 0x00,0x00,0x00,0x00 }},
461 /* /12 */ {{ 0xff,0xf0,0x00,0x00,
464 0x00,0x00,0x00,0x00 }},
465 /* /13 */ {{ 0xff,0xf8,0x00,0x00,
468 0x00,0x00,0x00,0x00 }},
469 /* /14 */ {{ 0xff,0xfc,0x00,0x00,
472 0x00,0x00,0x00,0x00 }},
473 /* /15 */ {{ 0xff,0xfe,0x00,0x00,
476 0x00,0x00,0x00,0x00 }},
477 /* /16 */ {{ 0xff,0xff,0x00,0x00,
480 0x00,0x00,0x00,0x00 }},
481 /* /17 */ {{ 0xff,0xff,0x80,0x00,
484 0x00,0x00,0x00,0x00 }},
485 /* /18 */ {{ 0xff,0xff,0xc0,0x00,
488 0x00,0x00,0x00,0x00 }},
489 /* /19 */ {{ 0xff,0xff,0xe0,0x00,
492 0x00,0x00,0x00,0x00 }},
493 /* /20 */ {{ 0xff,0xff,0xf0,0x00,
496 0x00,0x00,0x00,0x00 }},
497 /* /21 */ {{ 0xff,0xff,0xf8,0x00,
500 0x00,0x00,0x00,0x00 }},
501 /* /22 */ {{ 0xff,0xff,0xfc,0x00,
504 0x00,0x00,0x00,0x00 }},
505 /* /23 */ {{ 0xff,0xff,0xfe,0x00,
508 0x00,0x00,0x00,0x00 }},
509 /* /24 */ {{ 0xff,0xff,0xff,0x00,
512 0x00,0x00,0x00,0x00 }},
513 /* /25 */ {{ 0xff,0xff,0xff,0x80,
516 0x00,0x00,0x00,0x00 }},
517 /* /26 */ {{ 0xff,0xff,0xff,0xc0,
520 0x00,0x00,0x00,0x00 }},
521 /* /27 */ {{ 0xff,0xff,0xff,0xe0,
524 0x00,0x00,0x00,0x00 }},
525 /* /28 */ {{ 0xff,0xff,0xff,0xf0,
528 0x00,0x00,0x00,0x00 }},
529 /* /29 */ {{ 0xff,0xff,0xff,0xf8,
532 0x00,0x00,0x00,0x00 }},
533 /* /30 */ {{ 0xff,0xff,0xff,0xfc,
536 0x00,0x00,0x00,0x00 }},
537 /* /31 */ {{ 0xff,0xff,0xff,0xfe,
540 0x00,0x00,0x00,0x00 }},
541 /* /32 */ {{ 0xff,0xff,0xff,0xff,
544 0x00,0x00,0x00,0x00 }},
545 /* /33 */ {{ 0xff,0xff,0xff,0xff,
548 0x00,0x00,0x00,0x00 }},
549 /* /34 */ {{ 0xff,0xff,0xff,0xff,
552 0x00,0x00,0x00,0x00 }},
553 /* /35 */ {{ 0xff,0xff,0xff,0xff,
556 0x00,0x00,0x00,0x00 }},
557 /* /36 */ {{ 0xff,0xff,0xff,0xff,
560 0x00,0x00,0x00,0x00 }},
561 /* /37 */ {{ 0xff,0xff,0xff,0xff,
564 0x00,0x00,0x00,0x00 }},
565 /* /38 */ {{ 0xff,0xff,0xff,0xff,
568 0x00,0x00,0x00,0x00 }},
569 /* /39 */ {{ 0xff,0xff,0xff,0xff,
572 0x00,0x00,0x00,0x00 }},
573 /* /40 */ {{ 0xff,0xff,0xff,0xff,
576 0x00,0x00,0x00,0x00 }},
577 /* /41 */ {{ 0xff,0xff,0xff,0xff,
580 0x00,0x00,0x00,0x00 }},
581 /* /42 */ {{ 0xff,0xff,0xff,0xff,
584 0x00,0x00,0x00,0x00 }},
585 /* /43 */ {{ 0xff,0xff,0xff,0xff,
588 0x00,0x00,0x00,0x00 }},
589 /* /44 */ {{ 0xff,0xff,0xff,0xff,
592 0x00,0x00,0x00,0x00 }},
593 /* /45 */ {{ 0xff,0xff,0xff,0xff,
596 0x00,0x00,0x00,0x00 }},
597 /* /46 */ {{ 0xff,0xff,0xff,0xff,
600 0x00,0x00,0x00,0x00 }},
601 /* /47 */ {{ 0xff,0xff,0xff,0xff,
604 0x00,0x00,0x00,0x00 }},
605 /* /48 */ {{ 0xff,0xff,0xff,0xff,
608 0x00,0x00,0x00,0x00 }},
609 /* /49 */ {{ 0xff,0xff,0xff,0xff,
612 0x00,0x00,0x00,0x00 }},
613 /* /50 */ {{ 0xff,0xff,0xff,0xff,
616 0x00,0x00,0x00,0x00 }},
617 /* /51 */ {{ 0xff,0xff,0xff,0xff,
620 0x00,0x00,0x00,0x00 }},
621 /* /52 */ {{ 0xff,0xff,0xff,0xff,
624 0x00,0x00,0x00,0x00 }},
625 /* /53 */ {{ 0xff,0xff,0xff,0xff,
628 0x00,0x00,0x00,0x00 }},
629 /* /54 */ {{ 0xff,0xff,0xff,0xff,
632 0x00,0x00,0x00,0x00 }},
633 /* /55 */ {{ 0xff,0xff,0xff,0xff,
636 0x00,0x00,0x00,0x00 }},
637 /* /56 */ {{ 0xff,0xff,0xff,0xff,
640 0x00,0x00,0x00,0x00 }},
641 /* /57 */ {{ 0xff,0xff,0xff,0xff,
644 0x00,0x00,0x00,0x00 }},
645 /* /58 */ {{ 0xff,0xff,0xff,0xff,
648 0x00,0x00,0x00,0x00 }},
649 /* /59 */ {{ 0xff,0xff,0xff,0xff,
652 0x00,0x00,0x00,0x00 }},
653 /* /60 */ {{ 0xff,0xff,0xff,0xff,
656 0x00,0x00,0x00,0x00 }},
657 /* /61 */ {{ 0xff,0xff,0xff,0xff,
660 0x00,0x00,0x00,0x00 }},
661 /* /62 */ {{ 0xff,0xff,0xff,0xff,
664 0x00,0x00,0x00,0x00 }},
665 /* /63 */ {{ 0xff,0xff,0xff,0xff,
668 0x00,0x00,0x00,0x00 }},
669 /* /64 */ {{ 0xff,0xff,0xff,0xff,
672 0x00,0x00,0x00,0x00 }},
673 /* /65 */ {{ 0xff,0xff,0xff,0xff,
676 0x00,0x00,0x00,0x00 }},
677 /* /66 */ {{ 0xff,0xff,0xff,0xff,
680 0x00,0x00,0x00,0x00 }},
681 /* /67 */ {{ 0xff,0xff,0xff,0xff,
684 0x00,0x00,0x00,0x00 }},
685 /* /68 */ {{ 0xff,0xff,0xff,0xff,
688 0x00,0x00,0x00,0x00 }},
689 /* /69 */ {{ 0xff,0xff,0xff,0xff,
692 0x00,0x00,0x00,0x00 }},
693 /* /70 */ {{ 0xff,0xff,0xff,0xff,
696 0x00,0x00,0x00,0x00 }},
697 /* /71 */ {{ 0xff,0xff,0xff,0xff,
700 0x00,0x00,0x00,0x00 }},
701 /* /72 */ {{ 0xff,0xff,0xff,0xff,
704 0x00,0x00,0x00,0x00 }},
705 /* /73 */ {{ 0xff,0xff,0xff,0xff,
708 0x00,0x00,0x00,0x00 }},
709 /* /74 */ {{ 0xff,0xff,0xff,0xff,
712 0x00,0x00,0x00,0x00 }},
713 /* /75 */ {{ 0xff,0xff,0xff,0xff,
716 0x00,0x00,0x00,0x00 }},
717 /* /76 */ {{ 0xff,0xff,0xff,0xff,
720 0x00,0x00,0x00,0x00 }},
721 /* /77 */ {{ 0xff,0xff,0xff,0xff,
724 0x00,0x00,0x00,0x00 }},
725 /* /78 */ {{ 0xff,0xff,0xff,0xff,
728 0x00,0x00,0x00,0x00 }},
729 /* /79 */ {{ 0xff,0xff,0xff,0xff,
732 0x00,0x00,0x00,0x00 }},
733 /* /80 */ {{ 0xff,0xff,0xff,0xff,
736 0x00,0x00,0x00,0x00 }},
737 /* /81 */ {{ 0xff,0xff,0xff,0xff,
740 0x00,0x00,0x00,0x00 }},
741 /* /82 */ {{ 0xff,0xff,0xff,0xff,
744 0x00,0x00,0x00,0x00 }},
745 /* /83 */ {{ 0xff,0xff,0xff,0xff,
748 0x00,0x00,0x00,0x00 }},
749 /* /84 */ {{ 0xff,0xff,0xff,0xff,
752 0x00,0x00,0x00,0x00 }},
753 /* /85 */ {{ 0xff,0xff,0xff,0xff,
756 0x00,0x00,0x00,0x00 }},
757 /* /86 */ {{ 0xff,0xff,0xff,0xff,
760 0x00,0x00,0x00,0x00 }},
761 /* /87 */ {{ 0xff,0xff,0xff,0xff,
764 0x00,0x00,0x00,0x00 }},
765 /* /88 */ {{ 0xff,0xff,0xff,0xff,
768 0x00,0x00,0x00,0x00 }},
769 /* /89 */ {{ 0xff,0xff,0xff,0xff,
772 0x00,0x00,0x00,0x00 }},
773 /* /90 */ {{ 0xff,0xff,0xff,0xff,
776 0x00,0x00,0x00,0x00 }},
777 /* /91 */ {{ 0xff,0xff,0xff,0xff,
780 0x00,0x00,0x00,0x00 }},
781 /* /92 */ {{ 0xff,0xff,0xff,0xff,
784 0x00,0x00,0x00,0x00 }},
785 /* /93 */ {{ 0xff,0xff,0xff,0xff,
788 0x00,0x00,0x00,0x00 }},
789 /* /94 */ {{ 0xff,0xff,0xff,0xff,
792 0x00,0x00,0x00,0x00 }},
793 /* /95 */ {{ 0xff,0xff,0xff,0xff,
796 0x00,0x00,0x00,0x00 }},
797 /* /96 */ {{ 0xff,0xff,0xff,0xff,
800 0x00,0x00,0x00,0x00 }},
801 /* /97 */ {{ 0xff,0xff,0xff,0xff,
804 0x80,0x00,0x00,0x00 }},
805 /* /98 */ {{ 0xff,0xff,0xff,0xff,
808 0xc0,0x00,0x00,0x00 }},
809 /* /99 */ {{ 0xff,0xff,0xff,0xff,
812 0xe0,0x00,0x00,0x00 }},
813 /* /100 */ {{ 0xff,0xff,0xff,0xff,
816 0xf0,0x00,0x00,0x00 }},
817 /* /101 */ {{ 0xff,0xff,0xff,0xff,
820 0xf8,0x00,0x00,0x00 }},
821 /* /102 */ {{ 0xff,0xff,0xff,0xff,
824 0xfc,0x00,0x00,0x00 }},
825 /* /103 */ {{ 0xff,0xff,0xff,0xff,
828 0xfe,0x00,0x00,0x00 }},
829 /* /104 */ {{ 0xff,0xff,0xff,0xff,
832 0xff,0x00,0x00,0x00 }},
833 /* /105 */ {{ 0xff,0xff,0xff,0xff,
836 0xff,0x80,0x00,0x00 }},
837 /* /106 */ {{ 0xff,0xff,0xff,0xff,
840 0xff,0xc0,0x00,0x00 }},
841 /* /107 */ {{ 0xff,0xff,0xff,0xff,
844 0xff,0xe0,0x00,0x00 }},
845 /* /108 */ {{ 0xff,0xff,0xff,0xff,
848 0xff,0xf0,0x00,0x00 }},
849 /* /109 */ {{ 0xff,0xff,0xff,0xff,
852 0xff,0xf8,0x00,0x00 }},
853 /* /110 */ {{ 0xff,0xff,0xff,0xff,
856 0xff,0xfc,0x00,0x00 }},
857 /* /111 */ {{ 0xff,0xff,0xff,0xff,
860 0xff,0xfe,0x00,0x00 }},
861 /* /112 */ {{ 0xff,0xff,0xff,0xff,
864 0xff,0xff,0x00,0x00 }},
865 /* /113 */ {{ 0xff,0xff,0xff,0xff,
868 0xff,0xff,0x80,0x00 }},
869 /* /114 */ {{ 0xff,0xff,0xff,0xff,
872 0xff,0xff,0xc0,0x00 }},
873 /* /115 */ {{ 0xff,0xff,0xff,0xff,
876 0xff,0xff,0xe0,0x00 }},
877 /* /116 */ {{ 0xff,0xff,0xff,0xff,
880 0xff,0xff,0xf0,0x00 }},
881 /* /117 */ {{ 0xff,0xff,0xff,0xff,
884 0xff,0xff,0xf8,0x00 }},
885 /* /118 */ {{ 0xff,0xff,0xff,0xff,
888 0xff,0xff,0xfc,0x00 }},
889 /* /119 */ {{ 0xff,0xff,0xff,0xff,
892 0xff,0xff,0xfe,0x00 }},
893 /* /120 */ {{ 0xff,0xff,0xff,0xff,
896 0xff,0xff,0xff,0x00 }},
897 /* /121 */ {{ 0xff,0xff,0xff,0xff,
900 0xff,0xff,0xff,0x80 }},
901 /* /122 */ {{ 0xff,0xff,0xff,0xff,
904 0xff,0xff,0xff,0xc0 }},
905 /* /123 */ {{ 0xff,0xff,0xff,0xff,
908 0xff,0xff,0xff,0xe0 }},
909 /* /124 */ {{ 0xff,0xff,0xff,0xff,
912 0xff,0xff,0xff,0xf0 }},
913 /* /125 */ {{ 0xff,0xff,0xff,0xff,
916 0xff,0xff,0xff,0xf8 }},
917 /* /126 */ {{ 0xff,0xff,0xff,0xff,
920 0xff,0xff,0xff,0xfc }},
921 /* /127 */ {{ 0xff,0xff,0xff,0xff,
924 0xff,0xff,0xff,0xfe }},
925 /* /128 */ {{ 0xff,0xff,0xff,0xff,
928 0xff,0xff,0xff,0xff }},