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>
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 bool IPAddressV6::validate(StringPiece ip) {
52 if (ip.size() > 0 && ip.front() == '[' && ip.back() == ']') {
53 ip = ip.subpiece(1, ip.size() - 2);
56 constexpr size_t kStrMaxLen = INET6_ADDRSTRLEN;
57 std::array<char, kStrMaxLen + 1> ip_cstr;
58 const size_t len = std::min(ip.size(), kStrMaxLen);
59 std::memcpy(ip_cstr.data(), ip.data(), len);
62 return 1 == inet_pton(AF_INET6, ip_cstr.data(), &addr);
65 // public default constructor
66 IPAddressV6::IPAddressV6() {
69 // public string constructor
70 IPAddressV6::IPAddressV6(StringPiece addr) {
73 // Allow addresses surrounded in brackets
75 throw IPAddressFormatException("Invalid IPv6 address '", ip,
76 "': address too short");
78 if (ip.front() == '[' && ip.back() == ']') {
79 ip = ip.substr(1, ip.size() - 2);
82 struct addrinfo* result;
83 struct addrinfo hints;
84 memset(&hints, 0, sizeof(hints));
85 hints.ai_family = AF_INET6;
86 hints.ai_socktype = SOCK_STREAM;
87 hints.ai_flags = AI_NUMERICHOST;
88 if (!getaddrinfo(ip.c_str(), nullptr, &hints, &result)) {
89 struct sockaddr_in6* ipAddr = (struct sockaddr_in6*)result->ai_addr;
90 addr_.in6Addr_ = ipAddr->sin6_addr;
91 scope_ = ipAddr->sin6_scope_id;
94 throw IPAddressFormatException("Invalid IPv6 address '", ip, "'");
98 // in6_addr constructor
99 IPAddressV6::IPAddressV6(const in6_addr& src)
104 // sockaddr_in6 constructor
105 IPAddressV6::IPAddressV6(const sockaddr_in6& src)
106 : addr_(src.sin6_addr)
107 , scope_(src.sin6_scope_id)
111 // ByteArray16 constructor
112 IPAddressV6::IPAddressV6(const ByteArray16& src)
117 // link-local constructor
118 IPAddressV6::IPAddressV6(LinkLocalTag, MacAddress mac)
122 IPAddressV6::AddressStorage::AddressStorage(MacAddress mac) {
123 // The link-local address uses modified EUI-64 format,
124 // See RFC 4291 sections 2.5.1, 2.5.6, and Appendix A
125 const auto* macBytes = mac.bytes();
126 memcpy(&bytes_.front(), "\xfe\x80\x00\x00\x00\x00\x00\x00", 8);
127 bytes_[8] = macBytes[0] ^ 0x02;
128 bytes_[9] = macBytes[1];
129 bytes_[10] = macBytes[2];
132 bytes_[13] = macBytes[3];
133 bytes_[14] = macBytes[4];
134 bytes_[15] = macBytes[5];
137 void IPAddressV6::setFromBinary(ByteRange bytes) {
138 if (bytes.size() != 16) {
139 throw IPAddressFormatException("Invalid IPv6 binary data: length must "
140 "be 16 bytes, got ", bytes.size());
142 memcpy(&addr_.in6Addr_.s6_addr, bytes.data(), sizeof(in6_addr));
147 IPAddressV4 IPAddressV6::createIPv4() const {
148 if (!isIPv4Mapped()) {
149 throw IPAddressFormatException("addr is not v4-to-v6-mapped");
151 const unsigned char* by = bytes();
152 return IPAddressV4(detail::Bytes::mkAddress4(&by[12]));
155 // convert two uint8_t bytes into a uint16_t as hibyte.lobyte
156 static inline uint16_t unpack(uint8_t lobyte, uint8_t hibyte) {
157 return ((uint16_t)hibyte << 8) | (uint16_t)lobyte;
160 // given a src string, unpack count*2 bytes into dest
161 // dest must have as much storage as count
162 static inline void unpackInto(const unsigned char* src,
165 for (size_t i = 0, hi = 1, lo = 0; i < count; i++) {
166 dest[i] = unpack(src[hi], src[lo]);
173 IPAddressV4 IPAddressV6::getIPv4For6To4() const {
175 throw IPAddressV6::TypeError(format(
176 "Invalid IP '{}': not a 6to4 address", str()).str());
178 // convert 16x8 bytes into first 4x16 bytes
179 uint16_t ints[4] = {0,0,0,0};
180 unpackInto(bytes(), ints, 4);
183 unsigned char bytes[4];
186 ipv4.bytes[0] = (uint8_t)((ints[1] & 0xFF00) >> 8);
187 ipv4.bytes[1] = (uint8_t)(ints[1] & 0x00FF);
188 ipv4.bytes[2] = (uint8_t)((ints[2] & 0xFF00) >> 8);
189 ipv4.bytes[3] = (uint8_t)(ints[2] & 0x00FF);
190 return IPAddressV4(ipv4.addr);
194 bool IPAddressV6::isIPv4Mapped() const {
195 // v4 mapped addresses have their first 10 bytes set to 0, the next 2 bytes
196 // set to 255 (0xff);
197 const unsigned char* by = bytes();
199 // check if first 10 bytes are 0
200 for (int i = 0; i < 10; i++) {
205 // check if bytes 11 and 12 are 255
206 if (by[10] == 0xff && by[11] == 0xff) {
213 IPAddressV6::Type IPAddressV6::type() const {
214 // convert 16x8 bytes into first 2x16 bytes
215 uint16_t ints[2] = {0,0};
216 unpackInto(bytes(), ints, 2);
218 if ((((uint32_t)ints[0] << 16) | ints[1]) == IPAddressV6::PREFIX_TEREDO) {
222 if ((uint32_t)ints[0] == IPAddressV6::PREFIX_6TO4) {
230 string IPAddressV6::toJson() const {
232 "{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash()).str();
236 size_t IPAddressV6::hash() const {
237 if (isIPv4Mapped()) {
238 /* An IPAddress containing this object would be equal (i.e. operator==)
239 to an IPAddress containing the corresponding IPv4.
240 So we must make sure that the hash values are the same as well */
241 return IPAddress::createIPv4(*this).hash();
244 static const uint64_t seed = AF_INET6;
245 uint64_t hash1 = 0, hash2 = 0;
246 hash::SpookyHashV2::Hash128(&addr_, 16, &hash1, &hash2);
247 return hash::hash_combine(seed, hash1, hash2);
251 bool IPAddressV6::inSubnet(StringPiece cidrNetwork) const {
252 auto subnetInfo = IPAddress::createNetwork(cidrNetwork);
253 auto addr = subnetInfo.first;
255 throw IPAddressFormatException("Address '", addr.toJson(), "' ",
256 "is not a V6 address");
258 return inSubnetWithMask(addr.asV6(), fetchMask(subnetInfo.second));
262 bool IPAddressV6::inSubnetWithMask(const IPAddressV6& subnet,
263 const ByteArray16& cidrMask) const {
264 const ByteArray16 mask = detail::Bytes::mask(toByteArray(), cidrMask);
265 const ByteArray16 subMask = detail::Bytes::mask(subnet.toByteArray(),
267 return (mask == subMask);
271 bool IPAddressV6::isLoopback() const {
272 // Check if v4 mapped is loopback
273 if (isIPv4Mapped() && createIPv4().isLoopback()) {
276 auto socka = toSockAddr();
277 return IN6_IS_ADDR_LOOPBACK(&socka.sin6_addr);
280 bool IPAddressV6::isRoutable() const {
282 // 2000::/3 is the only assigned global unicast block
283 inBinarySubnet({{0x20, 0x00}}, 3) ||
284 // ffxe::/16 are global scope multicast addresses,
285 // which are eligible to be routed over the internet
286 (isMulticast() && getMulticastScope() == 0xe);
289 bool IPAddressV6::isLinkLocalBroadcast() const {
290 static const IPAddressV6 kLinkLocalBroadcast("ff02::1");
291 return *this == kLinkLocalBroadcast;
295 bool IPAddressV6::isPrivate() const {
296 // Check if mapped is private
297 if (isIPv4Mapped() && createIPv4().isPrivate()) {
300 return isLoopback() || inBinarySubnet({{0xfc, 0x00}}, 7);
304 bool IPAddressV6::isLinkLocal() const {
305 return inBinarySubnet({{0xfe, 0x80}}, 10);
308 bool IPAddressV6::isMulticast() const {
309 return addr_.bytes_[0] == 0xff;
312 uint8_t IPAddressV6::getMulticastFlags() const {
313 DCHECK(isMulticast());
314 return ((addr_.bytes_[1] >> 4) & 0xf);
317 uint8_t IPAddressV6::getMulticastScope() const {
318 DCHECK(isMulticast());
319 return (addr_.bytes_[1] & 0xf);
322 IPAddressV6 IPAddressV6::getSolicitedNodeAddress() const {
323 // Solicted node addresses must be constructed from unicast (or anycast)
325 DCHECK(!isMulticast());
327 uint8_t bytes[16] = { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
328 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00 };
329 bytes[13] = addr_.bytes_[13];
330 bytes[14] = addr_.bytes_[14];
331 bytes[15] = addr_.bytes_[15];
332 return IPAddressV6::fromBinary(ByteRange(bytes, 16));
336 IPAddressV6 IPAddressV6::mask(size_t numBits) const {
337 static const auto bits = bitCount();
338 if (numBits > bits) {
339 throw IPAddressFormatException("numBits(", numBits, ") > bitCount(",
342 ByteArray16 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
343 return IPAddressV6(ba);
347 string IPAddressV6::str() const {
348 char buffer[INET6_ADDRSTRLEN] = {0};
349 sockaddr_in6 sock = toSockAddr();
351 (sockaddr*)&sock, sizeof(sock),
352 buffer, INET6_ADDRSTRLEN,
353 nullptr, 0, NI_NUMERICHOST)) {
357 throw IPAddressFormatException("Invalid address with hex ",
358 "'", detail::Bytes::toHex(bytes(), 16), "'");
363 string IPAddressV6::toFullyQualified() const {
364 return detail::fastIpv6ToString(addr_.in6Addr_);
368 uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
369 const auto highestIndex = byteCount() - 1;
370 if (byteIndex > highestIndex) {
371 throw std::invalid_argument(to<string>("Byte index must be <= ",
372 to<string>(highestIndex), " for addresses of type :",
373 detail::familyNameStr(AF_INET6)));
375 return bytes()[byteIndex];
379 const ByteArray16 IPAddressV6::fetchMask(size_t numBits) {
380 static const uint8_t bits = bitCount();
381 if (numBits > bits) {
382 throw IPAddressFormatException("IPv6 addresses are 128 bits.");
384 // masks_ is backed by an array so is zero indexed
385 return masks_[numBits];
389 bool IPAddressV6::inBinarySubnet(const std::array<uint8_t, 2> addr,
390 size_t numBits) const {
391 auto masked = mask(numBits);
392 return (std::memcmp(addr.data(), masked.bytes(), 2) == 0);
396 const std::array<ByteArray16, 129> IPAddressV6::masks_ = {{
397 /* /0 */ {{ 0x00,0x00,0x00,0x00,
400 0x00,0x00,0x00,0x00 }},
401 /* /1 */ {{ 0x80,0x00,0x00,0x00,
404 0x00,0x00,0x00,0x00 }},
405 /* /2 */ {{ 0xc0,0x00,0x00,0x00,
408 0x00,0x00,0x00,0x00 }},
409 /* /3 */ {{ 0xe0,0x00,0x00,0x00,
412 0x00,0x00,0x00,0x00 }},
413 /* /4 */ {{ 0xf0,0x00,0x00,0x00,
416 0x00,0x00,0x00,0x00 }},
417 /* /5 */ {{ 0xf8,0x00,0x00,0x00,
420 0x00,0x00,0x00,0x00 }},
421 /* /6 */ {{ 0xfc,0x00,0x00,0x00,
424 0x00,0x00,0x00,0x00 }},
425 /* /7 */ {{ 0xfe,0x00,0x00,0x00,
428 0x00,0x00,0x00,0x00 }},
429 /* /8 */ {{ 0xff,0x00,0x00,0x00,
432 0x00,0x00,0x00,0x00 }},
433 /* /9 */ {{ 0xff,0x80,0x00,0x00,
436 0x00,0x00,0x00,0x00 }},
437 /* /10 */ {{ 0xff,0xc0,0x00,0x00,
440 0x00,0x00,0x00,0x00 }},
441 /* /11 */ {{ 0xff,0xe0,0x00,0x00,
444 0x00,0x00,0x00,0x00 }},
445 /* /12 */ {{ 0xff,0xf0,0x00,0x00,
448 0x00,0x00,0x00,0x00 }},
449 /* /13 */ {{ 0xff,0xf8,0x00,0x00,
452 0x00,0x00,0x00,0x00 }},
453 /* /14 */ {{ 0xff,0xfc,0x00,0x00,
456 0x00,0x00,0x00,0x00 }},
457 /* /15 */ {{ 0xff,0xfe,0x00,0x00,
460 0x00,0x00,0x00,0x00 }},
461 /* /16 */ {{ 0xff,0xff,0x00,0x00,
464 0x00,0x00,0x00,0x00 }},
465 /* /17 */ {{ 0xff,0xff,0x80,0x00,
468 0x00,0x00,0x00,0x00 }},
469 /* /18 */ {{ 0xff,0xff,0xc0,0x00,
472 0x00,0x00,0x00,0x00 }},
473 /* /19 */ {{ 0xff,0xff,0xe0,0x00,
476 0x00,0x00,0x00,0x00 }},
477 /* /20 */ {{ 0xff,0xff,0xf0,0x00,
480 0x00,0x00,0x00,0x00 }},
481 /* /21 */ {{ 0xff,0xff,0xf8,0x00,
484 0x00,0x00,0x00,0x00 }},
485 /* /22 */ {{ 0xff,0xff,0xfc,0x00,
488 0x00,0x00,0x00,0x00 }},
489 /* /23 */ {{ 0xff,0xff,0xfe,0x00,
492 0x00,0x00,0x00,0x00 }},
493 /* /24 */ {{ 0xff,0xff,0xff,0x00,
496 0x00,0x00,0x00,0x00 }},
497 /* /25 */ {{ 0xff,0xff,0xff,0x80,
500 0x00,0x00,0x00,0x00 }},
501 /* /26 */ {{ 0xff,0xff,0xff,0xc0,
504 0x00,0x00,0x00,0x00 }},
505 /* /27 */ {{ 0xff,0xff,0xff,0xe0,
508 0x00,0x00,0x00,0x00 }},
509 /* /28 */ {{ 0xff,0xff,0xff,0xf0,
512 0x00,0x00,0x00,0x00 }},
513 /* /29 */ {{ 0xff,0xff,0xff,0xf8,
516 0x00,0x00,0x00,0x00 }},
517 /* /30 */ {{ 0xff,0xff,0xff,0xfc,
520 0x00,0x00,0x00,0x00 }},
521 /* /31 */ {{ 0xff,0xff,0xff,0xfe,
524 0x00,0x00,0x00,0x00 }},
525 /* /32 */ {{ 0xff,0xff,0xff,0xff,
528 0x00,0x00,0x00,0x00 }},
529 /* /33 */ {{ 0xff,0xff,0xff,0xff,
532 0x00,0x00,0x00,0x00 }},
533 /* /34 */ {{ 0xff,0xff,0xff,0xff,
536 0x00,0x00,0x00,0x00 }},
537 /* /35 */ {{ 0xff,0xff,0xff,0xff,
540 0x00,0x00,0x00,0x00 }},
541 /* /36 */ {{ 0xff,0xff,0xff,0xff,
544 0x00,0x00,0x00,0x00 }},
545 /* /37 */ {{ 0xff,0xff,0xff,0xff,
548 0x00,0x00,0x00,0x00 }},
549 /* /38 */ {{ 0xff,0xff,0xff,0xff,
552 0x00,0x00,0x00,0x00 }},
553 /* /39 */ {{ 0xff,0xff,0xff,0xff,
556 0x00,0x00,0x00,0x00 }},
557 /* /40 */ {{ 0xff,0xff,0xff,0xff,
560 0x00,0x00,0x00,0x00 }},
561 /* /41 */ {{ 0xff,0xff,0xff,0xff,
564 0x00,0x00,0x00,0x00 }},
565 /* /42 */ {{ 0xff,0xff,0xff,0xff,
568 0x00,0x00,0x00,0x00 }},
569 /* /43 */ {{ 0xff,0xff,0xff,0xff,
572 0x00,0x00,0x00,0x00 }},
573 /* /44 */ {{ 0xff,0xff,0xff,0xff,
576 0x00,0x00,0x00,0x00 }},
577 /* /45 */ {{ 0xff,0xff,0xff,0xff,
580 0x00,0x00,0x00,0x00 }},
581 /* /46 */ {{ 0xff,0xff,0xff,0xff,
584 0x00,0x00,0x00,0x00 }},
585 /* /47 */ {{ 0xff,0xff,0xff,0xff,
588 0x00,0x00,0x00,0x00 }},
589 /* /48 */ {{ 0xff,0xff,0xff,0xff,
592 0x00,0x00,0x00,0x00 }},
593 /* /49 */ {{ 0xff,0xff,0xff,0xff,
596 0x00,0x00,0x00,0x00 }},
597 /* /50 */ {{ 0xff,0xff,0xff,0xff,
600 0x00,0x00,0x00,0x00 }},
601 /* /51 */ {{ 0xff,0xff,0xff,0xff,
604 0x00,0x00,0x00,0x00 }},
605 /* /52 */ {{ 0xff,0xff,0xff,0xff,
608 0x00,0x00,0x00,0x00 }},
609 /* /53 */ {{ 0xff,0xff,0xff,0xff,
612 0x00,0x00,0x00,0x00 }},
613 /* /54 */ {{ 0xff,0xff,0xff,0xff,
616 0x00,0x00,0x00,0x00 }},
617 /* /55 */ {{ 0xff,0xff,0xff,0xff,
620 0x00,0x00,0x00,0x00 }},
621 /* /56 */ {{ 0xff,0xff,0xff,0xff,
624 0x00,0x00,0x00,0x00 }},
625 /* /57 */ {{ 0xff,0xff,0xff,0xff,
628 0x00,0x00,0x00,0x00 }},
629 /* /58 */ {{ 0xff,0xff,0xff,0xff,
632 0x00,0x00,0x00,0x00 }},
633 /* /59 */ {{ 0xff,0xff,0xff,0xff,
636 0x00,0x00,0x00,0x00 }},
637 /* /60 */ {{ 0xff,0xff,0xff,0xff,
640 0x00,0x00,0x00,0x00 }},
641 /* /61 */ {{ 0xff,0xff,0xff,0xff,
644 0x00,0x00,0x00,0x00 }},
645 /* /62 */ {{ 0xff,0xff,0xff,0xff,
648 0x00,0x00,0x00,0x00 }},
649 /* /63 */ {{ 0xff,0xff,0xff,0xff,
652 0x00,0x00,0x00,0x00 }},
653 /* /64 */ {{ 0xff,0xff,0xff,0xff,
656 0x00,0x00,0x00,0x00 }},
657 /* /65 */ {{ 0xff,0xff,0xff,0xff,
660 0x00,0x00,0x00,0x00 }},
661 /* /66 */ {{ 0xff,0xff,0xff,0xff,
664 0x00,0x00,0x00,0x00 }},
665 /* /67 */ {{ 0xff,0xff,0xff,0xff,
668 0x00,0x00,0x00,0x00 }},
669 /* /68 */ {{ 0xff,0xff,0xff,0xff,
672 0x00,0x00,0x00,0x00 }},
673 /* /69 */ {{ 0xff,0xff,0xff,0xff,
676 0x00,0x00,0x00,0x00 }},
677 /* /70 */ {{ 0xff,0xff,0xff,0xff,
680 0x00,0x00,0x00,0x00 }},
681 /* /71 */ {{ 0xff,0xff,0xff,0xff,
684 0x00,0x00,0x00,0x00 }},
685 /* /72 */ {{ 0xff,0xff,0xff,0xff,
688 0x00,0x00,0x00,0x00 }},
689 /* /73 */ {{ 0xff,0xff,0xff,0xff,
692 0x00,0x00,0x00,0x00 }},
693 /* /74 */ {{ 0xff,0xff,0xff,0xff,
696 0x00,0x00,0x00,0x00 }},
697 /* /75 */ {{ 0xff,0xff,0xff,0xff,
700 0x00,0x00,0x00,0x00 }},
701 /* /76 */ {{ 0xff,0xff,0xff,0xff,
704 0x00,0x00,0x00,0x00 }},
705 /* /77 */ {{ 0xff,0xff,0xff,0xff,
708 0x00,0x00,0x00,0x00 }},
709 /* /78 */ {{ 0xff,0xff,0xff,0xff,
712 0x00,0x00,0x00,0x00 }},
713 /* /79 */ {{ 0xff,0xff,0xff,0xff,
716 0x00,0x00,0x00,0x00 }},
717 /* /80 */ {{ 0xff,0xff,0xff,0xff,
720 0x00,0x00,0x00,0x00 }},
721 /* /81 */ {{ 0xff,0xff,0xff,0xff,
724 0x00,0x00,0x00,0x00 }},
725 /* /82 */ {{ 0xff,0xff,0xff,0xff,
728 0x00,0x00,0x00,0x00 }},
729 /* /83 */ {{ 0xff,0xff,0xff,0xff,
732 0x00,0x00,0x00,0x00 }},
733 /* /84 */ {{ 0xff,0xff,0xff,0xff,
736 0x00,0x00,0x00,0x00 }},
737 /* /85 */ {{ 0xff,0xff,0xff,0xff,
740 0x00,0x00,0x00,0x00 }},
741 /* /86 */ {{ 0xff,0xff,0xff,0xff,
744 0x00,0x00,0x00,0x00 }},
745 /* /87 */ {{ 0xff,0xff,0xff,0xff,
748 0x00,0x00,0x00,0x00 }},
749 /* /88 */ {{ 0xff,0xff,0xff,0xff,
752 0x00,0x00,0x00,0x00 }},
753 /* /89 */ {{ 0xff,0xff,0xff,0xff,
756 0x00,0x00,0x00,0x00 }},
757 /* /90 */ {{ 0xff,0xff,0xff,0xff,
760 0x00,0x00,0x00,0x00 }},
761 /* /91 */ {{ 0xff,0xff,0xff,0xff,
764 0x00,0x00,0x00,0x00 }},
765 /* /92 */ {{ 0xff,0xff,0xff,0xff,
768 0x00,0x00,0x00,0x00 }},
769 /* /93 */ {{ 0xff,0xff,0xff,0xff,
772 0x00,0x00,0x00,0x00 }},
773 /* /94 */ {{ 0xff,0xff,0xff,0xff,
776 0x00,0x00,0x00,0x00 }},
777 /* /95 */ {{ 0xff,0xff,0xff,0xff,
780 0x00,0x00,0x00,0x00 }},
781 /* /96 */ {{ 0xff,0xff,0xff,0xff,
784 0x00,0x00,0x00,0x00 }},
785 /* /97 */ {{ 0xff,0xff,0xff,0xff,
788 0x80,0x00,0x00,0x00 }},
789 /* /98 */ {{ 0xff,0xff,0xff,0xff,
792 0xc0,0x00,0x00,0x00 }},
793 /* /99 */ {{ 0xff,0xff,0xff,0xff,
796 0xe0,0x00,0x00,0x00 }},
797 /* /100 */ {{ 0xff,0xff,0xff,0xff,
800 0xf0,0x00,0x00,0x00 }},
801 /* /101 */ {{ 0xff,0xff,0xff,0xff,
804 0xf8,0x00,0x00,0x00 }},
805 /* /102 */ {{ 0xff,0xff,0xff,0xff,
808 0xfc,0x00,0x00,0x00 }},
809 /* /103 */ {{ 0xff,0xff,0xff,0xff,
812 0xfe,0x00,0x00,0x00 }},
813 /* /104 */ {{ 0xff,0xff,0xff,0xff,
816 0xff,0x00,0x00,0x00 }},
817 /* /105 */ {{ 0xff,0xff,0xff,0xff,
820 0xff,0x80,0x00,0x00 }},
821 /* /106 */ {{ 0xff,0xff,0xff,0xff,
824 0xff,0xc0,0x00,0x00 }},
825 /* /107 */ {{ 0xff,0xff,0xff,0xff,
828 0xff,0xe0,0x00,0x00 }},
829 /* /108 */ {{ 0xff,0xff,0xff,0xff,
832 0xff,0xf0,0x00,0x00 }},
833 /* /109 */ {{ 0xff,0xff,0xff,0xff,
836 0xff,0xf8,0x00,0x00 }},
837 /* /110 */ {{ 0xff,0xff,0xff,0xff,
840 0xff,0xfc,0x00,0x00 }},
841 /* /111 */ {{ 0xff,0xff,0xff,0xff,
844 0xff,0xfe,0x00,0x00 }},
845 /* /112 */ {{ 0xff,0xff,0xff,0xff,
848 0xff,0xff,0x00,0x00 }},
849 /* /113 */ {{ 0xff,0xff,0xff,0xff,
852 0xff,0xff,0x80,0x00 }},
853 /* /114 */ {{ 0xff,0xff,0xff,0xff,
856 0xff,0xff,0xc0,0x00 }},
857 /* /115 */ {{ 0xff,0xff,0xff,0xff,
860 0xff,0xff,0xe0,0x00 }},
861 /* /116 */ {{ 0xff,0xff,0xff,0xff,
864 0xff,0xff,0xf0,0x00 }},
865 /* /117 */ {{ 0xff,0xff,0xff,0xff,
868 0xff,0xff,0xf8,0x00 }},
869 /* /118 */ {{ 0xff,0xff,0xff,0xff,
872 0xff,0xff,0xfc,0x00 }},
873 /* /119 */ {{ 0xff,0xff,0xff,0xff,
876 0xff,0xff,0xfe,0x00 }},
877 /* /120 */ {{ 0xff,0xff,0xff,0xff,
880 0xff,0xff,0xff,0x00 }},
881 /* /121 */ {{ 0xff,0xff,0xff,0xff,
884 0xff,0xff,0xff,0x80 }},
885 /* /122 */ {{ 0xff,0xff,0xff,0xff,
888 0xff,0xff,0xff,0xc0 }},
889 /* /123 */ {{ 0xff,0xff,0xff,0xff,
892 0xff,0xff,0xff,0xe0 }},
893 /* /124 */ {{ 0xff,0xff,0xff,0xff,
896 0xff,0xff,0xff,0xf0 }},
897 /* /125 */ {{ 0xff,0xff,0xff,0xff,
900 0xff,0xff,0xff,0xf8 }},
901 /* /126 */ {{ 0xff,0xff,0xff,0xff,
904 0xff,0xff,0xff,0xfc }},
905 /* /127 */ {{ 0xff,0xff,0xff,0xff,
908 0xff,0xff,0xff,0xfe }},
909 /* /128 */ {{ 0xff,0xff,0xff,0xff,
912 0xff,0xff,0xff,0xff }},